Example 5. Assembly Program for Example 4
;------------------------------------------------------------------------------
; Tell assembler we reference variable _svar, which is defined in cvars.c file.
;------------------------------------------------------------------------------
.ref _svar
;------------------------------------------------------------------------------
; addfive() - Add five to the second data member of _svar
;------------------------------------------------------------------------------
.text
.global addfive
addfive: .asmfunc
MOVZ DP,#_svar+1 ; load the DP with svar's memory page
ADD @_svar+1,#5 ; add 5 to svar.m2
LRETR ; return from function
.endasmfunc