4. Central processing unit ABOV
A96G140/A96G148/A96A148 User’s manual
32
4.3
Instruction set
An instruction is a single operation of a processor that is defined by the instruction set. The M8051EW
uses the instruction set of 8051 that is broadly classified into five functional categories:
1.
Arithmetic instructions
2.
Logical instructions
3.
Data transfer instructions
4.
Boolean instructions
5.
Branching instructions
Major features of the instruction set are listed below. If you need detailed information about the
instruction table, please refer to Appendix or Instruction table:
Instructions are ei
ther 1, 2 or 3 bytes long as listed in the ‘Bytes’
.
Each instruction takes either 1, 2 or 4 machine cycles to execute. 1 machine cycle comprises
2 CCLK clock cycles.
An M8051EW-specific instruction
“
MOVC @(DPTR++), A
”
is provided to enable software to
be downloaded into Program Memory where this is implemented as RAM. This instruction can
also be used subsequently to modify contents of the Program Memory RAM.
Arithmetic Instruction: The M8051EW implements ADD, ADDC (Add with Carry), SUBB
(Subtract with Borrow), INC (Increment) and DEC (Decrement) functions, which can be used
in most addressing modes. There are three accumulator-specific instructions, DA A (Decimal
Adjust A), MUL AB (Multiply A by B) and DIV AB (Divide A by B).
Logical Instruction: The M8051EW implements ANL (AND Logical), ORL (OR Logical), and
XRL (Exclusive-OR Logical) functions, which can be used in most addressing modes. There
are seven accumulator-specific instructions, CLR A (Clear A), CPL A (Complement A), RL A
(Rotate Left A), RLC A (Rotate Left through Carry A), RR A (Rotate Right A), RRC A (Rotate
Right through Carry A), and SWAP A (Swap Nibbles of A).
Internal data memory: Data can be moved from the accumulator to any Internal Data Memory
location, from any Internal Data Memory location to the accumulator, and from any Internal
Data Memory location to any SFR or other Internal Data Memory location.