0% found this document useful (0 votes)
12 views27 pages

Microp

Chapter 2 discusses the architecture of the microprocessor, detailing its main components such as the ALU, Control Unit, and Registers. It explains memory modes, addressing techniques, and the functions of various registers in the 8086 microprocessor. Additionally, it covers concepts like pipelining, segmentation, and the differences between microprocessors and microcontrollers.

Uploaded by

gamegirlbms16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views27 pages

Microp

Chapter 2 discusses the architecture of the microprocessor, detailing its main components such as the ALU, Control Unit, and Registers. It explains memory modes, addressing techniques, and the functions of various registers in the 8086 microprocessor. Additionally, it covers concepts like pipelining, segmentation, and the differences between microprocessors and microcontrollers.

Uploaded by

gamegirlbms16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Chapter 2: The Microprocessor and Its Architecture

1.​ What are the main components of a microprocessor?


○​ The main components are the ALU (Arithmetic Logic Unit),
Control Unit, and Registers.
2.​ What is the function of the ALU?
○​ The ALU performs arithmetic and logical operations on data.
3.​ What are general-purpose registers in the 8086 microprocessor?
○​ AX, BX, CX, and DX, are used for various arithmetic and data
manipulation tasks.
4.​ What is the difference between real mode and protected mode?
○​ Real mode allows access to 1MB of memory, while protected mode
allows access to more memory with segmentation.
5.​ What are segment registers?
○​ CS, DS, SS, ES, FS, and GS define different segments in memory.
6.​ What is an offset address?
○​ It is the address relative to a segment, used to calculate the
physical address.
7.​ How is the physical address calculated in real mode?
○​ Physical Address = (Segment Register × 16) + Offset
8.​ What is memory paging?
○​ A technique that divides memory into pages to optimize memory
usage.
9.​ What are program-invisible registers?
○​ These are internal registers used for memory management (e.g.,
GDTR, IDTR).
10.​ What is the function of the stack segment (SS)?
○​ It points to the stack area, where temporary data and return
addresses are stored.

Here are the remaining 40 viva questions and answers from Chapter 2: The
Microprocessor and Its Architecture of the Intel Microprocessor book.

Chapter 2: The Microprocessor and Its Architecture (Continued)


11.​ What is the purpose of the instruction pointer (IP) in the 8086?​

○​ The IP holds the address of the next instruction to be executed.


12.​ What is the difference between the microprocessor and the
microcontroller?​

○​ A microprocessor is used for general-purpose computing, while a


microcontroller is designed for embedded applications with
built-in memory and I/O.
13.​ What is the role of the control unit in a microprocessor?​

○​ It decodes instructions and controls the execution of operations.


14.​ What is the function of the bus interface unit (BIU)?​

○​ It manages data transfer between the microprocessor and


memory or I/O devices.
15.​ What are the different types of buses in a microprocessor?​

○​ Address bus, Data bus, and Control bus.


16.​ What is the width of the address bus in the 8086 microprocessor?​

○​ It is 20-bit wide, allowing it to address 1MB of memory.


17.​ What is the purpose of the segment registers in the 8086?​

○​ They divide memory into logical segments for efficient addressing.


18.​ What are the different segment registers in the 8086?​

○​ Code Segment (CS), Data Segment (DS), Stack Segment (SS), Extra
Segment (ES).
19.​ What is the significance of the CS register?​

○​ It points to the memory segment where program instructions are


stored.
20.​ What is the function of the DS register?​

○​ It points to the segment where data variables are stored.


21.​ What is the purpose of the SS register?​

○​ It holds the base address of the stack segment.


22.​ What is the role of the ES register?​

○​ It is used for additional data storage and is often used in string


operations.
23.​ What is meant by pipelining in microprocessors?​

○​ It allows overlapping execution of multiple instructions for better


performance.
24.​ How does pipelining improve performance in the 8086?​

○​ It fetches the next instruction while executing the current one,


reducing wait time.
25.​ What is the function of the Execution Unit (EU)?​

○​ It processes instructions fetched by the BIU.


26.​ What is the difference between RISC and CISC architectures?​

○​ RISC (Reduced Instruction Set Computing) has simpler


instructions, while CISC (Complex Instruction Set Computing) has
more complex instructions.
27.​ Which architecture does the Intel 8086 use: RISC or CISC?​

○​ It follows the CISC architecture.


28.​ What is the difference between stack memory and heap memory?​

○​ Stack memory stores local variables and function calls, while heap
memory is used for dynamic memory allocation.
29.​ What is the purpose of the FLAGS register in the 8086?​

○​ It holds the status of operations, including condition flags and


control flags.
30.​ What are the different types of flags in the FLAGS register?​

