T4Tutorials .PK

VU Past Papers – Midterm Solved Subjective Questions


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.


Q3: Difference between LES and LDS (3 Marks)

Answer:

InstructionFunction
LESLoads ES register and a general-purpose register
LDSLoads 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:

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:

PrefixMeaning
REPE / REPZRepeat while Zero Flag = 1
REPNE / REPNZRepeat while Zero Flag = 0

These prefixes are used with string instructions.


Q7: Push and Pop Instructions (3 Marks)

Answer:

PUSH

POP

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:


Q9: Local Variables (5 Marks)

Answer:
Local variables are variables that exist only during the execution of a subroutine.

Characteristics:


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:

  1. MOVS – Move string
  2. LODS – Load string
  3. STOS – Store string
  4. CMPS – Compare string
  5. SCAS – Scan string

Q14: Permanent and Temporary Diversion Instructions (2 Marks)

Answer:

TypeInstruction
Permanent diversionJMP
Temporary diversionCALL

Q15: Purpose of STOS and CMPS (3 Marks)

STOS

CMPS


Q16: Direction Flag (DF) (2 Marks)

DF ValueMeaning
DF = 0String operations move from lower → higher address
DF = 1String 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:

  1. Current IP is pushed onto stack.
  2. Control transfers to the subroutine.
  3. Subroutine executes.

When RET executes:

  1. IP is popped from stack.
  2. 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:

It is used when jumping to another memory segment.

Exit mobile version