1# MACRO: exit 2 .macro exit nr 3 ldi.l $r0, \nr; 4 # Trap function 1: exit(). 5 swi 1; 6 .endm 7 8# MACRO: pass 9# Write 'pass' to stdout and quit 10 .macro pass 11 # Use stdout. 12 ldi.b $r0, 1; 13 # Point to the string. 14 ldi.l $r1, 1f; 15 # Number of bytes to write. 16 ldi.s $r2, 5; 17 # Trap function 5: write(). 18 swi 5; 19 exit 0 20 .data 21 1: .asciz "pass\n" 22 .endm 23 24# MACRO: fail 25# Write 'fail' to stdout and quit 26 .macro fail 27 # Use stdout. 28 ldi.b $r0, 1; 29 # Point to the string. 30 ldi.l $r1, 1f; 31 # Number of bytes to write. 32 ldi.s $r2, 5; 33 # Trap function 5: write(). 34 swi 5; 35 exit 0 36 .data 37 1: .asciz "fail\n" 38 .endm 39 40# MACRO: start 41# All assembler tests should start with a call to "start" 42 .macro start 43 .text 44.global _start 45_start: 46 .endm 47