1 # MACRO: exit 2 .macro exit nr 3 mvi r1, \nr; 4 # Trap function 1: exit(). 5 mvi r8, 1; 6 scall; 7 .endm 8 9 # MACRO: pass 10 # Write 'pass' to stdout and quit 11 .macro pass 12 # Trap function 5: write(). 13 mvi r8, 5; 14 # Use stdout. 15 mvi r1, 1; 16 # Point to the string. 17 mvhi r2, hi(1f) 18 ori r2, r2, lo(1f) 19 # Number of bytes to write. 20 mvi r3, 5; 21 # Trigger OS trap. 22 scall; 23 exit 0 24 .data 25 1: .asciz "pass\n" 26 .endm 27 28 # MACRO: fail 29 # Write 'fail' to stdout and quit 30 .macro fail 31 # Trap function 5: write(). 32 mvi r8, 5; 33 # Use stdout. 34 mvi r1, 1; 35 # Point to the string. 36 mvhi r2, hi(1f) 37 ori r2, r2, lo(1f) 38 # Number of bytes to write. 39 mvi r3, 5; 40 # Trigger OS trap. 41 scall; 42 exit 0 43 .data 44 1: .asciz "fail\n" 45 .endm 46 47 # MACRO: start 48 # All assembler tests should start with a call to "start" 49 .macro start 50 .data 51 .global _fstack 52 _fstack: 53 .rept 0x1024 54 .byte 00 55 .endr 56 .text 57 .global _start 58 _start: 59 .endm 60