; Contains directives not compatible with fasm:
; https://github.com/daniel5151/armv4t_emu/blob/master/tests/data/emutest_thm3.S
;
; ... so the binary was directly compied.
;
; expected result: 0x1f8 = 8, 0x1fc = 0x200, 0x200 = 64

; bootstrap code
; ARM MODE (Entrypoint)
processor CPU32_V1
  code32
    mov sp, 200
    mov r0, main - 1
processor CPU32_V4T
    BX r0

code16
  main:
    add r0, pc, #4
    add sp, #-8
    mov r1, sp
    stmia r1!, {r0, r1}

    mov r2, #6
    mov r3, #1
    mov r4, #0

  loop:
    sub r2, #1
    add r3, r3, r3
    cmp r2, r4
    bne loop
    str r3, [r1, #0]