○​ Status Flags (e.g., Zero Flag, Carry Flag), Control Flags (e.g.,
Interrupt Flag), and System Flags.
31.​ What is the Zero Flag (ZF)?​

○​ It is set when the result of an operation is zero.


32.​ What is the Carry Flag (CF)?​

○​ It is set when an arithmetic operation results in a carry or borrow.


33.​ What is the Sign Flag (SF)?​
○​ It indicates whether the result of an operation is positive or
negative.
34.​ What is the Overflow Flag (OF)?​

○​ It is set when the result of a signed arithmetic operation exceeds


the allowable range.
35.​ What is the purpose of the Parity Flag (PF)?​

○​ It indicates whether the number of 1s in the result is even or odd.


36.​ What is the function of the Trap Flag (TF)?​

○​ It enables single-step debugging of programs.


37.​ What is the Interrupt Flag (IF)?​

○​ It enables or disables interrupts in the processor.


38.​ What is the Direction Flag (DF)?​

○​ It controls the direction of string operations (incrementing or


decrementing memory addresses).
39.​ How many registers does the 8086 have?​

○​ It has 14 registers: AX, BX, CX, DX, SP, BP, SI, DI, CS, DS, SS, ES, IP,
and FLAGS.
40.​ What is the purpose of the Base Pointer (BP)?​

○​ It is used to access stack data in subroutine calls.


41.​ What is the difference between the Stack Pointer (SP) and the Base
Pointer (BP)?​

○​ SP always points to the top of the stack, while BP can point


anywhere within the stack.
42.​ What is the purpose of the Source Index (SI) and Destination Index
(DI) registers?​

○​ They are used in string operations and memory addressing.


43.​ What is the function of the instruction queue in the 8086?​

○​ It prefetches instructions to improve execution speed.


44.​ How many bytes can the instruction queue hold in the 8086?​
○​ It can hold up to 6 bytes.
45.​ What is segmentation in memory addressing?​

○​ It divides memory into segments to allow efficient management


and protection.
46.​ Why does the 8086 use segmented memory addressing instead of
linear addressing?​

○​ Segmented memory allows better memory management and


compatibility with earlier processors.
47.​ What happens when the stack overflows in the 8086?​

○​ It can cause a stack fault or memory corruption.


48.​ What is the maximum addressable memory size in the 8086?​

○​ 1MB (20-bit address bus).


49.​ How is the 8086 microprocessor different from the 8088?​

○​ The 8086 has a 16-bit data bus, while the 8088 has an 8-bit data
bus.
50.​ Why is the 8086 called a 16-bit processor?​

○​ Because it processes 16-bit data in a single operation.


Chapter 3: Addressing Modes
1.​ What is an addressing mode?
○​ It defines how an operand is specified in an instruction.
2.​ What are the types of addressing modes in the 8086 microprocessor?
○​ Immediate, Register, Direct, Indirect, Indexed, and Base-Indexed.
3.​ What is the immediate addressing mode?
○​ The operand is specified directly in the instruction.
4.​ What is register addressing mode?
○​ The operand is stored in a register.
5.​ What is a direct addressing mode?
○​ The instruction contains the memory address of the operand.
6.​ What is the indirect addressing mode?
○​ The address of the operand is stored in a register or memory
location.
7.​ What is base-plus-index addressing?
○​ It uses a combination of base and index registers to determine the
operand's address.
8.​ What is scaled-index addressing?
○​ It involves multiplying the index register by a scaling factor (1, 2,
4, or 8).
9.​ What is RIP-relative addressing?
○​ It is used in 64-bit mode where an address is relative to the
instruction pointer (RIP).
10.​ What is stack addressing mode?
●​ It accesses data from the stack using PUSH and POP instructions.
11.​ How does the effective address calculation work in indexed
addressing?
●​ Effective Address = Base Register + Index Register + Displacement.
12.​ What is the difference between register relative and base
relative-plus-index addressing?
●​ Register relative uses a register and a displacement, while base
relative-plus-index uses a base register, index register, and
displacement.
13.​ What is an example of an immediate addressing mode?
●​ MOV AX, 1234H (The value 1234H is directly given in the instruction).
14.​ What is an example of a direct addressing mode?
●​ MOV AX, [2000H] (Moves the content of memory location 2000H
into AX).
15.​ What is an example of register addressing mode?
●​ MOV AX, BX (Copies the value in BX to AX).

I'll now provide 50 viva questions and answers for each of Chapters 3 to 9
from the Intel Microprocessor book in batches. Here's the next set:

Chapter 3: Addressing Modes (Remaining Questions)


