Clemson University -- CPSC 231 -- Fall 2009 you can call printf from a SPARC assembly language program some of the details will be explained later, but for now use this skeleton - note that you have to use the registers %o0 and %o1 for the call to printf main: save %sp, -96, %sp set fmt, %o0 mov , %o1 call printf nop ret restore .section ".rodata" fmt: .asciz "%d\n" you can change the format string in "fmt" to include a label, use a different format specifier, etc. - if you add additional values to print, you will need to move those values into %o2, %o3, etc. you can also add additional format strings main: save %sp, -96, %sp set fmt1, %o0 mov , %o1 mov , %o2 call printf nop set fmt2, %o0 mov , %o1 mov , %o2 call printf nop ret restore .section ".rodata" fmt1: .asciz "values in decimal are %d and %d\n" fmt2: .asciz "values in hex are 0x%08x and 0x%08x\n"