Mitsubishi DS907x SIP User Manual page 158

Mitsubishi microcontroller user's guide
Table of Contents

Advertisement

USER'S GUIDE
POP
POP
RET
;
;************************************
;*** SUBROUTINE TO WRITE A DATA BYTE
;************************************
;
; This subroutine performs a "context switch" to the CE2 data
; space and then writes one byte from the accumulator to the
; timekeeping device.
; space and returns with all registers unchanged.
;
WBYTE:
PUSH
PUSH
PUSH
ORL
PUSH
MOV
LO:
PUSH
ANL
MOV
MOVX
POP
RR
DJNZ
POP
POP
POP
POP
RET
;
;****************
; END OF PROGRAM
;****************
;
END
050396 157/173
DPH
DPL
Then it switches back to the CE1 data
DPL
DPH
MCON
MCON,#4
B
DPH,#0
MOV
B,
#8
ACC
A, #1
DPL,A
A, @DPTR
ACC
A
B, LO
B
MCON
DPH
DPL
158
;Restore the data
; pointer from stack.
;Return.
;Save the data
; pointer on stack.
;Save the MCON register.
;Switch to CE2.
;Save the B register.
;Set high address byte.
;Set the bit Count.
;Save the accumulator.
;Set up bit for output.
;Set address to write bit.
;Output the data bit.
;Restore the accumulator.
;Position next bit.
;Loop for a whole byte.
;Restore the B register.
;Restore the MCON register.
;Restore the data
; pointer from stack.
;Return.
;End of program.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ds5000tkDs5000fpDs5001fpDs5002fp

Table of Contents