File: armasm.actual

package info (click to toggle)
golang-github-alecthomas-chroma 0.10.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 6,264 kB
  • sloc: python: 426; javascript: 79; sh: 32; makefile: 32
file content (17 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@ Hello World in ARM Assembly for Linux system

.global _start

_start:
    mov  r7, #4          @ Setup service call 4 (write)
    mov  r0, #1          @ param 1 - File descriptor 1 = stdout
    ldr  r1, =hello      @ param 2 - address of string to print
    mov  r2, #13         @ param 3 - length of hello world string
    svc  0               @ ask linux to write to stdout

    mov  r7, #1          @ Setup service call 1 (exit)
    mov  r0, #0          @ param 1 - 0 = normal exit
    svc  0               @ ask linux to terminate us

.data
hello:    .ascii    "Hello World!\n"