Skip to main content

Programming model of 8085

Short answer

The programmer's model includes the accumulator, flag register, six general-purpose registers (B,C,D,E,H,L) usable as BC, DE, HL pairs, PC, and SP. The accumulator is the primary operand register, HL serves as a memory pointer, and PC/SP manage instruction sequencing and stack.

Explain briefly the programmer's model (programming model) of 8085 microprocessor and explain each unit.

The programmer's (programming) model shows the registers of the 8085 that a programmer can use or must know about, ignoring internal hardware like the ALU and decoder.

 8-bit registers                  16-bit registers
 +-----------+-----------+        +---------------------+
 | A (Acc)   |  Flags    |        |  Stack Pointer (SP) |
 +-----------+-----------+        +---------------------+
 |    B      |    C      |        |  Program Counter(PC)|
 +-----------+-----------+        +---------------------+
 |    D      |    E      |
 +-----------+-----------+        Flags: S Z - AC - P - CY
 |    H      |    L      |
 +-----------+-----------+

Units

  1. Accumulator (A): an 8-bit register that holds one operand and receives the result of arithmetic and logic operations. All I/O data transfers (IN, OUT) go through A.
  2. General purpose registers (B, C, D, E, H, L): six 8-bit registers used for temporary data storage. They can be used as pairs BC, DE, HL for 16-bit data; HL also acts as a memory pointer, and the memory location addressed by HL is called pseudo-register M.
  3. Flag register: holds the five flags S, Z, AC, P, CY (the remaining 3 bits are unused), showing the result status.
  4. Program Counter (PC): 16-bit register that stores the memory address of the next instruction to be fetched. It is incremented automatically after each fetch, and changed by jump, call and return.
  5. Stack Pointer (SP): 16-bit register that points to the top of the stack (a LIFO area in RAM). Used by PUSH, POP, CALL, RET. It is decremented on push and incremented on pop.
  6. Temporary registers W and Z (not accessible to programmer) are used internally for instructions like CALL and XCHG.

The 16-bit PC and SP give a 64 KB memory space (0000H to FFFFH).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Microprocessor chapter 2 questions →