Datasheet

Data Sheet ADE5166/ADE5169/ADE5566/ADE5569
Rev. D | Page 87 of 156
Code Indirect Addressing
The internal code memory can be accessed indirectly. This can be
useful for implementing lookup tables and other arrays of constants
that are stored in flash memory. For example, to move the data
stored in flash memory at Address 0x8002 into the accumulator,
MOV DPTR,#8002h
CLR A
MOVX A,@A+DPTR
The accumulator can be used as a variable index into the array
of flash memory located at DPTR.
INSTRUCTION SET
Table 68 documents the number of clock cycles required for each instruction. Most instructions are executed in one or two clock cycles,
resulting in a 4-MIPS peak performance. Note that, throughout this section, A represents the accumulator.
Table 68. Instruction Set
Mnemonic Description Bytes Cycles
Arithmetic
ADD A, Rn Add register to A 1 1
ADD A, @Ri Add indirect memory to A 1 2
ADD A, dir Add direct byte to A 2 2
ADD A, #data Add immediate to A 2 2
ADDC A, Rn 1 1 Add register to A with carry 1 1
ADDC A, @Ri
Add indirect memory to A with carry
1
2
ADDC A, dir Add direct byte to A with carry 2 2
ADDC A, #data Add immediate to A with carry 2 2
SUBB A, Rn Subtract register from A with borrow 1 1
SUBB A, @Ri Subtract indirect memory from A with borrow 1 2
SUBB A, dir Subtract direct from A with borrow 2 2
SUBB A, #data Subtract immediate from A with borrow 2 2
INC A Increment A 1 1
INC Rn Increment register 1 1
INC @Ri Ri increment indirect memory 1 2
INC dir Increment direct byte 2 2
INC DPTR Increment data pointer 1 3
DEC A Decrement A 1 1
DEC Rn Decrement register 1 1
DEC @Ri Decrement indirect memory 1 2
DEC dir Decrement direct byte 2 2
MUL AB Multiply A by B 1 9
DIV AB
Divide A by B
1
9
DA A Decimal Adjust A 1 2
Logic
ANL A, Rn AND register to A 1 1
ANL A, @Ri AND indirect memory to A 1 2
ANL A, dir AND direct byte to A 2 2
ANL A, #data AND immediate to A 2 2
ANL dir, A AND A to direct byte 2 2
ANL dir, #data AND immediate data to direct byte 3 3
ORL A, Rn OR register to A 1 1
ORL A, @Ri OR indirect memory to A 1 2
ORL A, dir OR direct byte to A 2 2
ORL A, #data OR immediate to A 2 2
ORL dir, A OR A to direct byte 2 2
ORL dir, #data
OR immediate data to direct byte
3
3
XRL A, Rn Exclusive-OR register to A 1 1
XRL A, @Ri Exclusive-OR indirect memory to A 2 2
XRL A, #data Exclusive-OR immediate to A 2 2
XRL dir, A Exclusive-OR A to direct byte 2 2