/****************************************************************************** Example #22 -- SPARC data organization (records) ******************************************************************************/ .global main .section ".text" .align 4 main: save %sp, -96, %sp set pointA, %l7 ! %l7: the address of "pointA" set fmt, %o0 ! 1st argument: address of format string ldub [%l7+0], %o1 ! 2nd argument: label ld [%l7+4], %o2 ! 3rd argument: X coordinate ld [%l7+8], %o3 ! 4th argument: Y coordinate call printf ! Display one point nop set pointB, %l7 ! %l7: the address of "pointB" set fmt, %o0 ! 1st argument: address of format string ldub [%l7+0], %o1 ! 2nd argument: label ld [%l7+4], %o2 ! 3rd argument: X coordinate ld [%l7+8], %o3 ! 4th argument: Y coordinate call printf ! Display one point nop set pointA, %o0 ! 1st argument: starting address set pointA+24, %o1 ! 2nd argument: ending address call memory ! Display memory containing the points nop set main, %o0 ! 1st argument: starting address set main+0x100, %o1 ! 2nd argument: ending address call memory ! Display memory containing the instructions nop ret restore fmt: .asciz "\nPoint %c: ( %d, %d )\n" .align 4 .section ".data" .align 4 pointA: .byte 'A' ! Label .align 4 .word 12, 16 ! X and Y coordinates pointB: .byte 'B' ! Label .align 4 .word 19, 14 ! X and Y coordinates