Skip to content

Instantly share code, notes, and snippets.

@avatsaev
Last active November 30, 2015 12:04
Show Gist options
  • Save avatsaev/00d436e543eca3afb507 to your computer and use it in GitHub Desktop.
Save avatsaev/00d436e543eca3afb507 to your computer and use it in GitHub Desktop.
.arch armv6
.fpu vfp
msg: .ascii "Hello ARM!\n"
.text
.align 2
.global main
main:
mov r0, #1 @argument 1: descripteur de fichier 1 (stdout)
ldr r1, =msg @argument 2: la chaine a ecrire
mov r2, #12 @argument 3: nombre d'octets a ecrire
mov r7, #4 @numero du system call (4=SYS_write) -> voir sys/syscall.h
swi #0 @effectuer un software interrupt avec les arguments
mov r0, #0 @code de sortie 0
mov r7, #1 @system call 1 (1 = SYS_exit)
swi #0 @effectuer le software interrupt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment