start_:
  set r0, main
  or pc, r0, r0

hello:
  .word 0x4865
  .word 0x6c6c
  .word 0x6f2c
  .word 0x2077
  .word 0x6f72
  .word 0x6c64
  .word 0x2100

uart_send:  // r0 is pointer to data, r1, length
  set r2, 0
  set r3, 0x10
  seth r3, 0xc0
  set r4, 1
 loop0:
  load r5, [r3, 2]
  and r5, r5, r4
  cmp r5, r2
  beq loop0
  load r5, [r0]
  and r6, r0, r4
  cmp r6, r4
  beq [pc, 2]
  shr r5, r5, 8
  store r5, [r3]
  add r0, r0, r4
  sub r1, r1, r4
  cmp r1, r2
  bneq loop0
  or pc, lr, lr

main:
  set r0, hello
  set r1, 13
  set r2, uart_send
  set r3, main
  or lr, r3, r3
  or pc, r2, r2
