Professional Documents
Culture Documents
Instruction Groups
• The 8051 has 255 instructions
– Every 8-bit opcode from 00 to FF is used except for
A5.
Microcontroller Intel 8051
• The instructions are grouped into 5 groups
– Arithmetic
[Instruction Set] – Logic
– Data Transfer
– Boolean
– Branching
• ADDC
MOV R1, #25H ; load data 25H into R1
– 8-bit addition between the accumulator, a second
operand and the previous value of the CY flag.
• Useful for 16-bit addition in two steps.
• The CY flag is set/reset appropriately.
2
• SUBB
– Subtract with Borrow.
MOV Instruction: • Subtract an operand and the previous value of the borrow (carry)
flag from the accumulator.
MOV destination, source – A A - <operand> - CY.
– The result is always saved in the accumulator.
Example: – The CY flag is set/reset appropriately.
1. MOV A, $55H
2. MOV R0, A
3. MOV A, R3
3
1
30-Jun-18
2
30-Jun-18
3
30-Jun-18
4
30-Jun-18
5
30-Jun-18
• Not all combinations are valid. • MOVX A, @R1 ; Move contents of external
– MOV R2, R1 ; Invalid memory location whose address
is in R1 into A
6
30-Jun-18