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

17 lines
256 B
C

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