27-07-2012, 11:02 AM
8051 Instruction Set
8051_Instruction_Set.pdf (Size: 379.68 KB / Downloads: 69)
Introduction
1 A computer instruction is made up of an operation code
(op-code) followed by either zero, one or two bytes of
operands
2 The op-code identifies the type of operation to be performed
while the operands identify the source and destination of the
data
3 The operand can be:
. The data value itself
. A CPU register
. A memory location
. An I/O port
4 If the instruction is associated with more than one operand,
the format is always:
Instruction
Immediate Constant Addressing
This mode of addressing uses either an 8- or 16-bit
constant value as the source operand
1 This constant is specified in the instruction, rather than in
a register or a memory location
2 The destination register should hold the same data size
which is specified by the source operand
Relative Addressing
1 This mode of addressing is used with some type of jump
instructions, like SJMP (short jump) and conditional jumps
like JNZ
2 These instructions transfer control from one part of a
program to another
3 The destination address must be within -128 and +127 bytes
from the current instruction address because an 8-bit offset
is used (28 = 256)
Absolute Addressing
1 Two instructions associated with this mode of addressing
are ACALL and AJMP instructions
2 These are 2-byte instructions where the 11-bit absolute
address is specified as the operand
3 The upper 5 bits of the 16-bit PC address are not modified.
The lower 11 bits are loaded from this instruction. So, the
branch address must be within the current 2K byte page of
program memory (211 = 2048)