Control Of The Input Port; Examples Of Input Port Control Program - Epson E0C6001 Technical Manual

Cmos 4-bit single chip microcomputer
Table of Contents

Advertisement

E0C6001 TECHNICAL SOFTWARE
Control of
the input port
Examples of input
port control
program
Fig. 3.1.1
Loading the A register
II-14
The E0C6001 has one 4-bit input port (K00–K03). Input port
data can be read as a 4-bit unit (K00–K03).
The state of the input ports can be obtained by reading the
data (bits D3, D2, D1, D0) of address 0E0H. The input ports
can be used to send an interrupt request to the CPU via the
input interrupt condition flag. See Section 3.8 "Interrupt
and Halt", for details.
• Loading K00–K03 into the A register
Label
Mnemonic/operand
LD
Y,0E0H
LD
A,MY
As shown in Figure 3.1.1, the two instruction steps above
load the data of the input port into the A register.
A register
The data of the input port can be loaded into the B register
or MX instead of the A register.
Comment
;
Set address of port
A register ← K00–K03
;
D3
D2
D1
D0
K03
K02
K01
K00

Advertisement

Table of Contents
loading

Table of Contents