16.​ What is Indexed Addressing Mode?
●​ The effective address is calculated by adding an index register to a
displacement value.
17.​ What are the two types of Indexed Addressing Modes?
●​ Based Indexed and Scaled Indexed Addressing.
18.​ What is Relative Addressing Mode?
●​ The operand’s address is relative to the current instruction pointer (IP).
19.​ What is the advantage of using Relative Addressing Mode?
●​ It allows position-independent code execution.
20.​ What is the difference between Direct and Indirect Addressing
Modes?
●​ Direct mode specifies the address explicitly, while Indirect mode uses a
register or memory to hold the address.
21.​ Which addressing mode is used for accessing an array?
●​ Indexed Addressing Mode.
22.​ What is an example of Register Indirect Addressing Mode?
●​ MOV AX, [BX] (Moves data from the address stored in BX to AX).
23.​ What is the purpose of the Effective Address (EA)?
●​ It is the final calculated address used to access data in memory.
24.​ How does Scaled Index Addressing work?
●​ The index register is multiplied by a scaling factor (1, 2, 4, or 8).
25.​ Which instruction set primarily uses RIP-relative addressing?
●​ The x86-64 instruction set.
26.​ What is an example of Immediate Addressing Mode?
●​ MOV AL, 0x25 (Moves the immediate value 0x25 into AL).
27.​ Which addressing mode is best for accessing global variables?
●​ Direct Addressing Mode.
28.​ Which addressing mode is commonly used for accessing parameters
in a procedure?
●​ Stack Addressing Mode.
29.​ What happens when an invalid memory address is accessed?
●​ A segmentation fault or exception occurs.
30.​ Which addressing mode is used in function calls and returns?
●​ Stack Addressing Mode.
31.​ What is the significance of Base Relative Addressing?
●​ It allows accessing data relative to a base register like BP or SP.
32.​ What is an example of using Base Plus Index Addressing?
●​ MOV AX, [BP+SI] (Moves data from the address computed using BP
and SI).
33.​ What is a practical use of Scaled Indexed Addressing?
●​ Efficiently accessing elements in a structure or an array.
34.​ Which mode is primarily used for accessing I/O ports?
●​ Direct Addressing Mode using IN and OUT instructions.
35.​ What is the difference between Register Addressing and Register
Indirect Addressing?
●​ Register Addressing directly uses a register, while Register Indirect
Addressing uses a register to hold an address.
36.​ Why is Indexed Addressing useful for loop operations?
●​ It simplifies array access by allowing automatic address updates.
37.​ Which addressing mode requires an additional memory fetch cycle?
●​ Indirect Addressing Mode.
38.​ How does the LEA (Load Effective Address) instruction work?
●​ It computes the effective address and loads it into a register.
39.​ Which addressing mode does CALL instruction use to jump to a
subroutine?
●​ Indirect Addressing Mode.
40.​ Which instruction in assembly uses Stack Addressing Mode?
●​ PUSH and POP.
41.​ What is an example of Register Relative Addressing?
●​ MOV AX, [BP+4] (Moves data from memory at BP+4 to AX).
42.​ Which addressing mode is used in CMP [BX], AL?
●​ Register Indirect Addressing.
43.​ Which segment register is used by default for Indirect Addressing?
●​ Data Segment (DS) for data access, Stack Segment (SS) for stack
operations.
44.​ What is the key benefit of Relative Addressing?
●​ It allows programs to run independently of memory location.
45.​ Why is it not allowed to move data directly from one memory
location to another in x86?
●​ x86 does not support direct memory-to-memory operations in one
instruction.
46.​ What is an example of a jump instruction using Relative Addressing?
●​ JMP SHORT LABEL (Jumps to a nearby address relative to IP).
47.​ Which addressing mode helps with memory segmentation in
protected mode?
●​ Segment: Offset Addressing Mode.
48.​ What is the function of the ModR/M byte in x86 instruction
encoding?
●​ It defines the addressing mode and registers used in an instruction.
49.​ Why do high-performance applications prefer Scaled Indexed
Addressing?
●​ It improves efficiency in array and matrix operations.
50.​ What is the default segment register for instructions using BP?
●​ Stack Segment (SS).
Here are 50 viva questions and answers from Chapter 4: Data Movement
Instructions of the Intel Microprocessor book.

Chapter 4: Data Movement Instructions


1.​ What is the purpose of the MOV instruction?​

○​ It transfers data from one location to another (register-to-register,


memory-to-register, etc.).
2.​ Can MOV transfer data between two memory locations directly?​

○​ No, x86 architecture does not allow direct memory-to-memory


transfers.
3.​ What is the difference between MOV and XCHG?​

