2 # All assembler tests should start with a call to "start"
6 # Skip over these inlined funcs.
10 .type __pass, function
12 # Note - we cannot just invoke:
14 # write 1, _passmsg, 5
16 # here because _passmsg contains the run-time (VMA) address of
17 # the pass string (probably 0x500) not the load-time (LMA)
18 # address (probably 0x804c). Normally using the VMA address
19 # would be the correct thing to do - *if* there was some start
20 # up code which copied data from LMA to VMA. But we have no
21 # start up code, so the data still resides at the LMA
22 # address. Hence we use __romdatastart instead.
24 # Note - we are cheating because the address that we pass to
25 # "write" should actually be:
27 # __romdatastart + (_passmsg - __datastart)
29 # but the assembler cannot cope with this expression. So we
30 # cheat and use the fact that we know that _passmsg is the
31 # first string in the .data section and so (_passmsg -
32 # __datastart) evaluates to zero.
34 write 1, __romdatastart, 5
38 .type __fail, function
42 # write 1, _failmsg, 5
44 # This time we use the fact that _passmsg is aligned to a
45 # 16 byte boundary to work out that (_failmsg - __datastart)
48 write 1, __romdatastart + 0x10, 5
62 .type __start, function
67 # Make a libgloss/Linux system call
68 .macro system_call nr:req
73 # Quit the current test
80 # Write 'pass' to stdout via syscalls and quit;
81 # meant for non-OS operating environments
87 # Write 'fail' to stdout via syscalls and quit;
88 # meant for non-OS operating environments
94 # Just like the write() C function; uses system calls
95 .macro write fd:req, buf:req, count:req