mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 13:04:27 +01:00
x86 asm: move binary arithmetic instructions from x86-assembly-cheat except cmp
This commit is contained in:
17
userland/arch/x86_64/div_zero.S
Normal file
17
userland/arch/x86_64/div_zero.S
Normal file
@@ -0,0 +1,17 @@
|
||||
/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-binary-arithmetic-instructions
|
||||
*
|
||||
* SIGFPE :-)
|
||||
*
|
||||
* Signal handlind discussed at:
|
||||
* https://stackoverflow.com/questions/39431879/c-handle-signal-sigfpe-and-continue-execution/39431923#39431923
|
||||
*/
|
||||
|
||||
#include <lkmc.h>
|
||||
|
||||
LKMC_PROLOGUE
|
||||
/* rdx:rax / 0 */
|
||||
mov $0, %rdx
|
||||
mov $1, %rax
|
||||
mov $0, %rbx
|
||||
div %rbx
|
||||
LKMC_EPILOGUE
|
||||
Reference in New Issue
Block a user