Introduction
The MCS-51 is Intel’s 8-bit microcontroller family (the 8051, 1980). It has an 8-bit accumulator A, a second register B used by multiply and divide,
four banks of eight registers R0 to R7 in the internal RAM, a 16-bit data pointer DPTR, a stack in the internal RAM and a separate bit-addressable space. Program memory
(code), internal data memory, special function registers and external data memory are separate address spaces, reached by different instructions. The Cypress EZ-USB FX2 (CY7C68013A) USB chip
has what its data sheet calls an “industry-standard, enhanced 8051” (four clocks per instruction cycle, two data pointers, two USARTs, three timers) and runs this instruction set; firmware for it is what a UF2 file for the FX2 family carries.
Instructions are 1, 2 or 3 bytes. Of the 256 opcodes 255 are instructions; A5 is reserved. The pages: registers, memory spaces and flags,
every instruction and the opcode map.
Statuses in the disassembly
| Status | Meaning |
|---|---|
| Documented | An instruction of the MCS-51 instruction set (255 opcodes). |
| Illegal | Opcode A5, which the manual reserves, and an instruction cut short by the end of the data. |
Notation
Upper-case mnemonics, hexadecimal as 0x1F, registers R0 to R7, indirect forms @R0 and @R1, immediate values with #
(MOV A,#0x05, MOV DPTR,#0x1234), the carry as C, the complement of a bit as /bit. A branch shows the address it goes to.
The standard special function registers are shown by name (MOV P1,A) and the bits of the bit-addressable ones as ACC.7; a bit in the internal RAM as 0x21.3 (bit 3 of byte 0x21). The
Register names option shows numbers instead, and Mnemonic case writes lower case. In MOV dir,dir the opcode holds the source byte first; the text names the destination first, as assemblers do.
Not described
Known, not yet covered
- Reference: instruction timing (the cycle count of each instruction is not listed), the special function registers specific to the Cypress FX2 (its second data pointer among them) and its on-chip XDATA register space, and the 8051 derivatives with extra instructions or a larger address space.
- Viewer: the tracked values (DPTR, the register bank selected by PSW) are not followed, so a MOVX or MOVC address is not named.
Links
Reference
- MCS-51 Programmer’s Guide and Instruction Set – Intel (via Keil): every instruction, with operation and encoding
- 8051 processor definition – Ghidra: the instruction patterns, used as a second source for the opcode table