Assignment 6 Solution
Assignment 6 Solution
Assignment 6 Solution
QUESTION 1:
INC and DEC will work as _____________ instructions?
a. Addition
b. Arithmetic
c. Logical
d. Transfer
Correct Answer: B
Detailed Solution:
QUESTION 2:
Which of the following instruction is equivalent to MOV A,#55h ?
a. MOV 0F0H,#55H
b. MOV 0E0H,#55H
c. MOV 0E0H,55H
d. MOV 0F0H,55H
Correct Answer: b
Detailed Solution:
The SFR ( Special Function Register ) can be accessed by their names or by their addresses
QUESTION 3:
Which of the following RAM locations are bit addressable?
a) 20H-2FH
b) 00H-0FH
c) 70H-7FH
d) 10H-1FH
Correct Answer: a
Detailed Solution:
RAM locations from 20H-2FH are both bit addressable and byte addressable, so option a is
correct
QUESTION 4:
What is the contents of the accumulator after execution of following instructions
mov a,#54h
swap a
RL a
a) 6DH
b) A8H
c) ABH
d) 8AH
Correct Answer: d
Detailed Solution:
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
swap a ; a = 45H
QUESTION 5:
Indicate which mode and which timer are selected for the following instruction.
MOV TMOD, #20H
a) mode 2 of timer 1 is selected
b) mode 2 of timer 0 is selected
c) mode 1 of timer 1 is selected
d) mode 1 of timer 0 is selected
Correct Answer: a
Detailed Solution:
QUESTION 6:
CLR A
MOV R1,#60H
MOV R7,#16
INC R1
DJNZ R7,AGAIN
Correct Answer: b
Detailed Solution:
CLR A ;A=0
QUESTION 7:
Which of the following is not a valid 8051 instruction?
a) INC DTPR
b) INC A
c) DEC DTPR
d) DEC A
Correct Answer: c
Detailed Solution:
QUESTION 8:
Detailed Solution: SUB 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 9:
Which of the following is a valid immediate addressing mode?
a) MOV A,R1
b) MOV 45h,A
c) MOV A, #42h
d) MOV DPTR,#68975h
Correct Answer: c
Detailed Solution:
In immediate addressing mode source operand is constant. But the value should be less than
FFFFH.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 10:
Which of the following statement is true after execution of MUL AB?
a) High-order byte of the result stored in B register when overflow flag is set to 1
b) carry flag is cleared to 0
c) Lower-order byte of the result stored in A
d) All of the above
Correct Answer: d
Detailed Solution:
QUESTION 11:
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 12:
What is the value of the bits 4-7 of R0 after the following set of instructions are executed?
MOV A, #11H
XCH A, R0
a) 0H
b) 1H
c) 4H
d) 5H
Correct Answer: b
Detailed Solution:
XCH: Exchanges bits 0-3 of the Accumulator with bits 0-3 of the Internal RAM address pointed
to indirectly by R0. Bits 4-7 of each register are unaffected.
QUESTION 13:
d) none
Correct Answer: c
Detailed Solution:
QUESTION 14:
Which of the following flags are affected by the instruction DIV AB of an 8051 microcontroller?
a) OV,C,AC
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
b) OV,AC
c) OV,C
d) C,AC
Correct Answer: C
Detailed Solution:
QUESTION 15:
1. Program Counter (PC) pushed to stack
Correct order of execution of action taken by 8051 micro-controllers when an interrupt occurs:
a) 3, 1, 4, 5, 2
b) 1, 2 , 4, 3, 5
c) 3, 4, 2, 5, 1
d) 1, 3 ,2 , 4, 5
Correct Answer: A
Detailed Solution:
************END*******