From 76c7cfe5aaf6330a541a7841bc4f530959854798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 16 Jun 2019 00:00:05 +0000 Subject: [PATCH] x86 asm: move NOP in from x86-assembly-cheat --- README.adoc | 14 ++++++++++++++ userland/arch/x86_64/nop.S | 13 +++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 userland/arch/x86_64/nop.S diff --git a/README.adoc b/README.adoc index acadc49..1890029 100644 --- a/README.adoc +++ b/README.adoc @@ -12473,6 +12473,20 @@ link:userland/arch/x86_64/loop.S[LOOP] Vs <>: https://stackoverflow.com/questions/6805692/x86-assembly-programming-loops-with-ecx-and-loop-instruction-versus-jmp-jcond Holy CISC! +=== x86 miscellaneous instructions + +<> 7.3.16 "Miscellaneous Instructions" + +==== x86 NOP instruction + +link:userland/arch/x86_64/nop.S[NOP] + +No OPeration. + +Does nothing except take up one processor cycle and occupy some instruction memory. + +Applications: http://stackoverflow.com/questions/234906/whats-the-purpose-of-the-nop-opcode + === x86 random number generator instructions <> 5.1.15 Random Number Generator Instructions diff --git a/userland/arch/x86_64/nop.S b/userland/arch/x86_64/nop.S new file mode 100644 index 0000000..16a1960 --- /dev/null +++ b/userland/arch/x86_64/nop.S @@ -0,0 +1,13 @@ +/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-nop-instruction */ + +#include + +LKMC_PROLOGUE + nop + nop + + /* Other nops + * http://stackoverflow.com/questions/11910501/why-did-gcc-generate-mov-eax-eax-and-what-does-it-mean + */ + mov %rax, %rax +LKMC_EPILOGUE