The 64–bit absolute code model for add() might look like this:
add:
sethi %hh(sum),%o5
sethi %lm(sum),%o2
or %o5,%hm(sum),%o4
sllx %o4,32,%o3
or %o3,%o2,%o1
ld [%o1+%lo(sum)],%g5
add %g5,%o0,%g3
retl
st %g3,[%o1+%lo(sum)]Here it takes 6 instruction to form address of sum. The operators act as follows:
|