10.1. 8051 Microcontroller Instruction Set
10.1.1. Addr11 ACALL
Function: Absolute Call
Description:
Unconditionally calls a subroutine ACALL Located at the address Indicated. The instruction Increments the PC Twice to Obtain the address of the Following instruction, Then pushes the 16-bit result onto the stack (low-order byte first) and the Stack Pointer Increments twice. The destination address is Obtained by successively concatenating the five high-order bits of the increased PC, opcode bits 7-through 5, and the second byte of the instruction. The must-Called subroutine start THEREFORE Within the Same 2 K block of the program memory as the first byte of the instruction Following ACALL. Are No flags affected.
Example:
INITIALLY SP equals 07H. The label SUBRTN is at program memory location 0345 H. After executing the Following instruction,
SUBRTN ACALL
at location 0123H, SP contains 09H, internal RAM locations 08H and 09H will Contain 25H and 01H, respectivamente, and the PC contains 0345H.
Bytes: 2
Cycles: 2
Encoding:
a10 | a9 | a8 | 1 | 0 | 0 | 0 | 1 | , | a7 | a6 | a5 | a4 | a3 | a2 | a1 | a0 |
Operation: ACALL
(PC) ← (PC) + 2
(SP) ← (SP) + 1
((SP)) ← (PC7-0)
(SP) ← (SP) + 1
((SP)) ← (PC15-8)
(PC10-0) ← page address
10.1.2. ADD A, "src-byte
Function: Add
Description:
ADD adds the variable byte indicated to the Develped, leaving the result in the Develped. The carry and auxiliary-carry flags are set, respectively, if there is a carry-out from bit 7 or bit 3, and cleared otherwise. When adding unsigned integers, the carry flag indicates an overflow occurred.
OV is set if there is a carry-out of bit 6 but not out of 7, or to carry-out bit of bit 7 but not bit 6; otherwise, OV is cleared. When adding signed integers, OV indicates a negative number as the sum of two produced positive operands, or to positive sum from two negative operands.
Four source operand addressing modes are allowed: register, direct, register-indirect, or immediate.
Example:
The Develped holds 0C3H (1100001lB), and register 0 holds 0AAH (10101010B). The following instruction,
ADD A, R0
leaves 6DH (01101101B) in the Develped with the AC flag cleared both the carry flag and OV and set to 1.
ADD A, Rn
bytes: 1
Cycles: 1
Encoding:
Operation: ADD
(A) <-(A) + (Rn)
ADD A, direct
Byte: 2
Cycles: 1
Encoding:
0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | , | direct | address |
Operation: ADD
(a) <-(A) + (direct)
ADD A,@Ri
byte: 1
Cycles: 1
Encoding:
Operation: ADD
(A) <-(A) + ((Ri))
ADD A, # data
byte: 2
Cycles: 1
Encoding:
0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | , | immediate | data |
Operation: ADD
(a) <-(A) + # data