Files
linux-kernel-module-cheat/userland/arch/x86_64/asm_hello.c
Ciro Santilli 六四事件 法轮功 a30ed0f047 inline assembly: improve everywhere
2019-02-25 00:00:00 +00:00

17 lines
247 B
C

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