Control Transfer Instructions and Programming Using 8051 Microcontrolle
Control Transfer Instructions and Programming Using 8051 Microcontrolle
OPCODE 8 bit
Types Of Instructions
1. Register addressing.
2. Direct addressing.
3. Register indirect addressing.
4. Immediate addressing.
5. Index addressing.
Register Addressing Mode
For example;
For example;
For example;
For example;
For example;
ADD A, Rn A = A + Rn 1
ADD A, Rx A = A + Rx 2
ADD A, @ Ri A = A+ Ri 1
Arithmetic Instructions
ADD A, # X A = A + Byte 2
ADDC A, Rn A = A + Rn + C 1
ADDC A , Rx A = A + Rx + C 2
Arithmetic Instructions
ADDC A, @ Ri A = A + Ri + C 1
ADDC A, # X A = A + Byte + C 2
SUBB A, Rn A = A – Rn – 1 1
Arithmetic Instructions
SUBB A, Rx A = A – Rx – 1 2
SUBB A, @ Ri A = A – Ri – 1 1
SUBB A, # X A = A – Byte – 1 2
Arithmetic Instructions
INC A A=A+1 1
INC Rn Rn = Rn + 1 1
INC Rx Rx = Rx + 1 2
Arithmetic Instructions
INC @ Ri Ri = Ri + 1 1
DEC A A=A–1 1
DEC Rn Rn = Rn – 1 1
Arithmetic Instructions
DEC Rx Rx = Rx – 1 2
DEC @ Ri Ri = Ri – 1 1
MUL AB B:A = A * B 1
DIV AB A = [A/B] 1
DA A Decimal adjustment of 1
accumulator according to BCD
code
Logical Instructions
RL A (An + 1) (An) 1
(A0) (A7)
RLC (An + 1) (An) 1
(A0) (C)
(C) (A7)
Logical Instructions
RR A (An) (An + 1) 1
(A7) (A0)
CLR C (C=0) 1
SETB C (C=1) 1
Logical Instructions On Bits
CPL C (1 = 0, 0 = 1) 1
(SP) (SP) – 1
(PC7-0) ((SP))
(SP) (SP) - 1
Program Flow Control Instructions
NOP No operation 1
Summary
Instruction set.
Addressing modes.
Data transfer instruction.
Arithmetic instruction.
Logical instruction.
Logical operation on bits.