Example 4. Assembly Program for Example 3
;-------------------------------------------------------------------------------------
; Tell assembler we're referencing "svar", which is defined in another file (cvars.c).
;-------------------------------------------------------------------------------------
.ref svar
;------------------------------------------------------------------------------
; addfive() - Add five to the second data member of svar
;------------------------------------------------------------------------------
.sect ".text:addfive"
.global addfive
addfive: .asmfunc
LDI r0, svar+4
LBBO &r1, r0, 0, 4
ADD r1, r1, 0x05
SBBO &r1, r0, 0, 4
JMP r3.w2
.endasmfunc