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