LL0: .seg "data" .seg "text" .proc 04 .global _sum2 _sum2: !#PROLOGUE# 0 sethi %hi(LF12),%g1 add %g1,%lo(LF12),%g1 save %sp,%g1,%sp !#PROLOGUE# 1 !!------------------------------- compiler generated code, inefficient st %i0,[%fp+0x44] st %i1,[%fp+0x48] ld [%fp+0x44],%o0 ld [%fp+0x48],%o1 add %o0,%o1,%o0 b LE12 nop LE12: ! mov %o0,%i0 ! return the sum of arguments in %o0 ! --------------------------------------------------------------------- ! --------------------------------- replace by: add %i0,%i1,%i0 ! return arg0 + arg1 ret restore ! example of instr. in "delay slot" LF12 = -64 LP12 = 64 LST12 = 64 LT12 = 64 .seg "data" .seg "text" .proc 04 .global _main _main: !#PROLOGUE# 0 sethi %hi(LF15),%g1 add %g1,%lo(LF15),%g1 save %sp,%g1,%sp !#PROLOGUE# 1 mov 0x3,%o0 mov 0x4,%o1 call _sum2,2 !sum2 (3,4) nop st %o0,[%fp+-0x4] ! save result in a .seg "data1" L18: .ascii "Hello, there, %d\012\0" .seg "text" set L18,%o0 !printf ("Hello....", a); ld [%fp+-0x4],%o1 call _printf,2 nop mov 0,%o0 !return 0 b LE15 nop LE15: mov %o0,%i0 ret restore LF15 = -104 LP15 = 96 LST15 = 96 LT15 = 96 .seg "data"