mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-30 13:24:27 +01:00
x86 asm: move binary arithmetic instructions from x86-assembly-cheat except cmp
This commit is contained in:
14
userland/arch/x86_64/div_overflow.S
Normal file
14
userland/arch/x86_64/div_overflow.S
Normal file
@@ -0,0 +1,14 @@
|
||||
/* 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
|
||||
Reference in New Issue
Block a user