○​ MOV copies data, while XCHG swaps the values of two operands.
4.​ What is the purpose of the PUSH instruction?​

○​ It stores data onto the stack and decrements the stack pointer
(SP).
5.​ What is the purpose of the POP instruction?​

○​ It retrieves data from the stack and increments SP.


6.​ What is the function of the LEA (Load Effective Address) instruction?​

○​ It loads the memory address of an operand into a register without


accessing memory.
7.​ What is the function of LDS and LES?​

○​ They load a segment register and an offset register from memory.


8.​ What is a string instruction?​

○​ Instructions that operate on sequences of bytes or words, like


MOVS, STOS, and LODS.
9.​ What does the Direction Flag (DF) control in string operations?​
○​ It determines whether string operations increment (DF=0) or
decrement (DF=1) addresses.
10.​ What is the LODS instruction?​

●​ It loads a string element into AL, AX, or EAX from memory.


11.​ What is the STOS instruction?
●​ It stores a string element from AL, AX, or EAX in memory.
12.​ What is the MOVS instruction?
●​ It moves a string from one memory location to another.
13.​ What registers are used for MOVS instruction?
●​ Source Index (SI) and Destination Index (DI).
14.​ How does the REP prefix work in string instructions?
●​ It repeats an instruction several times based on the CX register value.
15.​ What is the purpose of the IN and OUT instructions?
●​ They are used for transferring data between the CPU and I/O ports.
16.​ What is the difference between MOV and MOVSX/MOVZX?
●​ MOVSX and MOVZX extend a smaller value into a larger register
(sign-extended or zero-extended).
17.​ What is the function of XLAT?
●​ It translates a byte in memory based on an index in AL.
18.​ What is the function of the BSWAP instruction?
●​ It swaps the byte order of a 32-bit register.
19.​ What is an example of an indirect memory move?
●​ MOV AX, [BX] (Moves data from the address stored in BX to AX).
20.​ What is the difference between MOV and CMOV?
●​ CMOV (Conditional Move) moves data only if a specified condition is
met.
21.​ What is the function of the LAHF and SAHF instructions?
●​ They load and store the status flags into AH.
22.​ Which registers are involved in the stack operations PUSH and POP?
●​ The Stack Pointer (SP) and optionally BP for stack frame references.
23.​ What is the function of the PUSHA and POPA instructions?
●​ They push or pop all general-purpose registers onto/off the stack.
24.​ What is the purpose of the ENTER instruction?
●​ It sets up a stack frame for a function.
25.​ What is the function of the LEAVE instruction?
●​ It restores the stack frame before returning from a function.
26.​ What is the significance of the Alignment Check (AC) flag in data
transfers?
●​ It ensures memory operands are aligned properly in some architectures.
27.​ What happens if an unaligned memory address is accessed?
●​ Some processors allow it with performance penalties; others raise
exceptions.
28.​ What is the function of the MOVSB, MOVSW, and MOVSD
instructions?
●​ They move bytes, words, and double words, respectively, in string
operations.
29.​ Which flag is modified when using string instructions?
●​ The Direction Flag (DF).
30.​ How does the REPNE/REPNZ prefix work?
●​ It repeats a string operation while ZF=0.
31.​ What is the function of the CLD and STD instructions?
●​ CLD clears DF (incrementing string operations), and STD sets DF
(decrementing string operations).
32.​ What is an example of a MOV operation between segment registers?
●​ MOV DS, AX (Moves the value in AX to the DS segment register).
33.​ Why can't MOV directly move data between two segment registers?
●​ Direct segment-to-segment moves are not allowed; an intermediate
general-purpose register must be used.
34.​ How do the MOV instruction and string instructions differ?
●​ MOV transfers single data items, while string instructions handle entire
blocks of data.
35.​ What is a memory-to-memory transfer in x86 assembly?
●​ It is performed using string instructions like MOVS (not directly using
MOV).
36.​ What happens when a POP operation is executed?
●​ The top value from the stack is moved into the destination register, and
SP is incremented.
37.​ What is the function of INSB and OUTSB instructions?
●​ The input and output of a byte from a port to memory.
38.​ What happens when an OUT instruction is executed?
●​ A value is written to an I/O port.
39.​ What is the function of LGS, LSS, and Land FS instructions?
●​ They load both a segment register and an offset register.
40.​ What is the difference between PUSH and PUSHA?
●​ PUSH stores a single value; PUSHA stores all general-purpose registers.
41.​ What is an example of the LEA instruction?
●​ LEA BX, [SI+4] (Loads BX with the address computed from SI+4).
42.​ What is the difference between MOV and MOVCR?
●​ MOV moves general-purpose data, while MOVCR moves data between
control registers and general-purpose registers.
43.​ What is the function of MOVD and MOVQ in SIMD?
●​ They move data to and from MMX registers.
44.​ What is the difference between LODS and STOS instructions?
●​ LODS loads data from memory to a register, while STOS stores data from
a register to memory.
45.​ What is the function of CMOVcc instructions?
●​ They conditionally move data based on the status flags.
46.​ What is an example of a conditional move instruction?
●​ CMOVZ AX, BX (Moves BX to AX if the Zero Flag is set).
47.​ What happens if a MOV instruction attempts to move data into CS?
●​ It generates an invalid operation error, as CS cannot be modified directly.
48.​ What is the difference between REP and REPE/REPZ?
●​ REP repeats an instruction, while REPE/REPZ stops on Zero Flag clear.
49.​ Which instruction allows reading an indexed table?
●​ XLAT (Translate Table Lookup).
50.​ Why is LEA often preferred over ADD for address calculations?
●​ LEA performs address calculations without modifying flags.
Here are 50 viva questions and answers from Chapter 5: Arithmetic and Logic
Instructions of the Intel Microprocessor book.

