Keil™, An ARM® Company

8051 Instruction Set Manual

Instructions

The following pages describe the 8051 instruction set. Instructions are listed in alphabetical order and each is divided into several sections:

DescriptionDescribes the instruction's effect and describes any arguments.
See AlsoNames related instructions.
BytesLists the number of bytes required to encode the instruction.
CyclesLists the number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051.
EncodingLists the byte encoding for the instruction.
OperationLists, step-by-step, the operations performed by the instruction.
ExampleShows proper use of the instruction.

Many instructions have required arguments that are described in the following table:

ArgumentDescription
addr11An 11-bit address destination. This argument is used by ACALL and AJMP instructions. The target of the CALL or JMP must lie within the same 2K page as the first byte of the following instruction.
addr16A 16-bit address destination. This argument is used by LCALL and LJMP instructions.
bitA direct addressed bit in internal data RAM or SFR memory.
directAn internal data RAM location (0-127) or SFR (128-255).
immediateA constant included in the instruction encoding.
offsetA signed (two's complement) 8-bit offset (-128 to 127) relative to the first byte of the following instruction.
@RiAn internal data RAM location (0-255) addressed indirectly through R0 or R1.
RnRegister R0-R7.

Related Knowledgebase Articles