APPENDIX A PROGRAM LIST
RETI
;
Return
from
interrupt
servicing
;-----------------------------------------------------------------------------
;
Subroutine for a 1 ms wait (for 4 MHz operation)
;
;This is a subroutine for performing a rendezvous in ms units by using
;software.
;This subroutine is called by the number of times required when performing a
;rendezvous in ms units.
;The time in ms units that is indicated with #num can be measured more
;accurately by setting as follows. (saddr: short direct addressable memory
;area)
; MOV
saddr, #num
;loopxx:
; CALL
!WAIT_1MS
; DBNZ
saddr, $loopxx
;-----------------------------------------------------------------------------
WAIT_1MS:
PUSH BC
; Save the BC register data to the stack
MOV
B,
#220
; Assign the 220-time loop count value
LOOP_220:
NOP
NOP
NOP
NOP
NOP
NOP
DBNZ B,
$LOOP_220
; 220-time loop for a 1 ms wait
NOP
NOP
POP
BC
; Restore the BC register data
RET
;
Return
from
the
subroutine
end
Application Note U18847EJ1V0AN
29