mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
15 lines
266 B
ArmAsm
15 lines
266 B
ArmAsm
/* https://cirosantilli.com/linux-kernel-module-cheat#x86-binary-arithmetic-instructions
|
|
*
|
|
* Negate: i *= -1.
|
|
*/
|
|
|
|
#include <lkmc.h>
|
|
|
|
LKMC_PROLOGUE
|
|
mov $2, %rax
|
|
neg %rax
|
|
LKMC_ASSERT_EQ(%rax, $-2)
|
|
neg %eax
|
|
LKMC_ASSERT_EQ(%rax, $2)
|
|
LKMC_EPILOGUE
|