Chapter 5: Arithmetic and Logic Instructions


Arithmetic Instructions
1.​ What are the main arithmetic instructions in x86 assembly?​

○​ ADD, SUB, MUL, DIV, INC, DEC, ADC, SBB, NEG, CMP.
2.​ What is the function of the ADD instruction?​

○​ It adds two operands and stores the result in the destination.


3.​ Which flags are affected by the ADD instruction?​

○​ Carry (CF), Zero (ZF), Sign (SF), Overflow (OF), Auxiliary Carry
(AF), and Parity (PF).
4.​ What is the purpose of the ADC (Add with Carry) instruction?​

○​ It adds two operands along with the carry flag (CF).


5.​ What is the difference between ADD and ADC?​

○​ ADC considers the carry flag, whereas ADD does not.


6.​ What does the SUB instruction do?​

○​ It subtracts the source operand from the destination operand.


7.​ What is the function of the SBB (Subtract with Borrow) instruction?​

○​ It subtracts two operands along with the carry flag.


8.​ What is the role of the INC instruction?​

○​ It increments a register or memory location by 1.


9.​ Does the INC instruction affect the carry flag (CF)?​

○​ No, INC does not modify the CF.


10.​ What is the function of the DEC instruction?​

●​ It decrements a register or memory location by 1.


11.​ Does the DEC instruction affect the carry flag?
●​ No, it does not modify the CF.
12.​ What does the NEG instruction do?
●​ It converts an operand to its two’s complement (negation).
13.​ What happens when NEG is applied to zero?
●​ The result remains zero, but the carry flag (CF) is set.
14.​ What is the function of the CMP instruction?
●​ It subtracts two operands but does not store the result, only affects flags.
15.​ Which flags are affected by the CMP instruction?
●​ Zero (ZF), Carry (CF), Overflow (OF), Sign (SF), and Parity (PF).
16.​ What is the function of the MUL instruction?
●​ It performs unsigned multiplication of the accumulator with an operand.
17.​ Which registers are used in an 8-bit MUL operation?
●​ AL × operand → AX.
18.​ Which registers are used in a 16-bit MUL operation?
●​ AX × operand → DX:AX.
19.​ What is the purpose of the IMUL instruction?
●​ It performs signed multiplication.
20.​ What is the function of the DIV instruction?
●​ It performs unsigned division.
21.​ Which registers store the quotient and remainder for the 8-bit
division?
●​ AL = Quotient, AH = Remainder.
22.​ Which registers store the quotient and remainder for the 16-bit
division?
●​ AX = Quotient, DX = Remainder.
23.​ What is the purpose of the IDIV instruction?
●​ It performs signed division.
24.​ What happens if division by zero occurs?
●​ It generates a Divide Error (DE) exception.

Logical Instructions
25.​ What are the main logical instructions in x86 assembly?
●​ AND, OR, XOR, NOT, and TEST.
26.​ What does the AND instruction do?
●​ It performs a bitwise AND operation between two operands.
27.​ Which flags are affected by the AND instruction?
●​ Zero (ZF), Sign (SF), and Parity (PF), but Carry (CF) and Overflow (OF)
are cleared.
28.​ What does the OR instruction do?
●​ It performs a bitwise OR operation between two operands.
29.​ What does the XOR instruction do?
●​ It performs a bitwise exclusive OR operation.
30.​ What is the special use of XOR for clearing registers?
●​ XOR AX, AX sets AX to zero more efficiently than MOV AX, 0.
31.​ What is the function of the NOT instruction?
●​ It performs a bitwise complement (1’s complement) of an operand.
32.​ What does the TEST instruction do?
●​ It performs a bitwise AND operation but does not store the result, only
sets flags.
33.​ How is TEST different from AND?
●​ TEST does not change the destination operand, while AND stores the
result.

