Q1: Affected flag of AND operation (2 Marks)
Answer:
The AND instruction performs a bitwise AND between two operands. It is commonly used to test specific bits of a number.
If the result becomes zero, the Zero Flag (ZF) is set and can be checked using the JZ instruction.
Q2: Relation between RET and CALL (2 Marks)
Answer:
Technically CALL and RET are independent instructions, but they are commonly used together.
- CALL transfers control to a subroutine.
- RET returns control back to the instruction following the CALL.
Q3: Difference between LES and LDS (3 Marks)
Answer:
| Instruction | Function |
| LES | Loads ES register and a general-purpose register |
| LDS | Loads DS register and a general-purpose register |
Both instructions load registers from a memory location.
Q4: Procedure to Clear Selective Bits (2 Marks)
Answer:
Selective bits can be cleared using masking with AND instruction.
A mask is created where:
- 1 keeps the original bit
- 0 clears the bit
Applying AND with the mask clears the desired bits.
Q5: Why REP prefix is not used with LODS? (2 Marks)
Answer:
REP is generally not used with LODS because every repetition overwrites the previous value in the register.
Only the last loaded value would remain in the register.
Q6: Difference between REPE and REPNE (3 Marks)
Answer:
| Prefix | Meaning |
| REPE / REPZ | Repeat while Zero Flag = 1 |
| REPNE / REPNZ | Repeat while Zero Flag = 0 |
These prefixes are used with string instructions.
Q7: Push and Pop Instructions (3 Marks)
Answer:
PUSH
- Decreases SP by 2
- Stores data on the stack
POP
- Retrieves data from stack
- Increases SP by 2
Example:
PUSH AX
POP BX
Q8: Characteristics of SCAS Instruction (5 Marks)
Answer:
SCAS compares the value in AL or AX with the memory location addressed by ES:DI.
Main features:
- Updates flags after comparison
- DI moves to the next memory location
- Used with REPE or REPNE
- Often used for searching characters in strings
Q9: Local Variables (5 Marks)
Answer:
Local variables are variables that exist only during the execution of a subroutine.
Characteristics:
- Created when a subroutine starts
- Removed when the subroutine ends
- Stored on the stack
- Do not occupy permanent memory space
Q10: Divide Overflow Error (2 Marks)
Answer:
A divide overflow error occurs when the quotient produced by a division operation is too large to fit in the destination register.
In this case, the processor generates an interrupt and program execution stops.
Q11: Purpose of INT 4 (2 Marks)
Answer:
INT 4 is the Overflow Interrupt.
It occurs when the overflow flag is set and the INTO instruction is executed.
Q12: Exchange Instruction (XCHG) Example (2 Marks)
Answer:
The XCHG instruction exchanges the contents of two operands.
Example:
XCHG AX, BX
This swaps the values of AX and BX.
Q13: Block Processing Instructions in 8088 (2 Marks)
There are 5 block processing instructions:
- MOVS – Move string
- LODS – Load string
- STOS – Store string
- CMPS – Compare string
- SCAS – Scan string
Q14: Permanent and Temporary Diversion Instructions (2 Marks)
Answer:
| Type | Instruction |
| Permanent diversion | JMP |
| Temporary diversion | CALL |
Q15: Purpose of STOS and CMPS (3 Marks)
STOS
- Stores AL or AX into memory location ES:DI
- Used for clearing or filling memory blocks
CMPS
- Compares memory blocks DS:SI and ES:DI
- Used to check equality of strings
Q16: Direction Flag (DF) (2 Marks)
| DF Value | Meaning |
| DF = 0 | String operations move from lower → higher address |
| DF = 1 | String operations move from higher → lower address |
Q17: MUL Instruction (5 Marks)
Byte Operand
AL × Source → Result in AX
Word Operand
AX × Source → Result in DX:AX
Q18: CALL Instruction with Stack (3 Marks)
When CALL executes:
- Current IP is pushed onto stack.
- Control transfers to the subroutine.
- Subroutine executes.
When RET executes:
- IP is popped from stack.
- Control returns to the instruction after CALL.
Q19: ADC Instruction (5 Marks)
ADC (Add with Carry) adds two operands and also adds the carry flag.
Example:
ADC AX, BX
Operation:
AX = AX + BX + CF
This instruction is used in multi-byte arithmetic operations.
Q20: ROR Instruction (2 Marks)
Rotate Right (ROR) moves each bit to the right and the dropped bit from the rightmost position enters the leftmost position.
The dropped bit is also stored in the Carry Flag.
Q21: Short Jump (2 Marks)
A Short Jump uses 1 byte offset to transfer control to a nearby instruction.
Q22: Far Jump (2 Marks)
A Far Jump loads both:
- CS (Code Segment)
- IP (Instruction Pointer)
It is used when jumping to another memory segment.