Microprocessor Addressing Modes, Flag Register, and Bus Types

Microprocessor Addressing Modes

Addressing modes determine how the microprocessor accesses data during instruction execution. Here are the common addressing modes:

Immediate Addressing

In immediate addressing mode, the data is specified directly within the instruction itself. This data becomes part of the program instruction. Instructions with ‘I’ in their mnemonics typically use immediate addressing. For example:

MVI B, 3EH – Move the data 3EH (given in the instruction) to the B register.

Register Addressing

In register addressing mode, the instruction specifies the name of the register where the data is stored. This type of addressing is identified by register names (like ‘A’, ‘B’, etc.) in the instruction. For example:

MOV A, B – Move the content of the B register to the A register.

Direct Addressing

In direct addressing mode, the data resides in memory. The instruction directly specifies the memory address where the data is located. For example:

LDA 1050H – Load the data available in memory location 1050H into the accumulator.

Indirect Addressing

In indirect addressing mode, the data is also in memory, but the instruction indirectly specifies the address. The address is stored in registers. This type of addressing is often identified by the letter ‘M’ in the instruction. For example:

MOV A, M – The memory data addressed by the HL register pair is moved to the A register.

Implied Addressing

In implied addressing mode, there is no operand. This type of instruction does not have any address, register name, or immediate data specified. For example:

CMA – Complement the content of the accumulator.

Flag Register

The flag register is a special-purpose register in a microprocessor. It differs from other registers and consists of 8 bits, but only 5 of them are typically used. The remaining three bits are reserved for future Intel versions.

Sign Flag (SF)

The sign flag indicates whether the result of an operation is positive or negative. The sign flag is set to 1 if the result is negative and 0 if the result is positive.

Zero Flag (ZF)

The zero flag indicates whether the result of an operation is zero or non-zero. The zero flag is set to 1 if the result is zero and 0 if the result is non-zero.

Auxiliary Carry Flag (AC)

The auxiliary carry flag is set to 1 whenever there is a carry or borrow at the nibble level (4 bits) in the data.

Parity Flag (PF)

The parity flag is set to 1 when the result has even parity (an even number of 1 bits). The parity flag is reset to 0 when the result has odd parity (an odd number of 1 bits).

Carry Flag (CF)

The carry flag is set to 1 whenever there is a carry from the most significant bit (MSB) or a borrow to the MSB.

Bus Types

A bus is a communication system that transfers data between components inside a computer or between computers.

Dedicated Bus

A dedicated bus is assigned to a single function (e.g., address bus) or a physical subset of components (e.g., I/O bus connects all I/O modules).

Common Bus

A common bus can be used for both addresses and data. In this case, an address valid control line is needed to determine whether the data being transmitted is an address or data. Time multiplexing can also be used to share the same lines for multiple purposes.

Parallel Bus

A parallel bus transmits multiple bits of data simultaneously using multiple wires or channels. Each bit of the data word is transmitted on a separate wire, enabling faster data transfer compared to a serial bus.

Advantages of Parallel Bus:

  • Faster Data Transfer
  • Simplicity of Implementation

Serial Bus

A serial bus transmits data sequentially, one bit at a time, over a single wire or channel. The data bits are sent in a continuous stream, with additional control and address information included within the data stream.

Advantages of Serial Bus:

  • Simplified Wiring
  • Longer Distance Transmission

Important Registers

Accumulator (AC)

The accumulator is the most frequently used register. It is used to store data retrieved from memory.

Address Register (AR)

The address register holds the address for memory locations.

Program Counter (PC)

The program counter keeps track of the memory address of the next instruction to be fetched during program execution.

Serial vs. Parallel

Serial links can be clocked considerably faster than parallel links to achieve higher data rates.