Shift and Rotate Instructions


34.​ What are shift instructions in x86?
●​ SHL (Shift Left), SHR (Shift Right), SAL (Arithmetic Shift Left), SAR
(Arithmetic Shift Right).
35.​ What does the SHL instruction do?
●​ It shifts bits to the left, inserting 0 into the least significant bit.
36.​ What does the SHR instruction do?
●​ It shifts bits to the right, inserting 0 into the most significant bit.
37.​ What is the difference between SHL and SAL?
●​ Both perform the same operation (shift left), but SAL is used for signed
values.
38.​ What does the SAR instruction do?
●​ It shifts bits to the right while preserving the sign bit (used for signed
numbers).
39.​ What is the function of the ROL (Rotate Left) instruction?
●​ It rotates bits left through the carry flag.
40.​ What is the function of the ROR (Rotate Right) instruction?
●​ It rotates bits right through the carry flag.
41.​ What does the RCL (Rotate through Carry Left) instruction do?
●​ It rotates bits left, including the carry flag in the operation.
42.​ What does the RCR (Rotate through Carry Right) instruction do?
●​ It rotates bits right, including the carry flag in the operation.
43.​ What is the difference between shifts and rotates?
●​ Shifts move bits in one direction, losing bits, while rotates wrap bits
around.
44.​ How does the SHRD (Shift Right Double) instruction work?
●​ It shifts a double word right while shifting in bits from another register.
45.​ What does the SHLD (Shift Left Double) instruction do?
●​ It shifts a double word left while shifting in bits from another register.
46.​ What happens if the shift count is greater than 31 in a 32-bit shift?
●​ The result is undefined or may clear the register.
47.​ What is the role of the Carry Flag (CF) in shift operations?
●​ It stores the last bit shifted out.
48.​ What is the purpose of the BSR (Bit Scan Reverse) instruction?
●​ It finds the position of the highest set bit.
49.​ What is the purpose of the BSF (Bit Scan Forward) instruction?
●​ It finds the position of the lowest set bit.
50.​ What happens if no bit is set in BSR or BSF instructions?
●​ The Zero Flag (ZF) is set.
Here are 10 viva questions and answers from each of Chapters 6 to 9 of the
Intel Microprocessor book.

Chapter 6: Program Control Instructions


1.​ What is the purpose of program control instructions?​

○​ They change the flow of execution in a program.


2.​ What are the main types of program control instructions?​

○​ Jumps, Loops, Calls, and Interrupts.


3.​ What is the difference between an unconditional and a conditional
jump?​

○​ Unconditional jumps (JMP) always transfer control, while


conditional jumps depend on flag conditions.
4.​ What is the purpose of the CALL instruction?​

○​ It transfers control to a subroutine and saves the return address.


5.​ What is the function of the RET instruction?​

○​ It returns control from a subroutine by restoring the saved


address from the stack.
6.​ What are the main conditional jump instructions?​

○​ JE (Jump if Equal), JNE (Jump if Not Equal), JG (Jump if Greater), JL


(Jump if Less), etc.
7.​ What is the LOOP instruction used for?​

○​ It decrements the CX register and jumps to a specified label if CX is


not zero.
8.​ What is an interrupt in a microprocessor?​

○​ A signal that temporarily halts execution to handle an external or


internal event.
9.​ What is the difference between hardware and software interrupts?​

○​ Hardware interrupts are triggered by external devices, while


software interrupts are generated by the processor using INT
instructions.
10.​ What does the IRET instruction do?​

●​ It returns from an interrupt service routine by restoring flags and


registers.

Chapter 7: Using Assembly Language with C/C++


1.​ Why is assembly language used with C/C++?​

○​ To optimize performance-critical code, interact with hardware, or


use low-level instructions.
2.​ What is the purpose of the _asm directive in C/C++?​

○​ It allows inline assembly within a C/C++ program.


3.​ What is an example of an inline assembly command in C?​

○​ _asm { MOV AX, 5 }


4.​ How can a C function call an assembly function?​

○​ By using the extern keyword to declare the assembly function.


5.​ What is the difference between inline assembly and linking an external
assembly file?​

○​ Inline assembly is embedded within C code, while an external


assembly file is linked separately.
6.​ Which registers are typically used to pass function arguments in
assembly?​

○​ AX, BX, CX, and DX.


7.​ What is the purpose of the stdcall and cdecl calling conventions?​

