NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Microprocessors And Microcontrollers
Assignment 6- Week 6
TYPE OF QUESTION: MCQ
Number of questions: 15 Total mark: 15 X 1 = 15
______________________________________________________________________________
QUESTION 1:
The instruction, ADD A, R7 is an example of
a) register instructions
b) register specific instructions
c) indexed addressing
d) None of the above
Correct Answer: a
Detailed Solution:
In register instructions addressing mode, operands are stored in the registers R0-R7
of the selected register bank. One of these registers is specified in the instruction.
______________________________________________________________________________
QUESTION 2:
The instruction, ADD A, #100 performs
a) 100(decimal) is added to contents of address register
b) 100(decimal) is subtracted from the accumulator
c) 100(decimal) is added to contents of an accumulator
d) None of the above
Correct Answer: c
Detailed Solution: Immediate data 100(decimal) is added to the contents of the
accumulator.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 3:
What are the contents of the accumulator and B execution of following instructions?
MOV A, #25H,
MOV B, #65H,
MUL AB;
a) A = 99H, B= 0EH
b) A = 0EH, B= 99H
c) A = E99, B= 65H
d) A= 25H, B= E99
Correct Answer: b
Detailed Solution:
multiplies 25H * 65H =E99 where A = 99H, B = OEH
_____________________________________________________________________________
QUESTION 4:
Identify the operation performed by the following program
CLR A
MOV R1,#60H
MOV R7,#16
AGAIN: MOV @R1,A
INC R1
DJNZ R7,AGAIN
a) Clear 16 ROM locations starting at RAM address 60H
b) Clear 16 RAM locations starting at ROM address 60H
c) Increment the contents of memory locations (60H-75H) by one
d) Increment the contents of memory locations (60H-6FH) by one
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Correct Answer: a
Detailed Solution:
CLR A ;A=0
MOV R1,#60H ;load pointer. R1=60H
MOV R7,#16 ;load counter, R7=16
AGAIN: MOV @R1,A ;clear RAM R1 points to
INC R1 ;increment R1 pointer
DJNZ R7,AGAIN ;loop until counter=zero
option b is correct
QUESTION 5:
What is the content of the accumulator?
MOV A, #0100 1100B;
CPL A
a) 1011 0011B
b) 1100 0100B
c) 1011 0100B
d) 1100 0011B
Correct Answer: a
Detailed Solution:
QUESTION 6:
If SUBB A, R4 is executed, then actually what operation is being applied?
a) R4+A
b) R4-A
c) A-R4
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
d) A+R4
Correct Answer: C
Detailed Solution: SUBB command subtracts with borrow the contents of an accumulator
with that of the register or some immediate value. So, A-R4 is being executed.
QUESTION 7:
Which instructions have no effect on the flags of PSW?
a) ANL
b) ORL
c) XRL
d) All of the mentioned
Correct Answer: d
Detailed Solution:
These instructions are the arithmetic operations and the flags are affected by the
data copy instructions, so all these instructions don’t affect the bits of the flag.
______________________________________________________________________________
QUESTION 8:
XRL, ORL, ANL commands have _______
a) accumulator as the destination address and any register, memory or any immediate
data as the source address
b) accumulator as the destination address and any immediate data as the source
address
c) any register as the destination address and accumulator, memory or any immediate
data as the source address
d) any register as the destination address and any immediate data as the source
address
Correct Answer: a
Detailed Solution:
These commands have accumulator as the destination address and any register, memory or
any immediate data as the source address.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 9:
Calculate the jump code for again and here if code starts at 0000H
MOV R1,#0
MOV A,#0
MOV R0,#25H
AGAIN:ADD A,#0ECH
JNC HERE
HERE: INC R1
DJNZ R0,AGAIN
MOV R0,A
END
a) F3,02
b) F9,01
c) E9,01
d) E3,02
Correct Answer: c
Detailed Solution:
Loop address is calculated by subtracting destination address and the address next to the
source address.
So here if we start with 0000H
then source address is 0008H and the destination address is 0004H
So loop address is 04-0A=E9
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
______________________________________________________________________________
QUESTION 10:
Find the number of times the following loop will be executed
MOV R6,#200
BACK:MOV R5,#100
HERE:DJNZ R5, HERE
DJNZ R6,BACK
END
a) 100
b) 200
c) 2000
d) 20000
Correct Answer: d
Detailed Solution: It will be executed 200*100 times.
QUESTION 11:
In the instruction set,
MOV CX, BA03H
WAIT: DEC CX
NOP
JNZ WAIT
RET
a) 2 clock cycles
b) 8 clock cycles
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
c) 16 clock cycles
d) 64 clock cycles
Correct Answer: c
Detailed Solution:
The JNZ instruction takes 16 clock cycles if the zeroth condition is not satisfied.
QUESTION 12:
DAA command adds 6 to the nibble if?
a) CY and AC are necessarily 1
b) either CY or AC is 1
c) no relation with CY or AC
d) CY is 1
Correct Answer: b
Detailed Solution:
DAA command adds 6 to the nibble if any of the nibbles becomes greater than 9.
QUESTION 13:
Do the two instructions mean the same?
1) BACK: DEC R0
JZ BACK
2) BACK: DJNZ RO, BACK
a) Yes
b) No
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
c) Can’t be determined
d) yes, and the second one is preferred
Correct Answer: b
Detailed Solution:
In the first statement, when the decrements approach zero then the jump moves back and
in the second statement, when the result after decrements is not zero, then it jumps back.
QUESTION 14:
Which of the following comes under the indexed addressing mode?
a) MOVX A, @DPTR
b) MOVC @A+DPTR, A
c) MOV A, R0
d) MOV @R0, A
Correct Answer: b
Detailed Solution: Indexed addressing mode stands for that instruction where the bits of
the accumulator is also indexed with the 16-bit registers.
QUESTION 15:
The logical instruction that affects the carry flag during its execution is
a) XRL A
b) ANL A
c) ORL A
d) RLC A
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Correct Answer: d
Detailed Solution:
____________________________________________________________________________
************END*******