mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 04:24:26 +01:00
inline assembly: improve everywhere
This commit is contained in:
@@ -2,7 +2,12 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
int main(void) {
|
||||
register uint32_t x0 __asm__ ("x0");
|
||||
__asm__ ("mov x0, #1;" : : : "%x0");
|
||||
assert(x0 == 1);
|
||||
uint32_t myvar = 1;
|
||||
__asm__ (
|
||||
"add %[myvar], %[myvar], 1;"
|
||||
: [myvar] "=r" (myvar)
|
||||
:
|
||||
:
|
||||
);
|
||||
assert(myvar == 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user