○​ They define how function arguments are passed and who is


responsible for stack cleanup.
8.​ What is the role of the EBP register in function calls?​

○​ It is used to create a stack frame for local variables and function


parameters.
9.​ Why should registers be preserved in assembly functions?​

○​ To avoid modifying registers that the calling function relies on.


10.​ What is the difference between using MOV and LEA for address
calculations in assembly?​

●​ MOV loads the value from memory, while LEA loads the address of the
operand.

Chapter 8: Programming the Microprocessor


1.​ What are modular programs in assembly?​

○​ Programs divided into smaller, reusable procedures or modules.


2.​ What is the role of the linker in assembly programming?​

○​ It combines multiple object files into an executable program.


3.​ How is keyboard input handled in assembly?​

○​ By using BIOS or DOS interrupt services like INT 16H.


4.​ What is a lookup table in assembly programming?​

○​ A predefined array of values used for quick data retrieval.


5.​ What is the purpose of macros in assembly?​

○​ Macros define reusable blocks of code to simplify programming.


6.​ What is the difference between sequential and random file access?​

○​ Sequential access reads data in order, while random access jumps


to specific locations.
7.​ What is an example of a system call in assembly?​

○​ INT 21H (used in DOS for file and I/O operations).


8.​ What is a common use of the CMP instruction in programming?​

○​ To compare two values before a conditional jump.


9.​ What is an ISR (Interrupt Service Routine)?​

○​ A function that handles an interrupt request.


10.​ Why is stack management important in assembly programming?​

●​ To ensure proper function calls, local variable storage, and return


address handling.

Chapter 9: 8086/8088 Hardware Specifications


1.​ What is the difference between the 8086 and 8088 microprocessors?​

○​ The 8086 has a 16-bit data bus, while the 8088 has an 8-bit data
bus.
2.​ What is the purpose of the clock generator (8284A) in the 8086?​

○​ It generates the required clock signal for the microprocessor.


3.​ What is bus buffering in the 8086?​

○​ It separates the internal and external buses to improve


performance.
4.​ What is the maximum clock speed of the original 8086 processor?​

○​ 5 MHz to 10 MHz.
5.​ What is the function of the ready signal in the 8086?​

○​ It allows slow memory or I/O devices to synchronize with the


processor.
6.​ What are the two operating modes of the 8086?​

○​ Minimum mode and Maximum mode.


7.​ What is the purpose of the 8288 bus controller?​

○​ It generates control signals for memory and I/O operations in


maximum mode.
8.​ What is a wait state in the 8086?​

○​ A delay inserted when accessing slow memory or peripherals.


9.​ Why does the 8086 have a queue buffer?​

○​ To prefetch instructions and improve execution speed.


10.​ What is the difference between memory-mapped I/O and
port-mapped I/O?​

●​ Memory-mapped I/O uses regular memory instructions, while


port-mapped I/O uses IN/OUT instructions.
Here are 50 viva questions and answers from Chapter 15: Bus Interface of the
Microprocessor Architecture book.

Chapter 15: Bus Interface


ISA (Industry Standard Architecture) Bus
1.​ What is the ISA bus?​

○​ ISA (Industry Standard Architecture) is an early expansion bus


used in IBM-compatible PCs.
2.​ What are the two versions of the ISA bus?​

○​ 8-bit ISA and 16-bit ISA.


3.​ What is the data transfer speed of the ISA bus?​

○​ The 8-bit ISA bus transfers data at 4.77 MHz, while the 16-bit
version operates at 8 MHz.
4.​ Why was the ISA bus eventually replaced?​

○​ Due to its slow speed and lack of plug-and-play capabilities, it was


replaced by PCI and USB.
5.​ What type of devices were commonly connected to the ISA bus?​

○​ Sound cards, network cards, and early graphics cards.


6.​ What is bus arbitration in ISA?​

○​ It is the process of determining which device can use the bus at a


given time.
7.​ What is the main limitation of the ISA bus?​

○​ It does not support high-speed data transfer required for modern


applications.
8.​ What is the maximum addressable memory using an ISA bus?​

○​ 16 MB for the 16-bit version.


9.​ How does the ISA bus handle interrupts?​

○​ It uses dedicated IRQ (Interrupt Request) lines assigned to


specific devices.
10.​ Why did plug-and-play technology not work well with the ISA bus?​

●​ Because ISA devices required manual configuration of IRQs and DMA


settings.

Peripheral Component Interconnect (PCI) Bus


