!====================================================================== ! hello.S !====================================================================== !====================================================================== .section ".rodata" !====================================================================== pcGreeting: .asciz "Hello\n" !====================================================================== .section ".data" !====================================================================== !====================================================================== .section ".bss" !====================================================================== !====================================================================== .section ".text" !====================================================================== !---------------------------------------------------------------------- ! int main(int argc, char *argv[]) ! ! Write "Hello\n" to stdout. ! ! Register map: ! %i0 int argc ! %i1 char *argv[] !---------------------------------------------------------------------- .align 4 .global main main: save %sp, -96, %sp ! printf("Hello\n"); set pcGreeting, %o0 call printf nop ! return 0; mov 0, %i0 ret restore