Back to Practice Microprocessors

Assembly Programming - Practice MCQs for CCAT

50 Questions Section C: Hardware Microprocessors

Assembly Programming Question Bank for C-CAT

Topic-wise Assembly Programming MCQs for CDAC C-CAT preparation with answers and explanations.

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

Correct Answer: A - 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:
AJumps
BCopies
CAdds
DCompares by subtracting, sets flags
Show Answer & Explanation

Correct Answer: D - 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 clear
BZero flag is set
CCarry flag set
DAlways
Show Answer & Explanation

Correct Answer: B - 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:
ADecrements CX, loops if CX!= 0
BLoops forever
CIncrements CX
DNo looping
Show Answer & Explanation

Correct Answer: A - Decrements CX, loops if CX!= 0

LOOP decrements CX; if CX!= 0, jumps to label.

Q10.
LEA instruction:
AStores address
BLoads data
CLoads effective address
DExchanges
Show Answer & Explanation

Correct Answer: C - Loads effective address

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

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

Correct Answer: C - 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
BXCHG works only with registers
CMOV is faster
DMOV copies data, XCHG exchanges data between operands
Show Answer & Explanation

Correct Answer: D - 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
BDecrements SP and reads from stack
CReads data from stack and increments SP
DEmpties the stack
Show Answer & Explanation

Correct Answer: C - 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
BReturns to main program
CResets the processor
DPops return address from stack and jumps to it
Show Answer & Explanation

Correct Answer: D - 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?
ACALL saves return address, JMP does not
BNo difference
CJMP is conditional
DCALL is faster
Show Answer & Explanation

Correct Answer: A - 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
BOperating region
COriginal copy of data
DSets the starting address for code/data
Show Answer & Explanation

Correct Answer: D - 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?
ASubtracts operands and sets flags without storing result
BComputes result
CComplements a number
DCopies and moves
Show Answer & Explanation

Correct Answer: A - 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 clear
CJump if Zero flag is set
DJump to zero address
Show Answer & Explanation

Correct Answer: C - 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
BJE checks equality flag
CJZ is faster
DThey are the same instruction
Show Answer & Explanation

Correct Answer: D - 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
BLoops through memory
CDecrements CX and jumps if CX is not zero
DLoops until carry
Show Answer & Explanation

Correct Answer: C - 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?
ALinks external addresses
BLoads value from memory
CLoads effective address into register
DLeft shift effective address
Show Answer & Explanation

Correct Answer: C - 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?
ANext operation pointer
BNegates operand
CNormalizes output
DNo operation - does nothing but consume time
Show Answer & Explanation

Correct Answer: D - No operation - does nothing but consume time

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

Q26.
Which 8085 instruction is used to copy the content of one register to another?
AMOV
BMVI
CLDA
DSTA
Show Answer & Explanation

Correct Answer: A - MOV

MOV Rd, Rs copies the content of source register (Rs) to the destination register (Rd). For example, MOV A, B copies the content of B into A.

Q27.
What is the addressing mode used in the instruction MVI A, 32H?
ADirect addressing
BRegister addressing
CImmediate addressing
DIndirect addressing
Show Answer & Explanation

Correct Answer: C - Immediate addressing

MVI A, 32H uses immediate addressing mode because the data (32H) is specified directly in the instruction as the second byte.

Q28.
Which instruction is used to load the accumulator directly from a memory address in 8085?
ALDA address
BMOV A, M
CLDAX B
DIN port
Show Answer & Explanation

Correct Answer: A - LDA address

LDA (Load Accumulator Direct) loads the accumulator with the contents of the memory location specified by a 16-bit address. It is a 3-byte instruction.

Q29.
In 8085 assembly, the instruction 'PUSH B' performs which operation?
AStores B register on stack
BStores BC pair on stack (B first, then C)
CLoads BC pair from stack
DStores accumulator on stack
Show Answer & Explanation

Correct Answer: B - Stores BC pair on stack (B first, then C)

PUSH B pushes the BC register pair onto the stack. First, SP is decremented and B is stored, then SP is decremented again and C is stored.

