Files
Ciro Santilli 六四事件 法轮功 0c9afcf9b6 asm: prefix every linux specific with linux/
2019-05-05 00:00:00 +00:00

24 lines
489 B
ArmAsm

/* arm freestanding Linux hello world
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
*/
.syntax unified
.text
.global _start
_start:
asm_main_after_prologue:
/* write */
mov r0, 1 /* stdout */
adr r1, msg /* buffer */
ldr r2, =len /* len */
mov r7, 4 /* syscall number */
svc 0
/* exit */
mov r0, 0 /* exit status */
mov r7, 1 /* syscall number */
svc 0
msg:
.ascii "hello\n"
len = . - msg