Examples

Executable examples demonstrating varm features.

Exit Code

mov r0, #42
mov r7, #1
swi

Hello World

.data
msg: .byte 'H', 'e', 'l', 'l', 'o', '!'

.text
mov r0, #1
ldr r1, =msg
mov r2, #6
mov r7, #3
swi
mov r0, #0
mov r7, #1
swi

Arithmetic

mov r0, #42
mov r1, #10
add r2, r0, r1
mov r0, r2
mov r7, #1
swi

Load Data

.data
value: .byte 42

.text
ldr r0, =value
ldrb r0, [r0]
mov r7, #1
swi

See Tutorial for a comprehensive tutorial and Exercises for practice problems.