Files
linux-kernel-module-cheat/userland/arch/x86_64/binutils_hack.c
Ciro Santilli 六四事件 法轮功 23f80c2310 binutils: describe gas hello world hack
2019-03-05 00:00:02 +00:00

19 lines
271 B
C

#include <assert.h>
#include <inttypes.h>
int main(void) {
#if 0
uint64_t in = 0xFFFFFFFF;
uint64_t out = 0;
__asm__ (
"mov %[in], %%rax;"
"myinc %%rax;"
"movq %%rax, %[out]"
: [out] "=g" (out)
: [in] "g" (in)
: "rax"
);
assert(out == in + 1);
#endif
}