Addressing Modes, Hardwired vs Microprogrammed Control Unit & DMA I/O
Effective address computation for PC-relative and indexed modes, horizontal vs vertical microinstructions control store size, and DMA cycle-stealing CPU slowdown.
1. Machine Addressing Modes & Relocation
| Addressing Mode | Effective Address (EA) | Primary Compiler / OS Use Case |
|---|---|---|
| Immediate | Operand inside instruction | Constants (MOV R1, #42) |
| Register Indirect | Pointers in C (*ptr) | |
| Base + Displacement / Indexed | Array indexing A[i] & struct fields | |
| PC-Relative | Position-Independent Code (PIC) & short branches | |
| Auto-Increment / Decrement | Stack PUSH / POP & loop traversal |
Classic GATE PC-Relative Trap: If a 4-byte branch instruction sits at byte address with signed offset , when the ALU computes the target, already equals . Thus Target (NOT !).
2. Hardwired vs Microprogrammed Control Unit
- Hardwired Control: Combinational logic gates driven by state counter + IR opcode; fastest clock rate, used in RISC processors.
- Microprogrammed Control: Stores microinstructions in Control ROM.
- Horizontal Microprogramming: 1 bit per control signal ( signals = bits); maximum parallelism, zero decoder delay.
- Vertical Microprogramming: Mutually exclusive micro-operations grouped into fields of bits (+1 for
NO-OP!).
3. Interrupts vs Direct Memory Access (DMA)
In Cycle Stealing DMA, if a device generates data at bytes/sec, transfers bytes per bus cycle, and each DMA bus steal stalls the CPU for seconds:
🎯 Practice PYQs on This Topic (2)
A 4-byte PC-relative branch instruction is stored in memory starting at byte address . If the signed displacement field inside the instruction equals , what is the branch target byte address?
Which machine addressing mode is best suited for writing relocatable / position-independent code at runtime?