SC73C1402
a.
b.
c.
d.
IN A, %P
IN @LR, %P
OUT %P, A
OUT %P, @LR
Move the value of port (P) to the accumulator
Move the value of port (P) to ROM pointed at by the LR register.
Move the contents of the accumulator to port (P).
Load the contents of RAM pointed at by the LR register to port (P).
The above four input/output instructions are used mostly for port operation; the two read instructions would
affect the status flag SF.
3. Arithmetic and logical instructions
Instruction
ADD A, @LR
ADDC A, @LR
ADD A, #K
ADD L, #K
SUBRC A, @LR
INC @LR
DEC @LR
INC D
DEC D
AND A, @LR
OR A, @LR
XOR A, @LR
a.
b.
c.
d.
e.
ADD A, @LR
ADDC A, @LR
ADD A, #K
ADD L, #K
SUBRC A, @LR
Operation
A
←
A+RAM (LR)
A
←
A+RAM (LR)+CF
A
←
A+K
LR
←
LR+K
A
←
RAM (LR)-A-/CF
RAM (LR)
←
RAM (LR)+1
RAM (LR)
←
RAM (LR)-1
DC
←
DC+1
DC
←
DC-1
A
←
A&RAM (LR)
A
←
A | RAM (LR)
A
←
A^RAM (LR)
CF
---
C
---
---
C
---
---
---
---
---
---
---
SF
/C
/C
/C
/C
C
/C
C
/C
C
/Z
/Z
/Z
Cycle
1
1
1
2
1
1
1
1
1
1
1
1
Add the contents of RAM pointed at by the LR to accumulator. Store the sum in the
ACC. This operation will affect SF, SF=/CF.
Add the contents of RAM pointed at by the LR register to accumulator with carry.
Store the carry bit in the CF. This operation will affect SF, SF=/CF.
Add immediate K to accumulator. Store the sum in the ACC. This operation will
affect SF, SF=/CF.
Add immediate K to the LR register. Store the sum in the LR. This operation will
affect SF, SF=/CF.
Subtract instruction with borrow (the complement of carry). Subtract the contents of
the accumulator from the contents of RAM pointed at by the LR register, subtract the
complement of the carry bit, then store the results in the accumulator, transfer the
carry bit to the CF. This will affect SF and CF, SF=CF.
f.
g.
h.
i.
j.
INC @LR
DEC @LR
INC D
DEC D
AND A, @LR
Increment instruction, it increments the contents of RAM pointed at by the LR
register by 1. This will affect SF, SF=/CF.
Decrement instruction. The contents of RAM pointed at by the LR register decrement
by 1. This will affect SF, SF=CF.
Increment instruction, it increments the contents of the D register by 1. This will
affect SF, SF=/CF.
Decrement instruction, it decrements the contents of the D register by 1. This will
affect SF, SF=/CF.
The contents of the accumulator and RAM pointed at by the L register are ANDed
HANGZHOU SILAN MICROELECTRONICS CO.,LTD
Http: www.silan.com.cn
REV:1.1
2005.12.19
Page 10 of 20