Files
linux-kernel-module-cheat/userland/arch/x86_64/div_overflow.S
2019-06-12 00:00:00 +00:00

15 lines
342 B
ArmAsm

/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-binary-arithmetic-instructions
*
* If the result of div does not fit into the output register rax, then we get SIGFPE.
*/
#include <lkmc.h>
LKMC_PROLOGUE
/* rdx:rax / 2 == 2:0 / 2 == 1:0 */
mov $2, %rdx
mov $0, %rax
mov $2, %rbx
div %rbx
LKMC_EPILOGUE