Q30.
What does the DAA instruction do in 8085?
ADecimal to ASCII conversion
BDirect address access
CDecimal Adjust Accumulator for BCD arithmetic
DDisable all accumulator flags
Show Answer & Explanation

Correct Answer: C - Decimal Adjust Accumulator for BCD arithmetic

DAA (Decimal Adjust Accumulator) adjusts the result in the accumulator after a BCD addition to ensure the result is valid BCD. It adds 06H or 60H as needed.

Q31.
Which 8085 instruction complements the accumulator?
ACMP
BCMA
CCMC
DSTC
Show Answer & Explanation

Correct Answer: B - CMA

CMA (Complement Accumulator) performs a bitwise complement (1's complement) of the accumulator. Each bit is inverted: 0 becomes 1 and 1 becomes 0.

Q32.
The instruction XCHG in 8085 exchanges the contents of:
AHL and DE register pairs
BA and B registers
CHL and BC register pairs
DSP and HL register pairs
Show Answer & Explanation

Correct Answer: A - HL and DE register pairs

XCHG exchanges the contents of the HL register pair with the DE register pair. H↔D and L↔E. It is a 1-byte instruction requiring 4 T-states.

Q33.
What addressing mode is used in the instruction MOV A, M in 8085?
ADirect addressing
BImmediate addressing
CRegister addressing
DRegister indirect addressing
Show Answer & Explanation

Correct Answer: D - Register indirect addressing

MOV A, M uses register indirect addressing. 'M' refers to the memory location whose address is in the HL register pair. The content at that address is moved to A.

Q34.
Which 8085 instruction is used to rotate the accumulator left through carry?
ARLC
BRRC
CRAL
DRAR
Show Answer & Explanation

Correct Answer: C - RAL

RAL (Rotate Accumulator Left through carry) rotates the accumulator bits left through the carry flag. The carry flag goes to bit 0, and bit 7 goes to carry.

Q35.
In 8086, the instruction LEA BX, [SI+10] uses which addressing mode?
AImmediate addressing
BDirect addressing
CBased indexed addressing
DIndexed addressing with displacement
Show Answer & Explanation

Correct Answer: D - Indexed addressing with displacement

LEA BX, [SI+10] uses indexed addressing with displacement. The effective address is computed by adding the index register SI value with the displacement 10.

Q36.
What is the function of the HLT instruction in the 8085?
AHalts the clock
BDisables interrupts
CHalts I/O operations
DStops program execution until reset or interrupt
Show Answer & Explanation

Correct Answer: D - Stops program execution until reset or interrupt

HLT stops the program execution. The processor enters a halt state and waits until an interrupt occurs or the processor is reset using RESET IN pin.

Q37.
Which 8086 instruction is used to transfer a block of data?
AMOV
BXCHG
CMOVSB/MOVSW
DLEA
Show Answer & Explanation

Correct Answer: C - MOVSB/MOVSW

MOVSB (Move String Byte) and MOVSW (Move String Word) are used with the REP prefix to transfer blocks of data from DS:SI to ES:DI automatically.

Q38.
The LHLD instruction in 8085 loads:
AAccumulator from memory
BDE pair from memory
CHL pair from two consecutive memory locations
DBC pair from memory
Show Answer & Explanation

Correct Answer: C - HL pair from two consecutive memory locations

LHLD (Load HL Direct) loads the HL register pair from two consecutive memory locations. L is loaded from the specified address and H from the next address.

Q39.
What does the CPI instruction do in the 8085?
ACompares accumulator with immediate data
BCompares two registers
CCopies immediate data to register
DComplements the immediate data
Show Answer & Explanation

Correct Answer: A - Compares accumulator with immediate data

CPI (Compare Immediate) compares the accumulator with 8-bit immediate data by subtracting the data from A (without storing result). Flags are set based on the result.

Q40.
In 8086, the instruction INT 21H is an example of:
AHardware interrupt
BNon-maskable interrupt
CMaskable interrupt
DSoftware interrupt
Show Answer & Explanation

Correct Answer: D - Software interrupt

INT 21H is a software interrupt instruction. It invokes interrupt service routine number 21H (DOS function calls). Software interrupts are triggered by the INT instruction.

Q41.
Which instruction pair is used for subroutine call and return in 8085?
AJMP and HLT
BCALL and RET
CPUSH and POP
DIN and OUT
Show Answer & Explanation

Correct Answer: B - CALL and RET

CALL pushes the return address onto the stack and jumps to the subroutine address. RET pops the return address from the stack back into the PC to resume execution.

Q42.
What is the size of the LDA instruction in 8085?
A3 bytes
B2 bytes
C1 byte
D4 bytes
Show Answer & Explanation

Correct Answer: A - 3 bytes

LDA is a 3-byte instruction: 1 byte for the opcode (3AH) and 2 bytes for the 16-bit memory address (lower byte first, then higher byte).

Q43.
Which 8085 instruction is used to increment the content of register pair HL?
AINR H
BINR L
CINR M
DINX H
Show Answer & Explanation

Correct Answer: D - INX H

INX H increments the 16-bit content of the HL register pair by 1. Unlike INR which works on 8-bit registers, INX works on 16-bit register pairs.

Q44.
In 8086, what does the XLAT instruction do?
AReplaces AL with a byte from a lookup table at BX+AL
BTranslates ASCII to EBCDIC
CExchanges AL with AH
DLoads a word from a table
Show Answer & Explanation

Correct Answer: A - Replaces AL with a byte from a lookup table at BX+AL

XLAT (Translate) loads AL with the byte from a table in memory. The table address is DS:BX, and AL serves as the index. Effective address = BX + AL.

Q45.
What is the effect of the STC instruction in 8085?
ASets the carry flag to 1
BSets the zero flag
CStores accumulator in memory
DStops the counter
Show Answer & Explanation

Correct Answer: A - Sets the carry flag to 1

STC (Set Carry) sets the carry flag (CY) to 1. No other flags are affected by this instruction.

Q46.
Which addressing mode is used in the 8086 instruction MOV AX, [BX+SI+5]?
ARegister addressing
BDirect addressing
CBased indexed with displacement
DImmediate addressing
Show Answer & Explanation

Correct Answer: C - Based indexed with displacement

MOV AX, [BX+SI+5] uses based indexed with displacement addressing. The effective address = BX + SI + 5, combining a base register, index register, and displacement.

Q47.
The RRC instruction in 8085 performs:
ARotate accumulator right through carry
BRotate accumulator right without carry
CReset the carry flag
DReturn from subroutine conditionally
Show Answer & Explanation

Correct Answer: B - Rotate accumulator right without carry

RRC (Rotate Right Carry) rotates the accumulator right. Bit 0 goes to both the carry flag and bit 7. The carry flag is not included in the rotation path.

Q48.
What does the DCR M instruction do in 8085?
ADecrements the memory content pointed by HL
BDecrements register M
CDecrements the accumulator
DDecrements the stack pointer
Show Answer & Explanation

Correct Answer: A - Decrements the memory content pointed by HL

DCR M decrements the content of the memory location addressed by the HL register pair by 1. 'M' refers to the memory location pointed to by HL.

Q49.
In 8086, which flag determines whether string operations auto-increment or auto-decrement SI and DI?
ADirection Flag
BCarry Flag
COverflow Flag
DTrap Flag
Show Answer & Explanation

Correct Answer: A - Direction Flag

The Direction Flag (DF) controls the direction of string operations. DF=0 (CLD) causes auto-increment; DF=1 (STD) causes auto-decrement of SI and DI.

Q50.
The instruction PCHL in 8085 performs which operation?
APushes HL to stack
BLoads HL from PC
CClears the program counter
DCopies HL content to Program Counter
Show Answer & Explanation

Correct Answer: D - Copies HL content to Program Counter

PCHL copies the contents of the HL register pair to the Program Counter. This effectively jumps to the address stored in HL, providing an indirect jump mechanism.

Showing 1-10 of 50 questions