Opcodes 80537
Opcodes 80537
The SAB 80C517 instruction set includes 111 instructions, 49 of which are single-byte, 45 two-byte and 17 three-byte instructions. The instruction opcode format consists of a
function mnemonic followed by a ”destination, source” operand field. This field specifies the data type and addressing method(s) to be used.
Like all other members of the 8051-family, the SAB 80C517 can be programmed with the same instruction set common to the basic member, the SAB 8051. Thus, the SAB
80C517 is 100% software compatible to the SAB 8051 and may be programmed with 8051 assembler or high-level languages.
9.1 Addressing Modes
The SAB 80C517 uses five addressing modes:
– register
– direct
– immediate
– register indirect
– base register plus index-register indirect
Table 9-1 summarizes the memory spaces which may be accessed by each of the addressing modes.
Register Addressing
Register addressing accesses the eight working registers (R0 - R7) of the selected register bank. The least significant bit of the instruction opcode indicates which register is to be
used. ACC, B, DPTR and CY, the Boolean processor accumulator, can also be addressed as registers.
Direct Addressing
Direct addressing is the only method of accessing the special function registers. The lower 128 bytes of internal RAM are also directly addressable.
Immediate Addressing
Immediate addressing allows constants to be part of the instruction in program memory.
Table 9-1
Addressing Modes and Associated Memory Spaces
Register addressing R0 through R7 of selected register bank, ACC, B, CY (Bit), DPTR
Direct addressing Lower 128 bytes of internal RAM, special function registers
Immediate addressing Program memory
Register indirect addressing Internal RAM (@R1, @R0, SP), external data memory (@R1, @R0, @DPTR)
Base register plus index register addressing Program memory (@DPTR + A, @PC + A)
XRL A,Rn
Operation: XRL2
(A) ← (A) (Rn)
Bytes: 1
Cycles: 1
Encoding: 01101rrr
XRL A,direct
Operation: XRL
(A) ← (A) (direct)
Bytes: 2
Cycles: 1
Encoding: 0 1 1 0 0 1 0 1 direct address
XRL A, @ Ri
Operation: XRL
(A) ← (A) ((Ri))
Bytes: 1
Cycles: 1
Encoding: 0110011I
XRL A, #data
Operation: XRL
(A) ← (A) #data
Bytes: 2
Cycles: 1
Encoding: 0 1 1 0 0 1 0 0 immediate data
XRL direct,A
Operation: XRL
(direct) ← (direct) (A)
Bytes: 2
Cycles: 1
Encoding: 0 1 1 0 0 0 1 0 direct address
v
v
v
v
Logic Operations
Mnemonic Description Byte Cycle
ANL A,Rn AND register to accumulator 1 1
ANL A,direct AND direct byte to accumulator 2 1
ANL A,@Ri AND indirect RAM to accumulator 1 1
ANL A,#data AND immediate data to accumulator 2 1
ANL direct,A AND accumulator to direct byte 2 1
ANL direct,#data AND immediate data to direct byte 3 2
ORL A,Rn OR register to accumulator 1 1
ORL A,direct OR direct byte to accumulator 2 1
ORL A,@Ri OR indirect RAM to accumulator 1 1
ORL A,#data OR immediate data to accumulator 2 1
ORL direct,A OR accumulator to direct byte 2 1
ORL direct,#data OR immediate data to direct byte 3 2
XRL A,Rn Exclusive OR register to accumulator 1 1
XRL A direct Exclusive OR direct byte to accumulator 2 1
XRL A,@Ri Exclusive OR indirect RAM to accumulator 1 1
XRL A,#data Exclusive OR immediate data to accumulator 2 1
XRL direct,A Exclusive OR accumulator to direct byte 2 1
XRL direct,#data Exclusive OR immediate data to direct byte 3 2
CLR A Clear accumulator 1 1
CPL A Complement accumulator 1 1
RL A Rotate accumulator left 1 1
RLC A Rotate accumulator left through carry 1 1
RR A Rotate accumulator right 1 1
RRC A Rotate accumulator right through carry 1 1
SWAP A Swap nibbles within the accumulator 1 1
Data Transfer
1) MOV A,ACC is not a valid instruction
Mnemonic Description Byte Cycle
MOV A,Rn Move register to accumulator 1 1
MOV A,direct 1) Move direct byte to accumulator 2 1
MOV A,@Ri Move indirect RAM to accumulator 1 1
MOV A,#data Move immediate data to accumulator 2 1
MOV Rn,A Move accumulator to register 1 1
MOV Rn,direct Move direct byte to register 2 2
MOV Rn,#data Move immediate data to register 2 1
MOV direct,A Move accumulator to direct byte 2 1
MOV direct,Rn Move register to direct byte 2 2
MOV direct,direct Move direct byte to direct byte 3 2
MOV direct,@Ri Move indirect RAM to direct byte 2 2
MOV direct,#data Move immediate data to direct byte 3 2
MOV @Ri,A Move accumulator to indirect RAM 1 1
MOV @Ri,direct Move direct byte to indirect RAM 2 2
MOV @Ri, #data Move immediate data to indirect RAM 2 1
MOV DPTR, #data16 Load data pointer with a 16-bit constant 3 2
MOVC A,@A + DPTR Move code byte relative to DPTR to accumulator 1 2
MOVC A,@A + PC Move code byte relative to PC to accumulator 1 2
MOVX A,@Ri Move external RAM (8-bit addr.) to A 1 2
MOVX A,@DPTR Move external RAM (16-bit addr.) to A 1 2
MOVX @Ri,A Move A to external RAM (8-bit addr.) 1 2
MOVX @DPTR,A Move A to external RAM (16-bit addr.) 1 2
PUSH direct Push direct byte onto stack 2 2
POP direct Pop direct byte from stack 2 2
XCH A,Rn Exchange register with accumulator 1 1
XCH A,direct Exchange direct byte with accumulator 2 1
XCH A,@Ri Exchange indirect RAM with accumulator 1 1
XCHD A,@Ri Exchange low-order nibble indir. RAM with A 1 1