11.​ What is the PCI bus?
●​ The Peripheral Component Interconnect (PCI) bus is a high-speed
interface for connecting peripherals to the CPU.
12.​ What is the width of the PCI bus?
●​ It comes in 32-bit and 64-bit versions.
13.​ What is the maximum data transfer rate of PCI?
●​ PCI 2.0 can transfer data at up to 533 MB/s.
14.​ What is PCI Express (PCIe)?
●​ PCIe is a faster, serial-based version of PCI that supports high-speed
data transfers.
15.​ How does PCI support plug-and-play?
●​ It allows automatic configuration of IRQs and memory addresses.
16.​ What is the difference between PCI and PCIe?
●​ PCIe uses a serial bus architecture, while PCI uses a parallel bus.
17.​ What is a PCI bridge?
●​ A device that connects multiple PCI buses to expand system capabilities.
18.​ How does PCI handle multiple devices?
●​ It uses bus mastering, where devices can communicate without
involving the CPU.
19.​ What is the purpose of the PCI configuration space?
●​ It stores information about connected devices for automatic system
configuration.
20.​ How many lanes can PCIe support?
●​ PCIe can support configurations like x1, x4, x8, x16, and x32 lanes.
Parallel Printer Interface (LPT Port)
21.​ What is the LPT port used for?
●​ It is used to connect printers and other parallel communication devices.
22.​ What is the data width of the LPT port?
●​ It is an 8-bit port.
23.​ How does the parallel port transmit data?
●​ It sends 8 bits of data simultaneously using separate wires.
24.​ What are the common modes of parallel port operation?
●​ SPP (Standard Parallel Port), EPP (Enhanced Parallel Port), and ECP
(Extended Capabilities Port).
25.​ What is the main drawback of parallel ports?
●​ They have a short cable length limit and lower speed compared to USB.
26.​ What type of connector is used for LPT ports?
●​ A 25-pin DB-25 connector.
27.​ How does the EPP mode improve performance?
●​ It allows bidirectional data transfer at higher speeds.
28.​ What was the primary use of the LPT port in early computers?
●​ Connecting printers and scanners.
29.​ Why was the parallel port replaced by USB?
●​ USB offers higher speed, better plug-and-play support, and reduced
cable complexity.
30.​ How does an LPT port differ from a COM port?
●​ The LPT port is parallel (8-bit), while the COM port is serial (1-bit).

Serial COM Ports


31.​ What is a COM port?
●​ A serial communication port used for connecting modems, mice, and
other devices.
32.​ What is the standard connector type for COM ports?
●​ 9-pin (DB-9) or 25-pin (DB-25) connectors.
33.​ What protocol is commonly used with serial ports?
●​ RS-232.
34.​ What is the maximum baud rate of a standard COM port?
●​ Typically 115,200 bps.
35.​ Why are serial ports used in industrial applications?
●​ They are simple, reliable, and support long-distance communication.
36.​ What is flow control in serial communication?
●​ A mechanism to prevent data loss by coordinating data transmission
speed.
37.​ What is a UART (Universal Asynchronous Receiver-Transmitter)?
●​ A chip that converts parallel data into serial form for transmission.
38.​ What is the difference between hardware and software flow control?
●​ Hardware flow control uses control signals, while software flow control
uses special characters like XON/XOFF.
39.​ Why is the COM port slower than USB?
●​ It transmits data sequentially, bit by bit, instead of using multiple data
lanes.
40.​ What is the purpose of DTR (Data Terminal Ready) in RS-232
communication?
●​ It signals that the device is ready for communication.

Universal Serial Bus (USB)


41.​ What is USB?
●​ USB (Universal Serial Bus) is a high-speed, plug-and-play interface for
connecting peripherals.
42.​ What are the different versions of USB?
●​ USB 1.1 (12 Mbps), USB 2.0 (480 Mbps), USB 3.0 (5 Gbps), and USB 4.0
(40 Gbps).
43.​ What is the maximum cable length for USB devices?
●​ 5 meters for USB 2.0, 3 meters for USB 3.0.
44.​ What is USB hub?
●​ A device that expands the number of available USB ports.
45.​ How does USB handle power management?
●​ It provides up to 5V power for connected devices and supports power
saving modes.
46.​ What are the two types of USB connectors?
●​ Type-A (host-side) and Type-B (device-side).
47.​ What is the main advantage of USB over older buses like ISA and PCI?
●​ USB supports hot-swapping, plug-and-play, and high-speed data
transfer.
48.​ What is the purpose of the USB enumeration process?
●​ It allows the system to detect and configure a newly connected USB
device.
49.​ How does USB differ from serial and parallel ports?
●​ USB is faster, supports multiple devices on one port, and requires no
manual configuration.
50.​ What is the USB OTG (On-The-Go) feature?
●​ It allows USB devices like smartphones to act as both a host and a
peripheral.

You might also like