The gcc cross development system includes a wide range of standard C functions that are available to the user. Let's look at an example of an assembly program which calls the C function printf.
Download the assembly program hellos.s:
/* hellos.s */ .text .even .global main main: pea words /* push address of char string on stack */ jsr printf /* jump to C function printf */ addq.l #4,%a7 /* clean up stack on return */ rts words: .ascii "Hello from assembly world!\n\0"
Note that the string words is terminated by the null character 0, C style.
Exercise.
go 10000
ANU Engineering - ENGN3213