Microprocessor Architecture
Microprocessor Architecture
Internal Architecture
Bus Interface Unit (BIU): Manages data and address buses, instruction
queue, and segment registers (CS, DS, SS, ES).
Execution Unit (EU): Executes instructions, contains general-purpose
registers (AX, BX, CX, DX), special-purpose registers, the ALU, and control
logic.
Memory Segmentation
Data Types
Supports bytes (8-bit), words (16-bit), double words (32-bit), and strings
(sequences of bytes).
Flags Register
The Stack
A LIFO structure used for function calls, local variable storage, and temporary
data. Managed by the Stack Segment (SS) and Stack Pointer (SP).
Operating Modes
Real Mode: Used by 8086/8088; allows access to the first 1 MB of memory
and handles one task at a time.
Protected Mode: Available in advanced microprocessors for multitasking and
enhanced memory management.
The 8088 features a narrower (8-bit) data bus compared to the 8086's 16-bit
data bus, reducing cost but affecting performance.
1)What is the maximum memory that can be addressed by the 8086 microprocessor?
a. 64 KB
b. 1 MB
c. 2 MB
d. 128 KB
Answer: b
2)Which unit in the 8086 microprocessor is responsible for fetching instructions and
managing memory addresses?
a. Arithmetic and Logic Unit (ALU)
b. Execution Unit (EU)
c. Bus Interface Unit (BIU)
d. Control Unit
Answer: c
Answer: c
4)What is the main difference between the 8086 and 8088 microprocessors?
a. Clock speed
b. Data bus width
c. Address bus width
d. Instruction set
Answer: b
5)What is the function of the Instruction Pointer (IP) in the 8086 microprocessor?
a. Holds data for arithmetic operations
b. Indicates the top of the stack
c. Points to the next instruction to execute
d. Manages data flow between devices
Answer: c
6)In the 8086 architecture, the code segment (CS) is primarily used for:
a. Temporary data storage
b. Storing variables
c. Holding executable instructions
d. Managing stack operations
Answer: c
Answer: b
Answer: b
9)Which register in the 8086 microprocessor is used as the base pointer for stack
operations?
a. SP
b. BP
c. DI
d. SI
Answer: b
Answer: b
Answer: a
Answer: b
Answer: a
14)What operating mode is exclusively used by the 8086 and 8088 microprocessors?
a. Real mode
b. Protected mode
c. Enhanced mode
d. Multitasking mode
Answer: a
Answer: b
Explain the primary difference between the 8086 and 8088 microprocessors.
The 8086 has a 16-bit data bus, allowing it to transfer 2 bytes of data at a time, while
the 8088 has an 8-bit data bus, transferring 1 byte at a time.
What is the role of the Bus Interface Unit (BIU) in the 8086 microprocessor?
The BIU manages communication with memory and I/O devices, handles the address
and data buses, and prefetches instructions to improve execution speed.
What is the function of the Flags Register, and name two key flags it contains.
The Flags Register indicates the state of the processor and results of operations. Key
flags include the Zero Flag (ZF) and Carry Flag (CF).
Explain the importance of the stack in the 8086/8088 microprocessor and how it
operates.
The stack is used for managing function calls, local variables, and temporary data. It
operates on a LIFO principle, where the Stack Pointer (SP) tracks the top of the stack.
List and describe the function of any two general-purpose registers in the 8086
microprocessor.
How does the Instruction Pointer (IP) contribute to the execution of instructions
in the 8086/8088?
The IP holds the address of the next instruction to execute, enabling the processor to
fetch and execute instructions sequentially.
Compare the real mode operation of the 8086 with the protected mode available
in later microprocessors.
1. The stack operates in a last-in, first-out (LIFO) manner and is used for
function calls, local variables, and temporary storage.
2. Stack Pointer (SP): Points to the top of the stack and updates
automatically during PUSH and POP operations.
3. Implicit Addressing: Operates directly on the stack pointer without
specifying operands. For example, POP AX.
4. Explicit Addressing: Allows access to data relative to the stack
pointer or base pointer. For example, MOV AX, [BP - 4].
Highlights of Instructions
Answer: a
2)In the instruction MOV AX, [1234H], the addressing mode used is:
a. Register addressing
b. Immediate addressing
c. Direct addressing
d. Register indirect addressing
Answer: c
Answer: b
Answer: c
Answer: a
Answer: b
Answer: b
9)What is the role of the stack pointer (SP) in stack memory addressing?
a. Holds the address of the top of the stack
b. Manages function calls
c. Stores operands temporarily
d. Points to the base of the stack
Answer: a
Answer: b
11)In program memory addressing, a CALL instruction is used for:
a. Looping
b. Conditional branching
c. Subroutine invocation
d. Data transfer
Answer: c
12)Which addressing mode specifies the exact address of the next instruction?
a. Relative program memory addressing
b. Indirect program memory addressing
c. Direct program memory addressing
d. Scaled-index addressing
Answer: c
13)What does relative program memory addressing use to determine the next
instruction?
a. Register contents
b. Instruction pointer + offset
c. A hardcoded memory address
d. Displacement + base register
Answer: b
Answer: c
Answer: c
7)Why is the stack pointer (SP) essential for stack memory addressing?
The stack pointer (SP) holds the address of the top of the stack and automatically
updates during PUSH and POP operations, ensuring proper stack operation.
9)Describe the difference between the PUSH and POP operations in stack
memory.
1. PUSH: Adds data to the stack by decrementing the stack pointer and
storing the value at the new address.
2. POP: Removes data from the stack by retrieving the value at the
current stack pointer and incrementing it.
Arithmetic Instructions:
Subtraction (SUB):
Multiplication (MUL):
Division (DIV):
Logic Instructions:
Special Instructions:
1. Arithmetic and logical operations modify flags like Zero Flag (ZF),
Carry Flag (CF), Sign Flag (SF), Overflow Flag (OF), and Parity Flag
(PF).
Key Takeaways:
Answer: b
2)Which instruction adds the carry flag (CF) to the result of an addition?
a. ADD
b. ADC
c. INC
d. XADD
Answer: c
Answer: b
Answer: c
6)In the instruction MUL BL, what does the AL register hold after execution?
a. The product of the multiplication
b. The divisor
c. The remainder
d. The quotient
Answer: a
Answer: b
Answer: b
Answer: b
Answer: c
Answer: a
Answer: b
13)In the instruction CMP AL, 10H; JAE NEXT, the jump occurs if:
a. AL is less than 10H
b. AL is greater than or equal to 10H
c. AL is exactly 10H
d. AL is not equal to 10H
Answer: b
14)What is the result of the instruction AND AX, BX if AX = 32H and BX = 11H?
a. 33H
b. 10H
c. 11H
d. 32H
Answer: b
15)Which instruction both adds two operands and stores the original destination value
in the source?
a. ADD
b. XADD
c. ADC
d. INC
Answer: b
3)Describe the role of the stack pointer (SP) during the execution of PUSH and
POP instructions.
1. PUSH: Decrements the SP and stores the data at the new stack
location.
2. POP: Retrieves data from the stack location pointed to by SP and
increments the SP.
4)Provide an example of the CMP instruction and explain how it affects flags.
Example: CMP AX, BX compares AX and BX by subtracting BX from AX without
storing the result.
1. Flags affected: Zero Flag (ZF), Carry Flag (CF), Sign Flag (SF), and
Overflow Flag (OF).
8)How does the NEG instruction calculate the 2’s complement of a value?
1. NEG computes the 2’s complement by first inverting the bits (1’s
complement) and then adding 1 to the result.
9)Explain the difference between NOT and NEG instructions with examples.
10)Describe how the DIV instruction handles division and stores the quotient
and remainder.
Workout Questions
ADD AX, BX
ADC AX, BX
AX = 1234H,
BX = 5678H,
Carry Flag (CF) = 1.
ADD AX, BX
AX = 1234H + 5678H = 68ACh
Since there’s no overflow beyond 16-bit limits, the Carry Flag (CF) will be 0.
Zero Flag (ZF) = 0 (since result is not 0).
Sign Flag (SF) = 1 (because the most significant bit of 68AC is 1, indicating a
negative number in two's complement).
ADC AX, BX
2) Stack Operations
Given the initial stack contents:
Address Data
1004H 12H
1002H 34H
1000H 56H
2. Stack Operations
Addre Dat
ss a
1004H 12H
1002H 34H
1000H 56H
SP = 0FFEH.
Perform POP BX
The value at the top of the stack (78H) is popped into BX.
The Stack Pointer (SP) is incremented by 2.
Final stack:
Addre Dat
ss a
1004H 12H
1002H 34H
1000H 56H
SP = 1000H
BX = 78H.
3) Logical Operations
Let AX = 3F4CH and BX = 12A3H. Perform the following instructions and
determine the final value in AX:
AND AX, BX
OR AX, BX
XOR AX, BX
NOT AX
Given:
AX = 3F4CH
BX = 12A3H
Instruction 2: OR AX, BX
Instruction 4: NOT AX
AX = FFFFH
4)Multiplication
Perform an 8-bit multiplication operation where AL = 5H and BL = 6H.
MUL BL ; AL * BL -> AX
AX = 5H * 6H = 30H.