Microprocessors

Assembly Programming — Practice MCQs for CCAT

25 Questions Section C: Hardware Microprocessors

Practice 25 Assembly Programming multiple-choice questions designed for CDAC CCAT exam preparation. Click "Show Answer" to reveal the correct option with detailed explanation.

Q1.
MOV instruction:
AMoves and deletes source
BCopies source to destination
CAdds values
DCompares values
Show Answer & Explanation

Correct Answer: B — Copies source to destination

MOV copies data from source to destination (source unchanged).

Q2.
ADD instruction:
ASubtracts
BAdds source to destination
CMultiplies
DDivides
Show Answer & Explanation

Correct Answer: B — Adds source to destination

ADD: destination = destination + source.

Q3.
SUB instruction:
AAdds
BSubtracts source from destination
CMultiplies
DShifts
Show Answer & Explanation

Correct Answer: B — Subtracts source from destination

SUB: destination = destination - source.

Q4.
CMP instruction:
ACompares by subtracting, sets flags
BCopies
CAdds
DJumps
Show Answer & Explanation

Correct Answer: A — Compares by subtracting, sets flags

CMP subtracts without storing result, only sets flags.

Q5.
JMP instruction:
AConditional jump
BUnconditional jump
CCalls subroutine
DReturns
Show Answer & Explanation

Correct Answer: B — Unconditional jump

JMP: unconditional jump to specified address.

Q6.
JZ instruction jumps when:
AZero flag is set
BZero flag is clear
CCarry flag set
DAlways
Show Answer & Explanation

Correct Answer: A — Zero flag is set

JZ (Jump if Zero): jumps when ZF=1.

Q7.
CALL instruction:
AJumps and loses return address
BPushes return address, jumps to subroutine
CPops from stack
DHalts
Show Answer & Explanation

Correct Answer: B — Pushes return address, jumps to subroutine

CALL saves return address on stack and jumps to subroutine.

Q8.
RET instruction:
ACalls subroutine
BReturns from subroutine
CResets processor
DRotates
Show Answer & Explanation

Correct Answer: B — Returns from subroutine

RET pops return address from stack and returns.

Q9.
LOOP instruction:
ALoops forever
BDecrements CX, loops if CX≠0
CIncrements CX
DNo looping
Show Answer & Explanation

Correct Answer: B — Decrements CX, loops if CX≠0

LOOP decrements CX; if CX≠0, jumps to label.

Q10.
LEA instruction:
ALoads effective address
BLoads data
CStores address
DExchanges
Show Answer & Explanation

Correct Answer: A — Loads effective address

LEA (Load Effective Address) loads address, not data.

Q11.
What is the purpose of the MOV instruction?
APerforms mathematical operation
BCopies data from source to destination
CMoves and deletes source
DCompares two values
Show Answer & Explanation

Correct Answer: B — Copies data from source to destination

MOV copies data from source operand to destination operand. Source remains unchanged.

Q12.
What is the difference between MOV and XCHG instructions?
ANo difference
BMOV copies data, XCHG exchanges data between operands
CMOV is faster
DXCHG works only with registers
Show Answer & Explanation

Correct Answer: B — MOV copies data, XCHG exchanges data between operands

MOV copies from source to destination. XCHG exchanges contents between two operands.

Q13.
What does the PUSH instruction do?
AReads from stack
BWrites data to stack and decrements SP
CIncrements SP and writes to stack
DClears the stack
Show Answer & Explanation

Correct Answer: B — Writes data to stack and decrements SP

PUSH decrements the stack pointer and then copies the operand to the top of stack.

Q14.
What does the POP instruction do?
AWrites data to stack
BReads data from stack and increments SP
CDecrements SP and reads from stack
DEmpties the stack
Show Answer & Explanation

Correct Answer: B — Reads data from stack and increments SP

POP copies data from top of stack to operand and then increments the stack pointer.

Q15.
What is the function of the CALL instruction?
AJumps to subroutine without saving return address
BPushes return address and jumps to subroutine
CCalls operating system
DCalls interrupt handler
Show Answer & Explanation

Correct Answer: B — Pushes return address and jumps to subroutine

CALL pushes the return address (next instruction) onto stack and then jumps to the subroutine.

Q16.
What does the RET instruction do?
AReturns a value
BPops return address from stack and jumps to it
CResets the processor
DReturns to main program
Show Answer & Explanation

Correct Answer: B — Pops return address from stack and jumps to it

RET pops the return address from the stack into IP/PC, returning control to the caller.

Q17.
What is the difference between JMP and CALL?
ANo difference
BCALL saves return address, JMP does not
CJMP is conditional
DCALL is faster
Show Answer & Explanation

Correct Answer: B — CALL saves return address, JMP does not

JMP simply transfers control without saving return address. CALL saves return address on stack for later RET.

Q18.
What is an assembler directive?
AMachine instruction
BInstruction for the assembler, not converted to machine code
CError message
DComment
Show Answer & Explanation

Correct Answer: B — Instruction for the assembler, not converted to machine code

Assembler directives (like ORG, EQU, DB) instruct the assembler but are not converted to machine instructions.

Q19.
What does the ORG directive do?
AOrganizes code
BSets the starting address for code/data
COriginal copy of data
DOperating region
Show Answer & Explanation

Correct Answer: B — Sets the starting address for code/data

ORG (Origin) directive sets the memory address where the following code or data will be placed.

Q20.
What is the purpose of the CMP instruction?
AComputes result
BSubtracts operands and sets flags without storing result
CComplements a number
DCopies and moves
Show Answer & Explanation

Correct Answer: B — Subtracts operands and sets flags without storing result

CMP subtracts second operand from first, setting flags accordingly, but does not store the result.

Q21.
What does the JZ instruction do?
AJump always
BJump if Zero flag is set
CJump if Zero flag is clear
DJump to zero address
Show Answer & Explanation

Correct Answer: B — Jump if Zero flag is set

JZ (Jump if Zero) transfers control if the Zero flag is set (previous operation result was zero).

Q22.
What is the difference between JE and JZ?
AJE is for signed numbers
BThey are the same instruction
CJZ is faster
DJE checks equality flag
Show Answer & Explanation

Correct Answer: B — They are the same instruction

JE (Jump if Equal) and JZ (Jump if Zero) are identical - both check if Zero flag is set.

Q23.
What does the LOOP instruction do?
ACreates infinite loop
BDecrements CX and jumps if CX is not zero
CLoops through memory
DLoops until carry
Show Answer & Explanation

Correct Answer: B — Decrements CX and jumps if CX is not zero

LOOP decrements CX (counter) and jumps to target label if CX is not zero, used for counted loops.

Q24.
What is the purpose of the LEA instruction?
ALoads effective address into register
BLoads value from memory
CLinks external addresses
DLeft shift effective address
Show Answer & Explanation

Correct Answer: A — Loads effective address into register

LEA (Load Effective Address) calculates and loads the memory address of operand into register, not the value.

Q25.
What does the NOP instruction do?
ANo operation - does nothing but consume time
BNegates operand
CNormalizes output
DNext operation pointer
Show Answer & Explanation

Correct Answer: A — No operation - does nothing but consume time

NOP (No Operation) performs no operation. Used for timing delays or reserving space for later patching.