mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
15 lines
335 B
ArmAsm
15 lines
335 B
ArmAsm
/* https://cirosantilli.com/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
|