
2.4 Instruction Details
3-168
2
Chapter 2 Instructions
Application of SRA/SLA instructions
■ Fetching four-digit data of the BCD digital switch (inputs 0004 through 0011
for low-order 2 digits and 0100 through 0107 for high-order 2 digits) to
transfer them as a counter setting value
■ Separate input of BCD
Fetches only 2 digits of the BCD digital switch (0112 to 0115 for the 1st digit, 0000 to
0003 for the 2nd digit) and sets it as the counter value.
Coding
2002 0000
LDA
$0FF0
ANDA
#04
SRA
DM0000
STA
0100
LDA
$00FF
ANDA
#08
SLA
DM0000
ORA
C004
STA
0001
#09999
C004
0000
Line No. Instruction Operand
0000 LD 0001
0001 C 001 #00099 0000
0002 LD 2002
0003 LDA 0100
0004 CON
0005 ANDA $F000
0006 LD 2002
0007 SRA #12
0008 CON
0009 STA DM0000
0010 LD 2002
0011 LDA 0000
0012 CON
0013 ANDA $000F
0014 LD 2002
0015 SLA #04
0016 CON
0017 ORA DM0000
0018 LD 2002
0019 TBIN
0020 CON
0021 STA C001
0001
STA
#12
SRA
$000F
ANDA
0000
LDA
$F000
DM0000
ANDA
0100
LDA
2002
2002
2002
#00099
C001
0000
DM0000
ORA
#04
SLA
2002
C001
STA
TBIN
2002
Converts the data of internal register to BIN data and writes it into
C001.
Sets C001.
Sends the data of 0112 to 0115 to internal register.
Shifts the value of internal register to right by 12 bits and writes it
into DM0000.
Sends the data of 0000 to 0003 to internal register.
Shifts the data of internal register to left by 4 bits, ORs the internal
register data and the data of DM0000, and sends the ORed data to
the internal register.
SRA / @SRA / SLA / @SLA
KVNKA Chap 02_4dP.p65 08.3.11, 0:03 PM168
Comentarios a estos manuales