Specifications

Table Of Contents
II-30 EPSON S1C62740 TECHNICAL SOFTWARE
CHAPTER 6: PERIPHERAL CIRCUITS (I/O Ports)
Loading contents of B register into P00–P03
Label Mnemonic/operand Comment
;*
;* I/O PORT
;*
;* LOADING CONTENTS OF B REGISTER INTO P00-P03
;
ZIOC EQU 0D6H ;I/O PORT CONTROL REGISTER
ZPUP EQU 0D7H ;I/O PORT PULL-UP CONTROL REGISTER
ZP0 EQU 0D8H ;I/O PORT P00-P03
;
LD Y,ZPUP ;SET PULL-UP CONTROL REGISTER ADDRESS
AND MY,1110B ;DISABLE P00-P03 PULL UP RESISTORS
LD Y,ZIOC ;SET I/O PORT CONTROL ADDRESS
OR MY,0001B ;SET P00-P03 AS OUTPUT PORT
LD Y,ZP0 ;SET ADDRESS OF P00-P03
LD MY,B ;LOAD DATA INTO P00-P03
;
As shown in Figure 6.5.3, the above program loads the data of the
B register into the I/O ports.
D3 D2 D1 D0
Data register
P00
Data register
P01
Data register
P02
Data register
P03
B register
The output data can be taken from the A register, MX, or immedi-
ate data instead of the B register.
Fig. 6.5.3
Control of I/O port (Output)