Files
linux-kernel-module-cheat/userland/arch/arm/c/add.c
Ciro Santilli 六四事件 法轮功 0263c21557 userland: add assembly support
Move arm assembly cheat here, and start some work on x86 cheat as well.
2019-05-05 00:00:00 +00:00

18 lines
323 B
C

/* 1 + 2 == 3 */
#include <assert.h>
#include <inttypes.h>
int main(void) {
uint32_t in0 = 1, in1 = 2, out;
__asm__ (
"add %[out], %[in0], %[in1];"
: [out] "=r" (out)
: [in0] "r" (in0),
[in1] "r" (in1)
);
assert(in0 == 1);
assert(in1 == 2);
assert(out == 3);
}