x86 asm: move rotation and bit instructoins in from x86-assembly-cheat

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-06-16 00:00:03 +00:00
parent 89084d2332
commit 658ac53d0f
10 changed files with 313 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-bit-and-byte-instructions */
#include <lkmc.h>
LKMC_PROLOGUE
/* 0101 1010 */
mov $0x5A, %r12
btr $1, %r12
LKMC_ASSERT(jc)
LKMC_ASSERT_EQ(%r12, $0x58)
/* 0101 1000 */
btr $1, %r12
LKMC_ASSERT(jnc)
LKMC_ASSERT_EQ(%r12, $0x58)
LKMC_EPILOGUE