Assignment 1 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

NPTEL Online Certification Course

Microprocessors and Interfacing


Assignment 1: Detailed Solution
Indian Institute of Technology Guwahati

Question-1: If [CS]=348AH, [IP]=4214H, then the 20-bit physical address from which the code is
accessed will be
(A) 455CAH (B) 0769EH (C) 390B4H (D) 38AB4H
Correct Answer: D
Detailed Solution: Effective address= Base address of CS register X 10H + Address of IP
= 348AH X 10H + 4214H
= 38AB4H

Question-2: Setting of direction flag in 8086 causes,


(A) The microprocessor to operate in single stepping mode
(B) The microprocessor to operate in break point mode
(C) The microprocessor string operations in auto increment mode
(D) The microprocessor string operations in auto decrement mode
Correct Answer: D
Detailed Solution: If directional flag is set (1), then the string data is accessed from higher memory location
towards lower memory location.

Question-3: In order to read a word from the memory location 5000AH in a single bus cycle, the status of
the 8086 signals A0 and BHE should be

(A) A0  0, BHE  0
(B) A0  0, BHE  1
(C) A0  1, BHE  0
(D) A0  1, BHE  1

Correct Answer: A
̅̅̅̅̅̅ = 0 is used as a memory enable signal
Detailed Solution: As a word is to be read from the memory, 𝐵𝐻𝐸
and the memory location 5000AH is even, A0 = 0 for even address.
NPTEL Online Certification Course
Microprocessors and Interfacing
Assignment 1: Detailed Solution
Indian Institute of Technology Guwahati

Question-4: If [BX]=0050H, [DS]=2000H, [00500H]=80H, [20050H]=08H, [CX]=5000H, then after


MOV CL,[BX] instruction is executed the contents of CX will be
(A)0050H (B)5008H (C) 5080H (D) 0008H
Correct Answer: B
Detailed Solution: [DS] X 10H + [BX]
= 20000H + 0050H

= 20050H

After the execution of MOV CL,[BX] which copies the contents of the memory at address
BX to CL, the contents of CX will be 5008H.

Question-5: Before the execution of POP instruction the stack pointer points to FFFFH. The contents of
the stack pointer after execution of POP instruction will be
(A) FFFFH (B) 0000H (C) 0001H (D) 0002H
Correct Answer: C
Detailed Solution: After the execution of POP instruction, the stack pointer is automatically incremented
by 2 to point to the next word on the stack.

Question-6: If [AL]=35H and [BL]=39H, after the execution of the following instructions
ADD AL, BL
AAA
the contents of AL will be

(A) 6EH (B) 3EH (C) 14H (D) 04H


Correct Answer: D
Detailed Solution: Numerical data coming into a computer from a terminal is usually in ASCII code. In this
code, the numbers 0 to 9 are represented by the ASCII codes 30H to 39H. The 8086 allows to add the
ASCII codes for two decimal digits without masking off the “3” in the upper nibble of each. After the
addition, the AAA instruction is used to make sure the result is the correct unpacked BCD.
If the addition produces a decimal carry (AF=1), the AH register is incremented and the carry (CF) and
auxiliary carry (AF) flags are set to 1. If the addition did not produce a decimal carry, CF and AF are
cleared to 0 and AH is not altered. In both cases, the high-order 4 bits of AL are cleared to 0.
NPTEL Online Certification Course
Microprocessors and Interfacing
Assignment 1: Detailed Solution
Indian Institute of Technology Guwahati

Question-7: Which of the following is unpacked BCD number


(A) 23 (B) 2B (C) 08 (D) 0A
Correct Answer: C
Detailed Solution: Unpacked BCD number contains only one decimal digit per byte. The digit is stored in
the least significant 4 bits and rest of the bits are 0.

Question-8: The WAIT instruction causes the 8086 to enter into ideal state until
(A) The LOCK pin is made LOW
(B) The LOCK pin is made HIGH
(C) The TEST pin is made LOW
(D) The TEST pin is made HIGH
Correct Answer: C
Detailed Solution: If the TEST pin is Low, execution continues otherwise the processor waits in an "idle"
state.

Question-9: If [AX]=009BH, after the execution of CBW instruction the contents of AX will be
(A) 009BH (B) FF9BH (C) 0000H (D) 9B9BH
Correct Answer: B
Detailed Solution: CBW converts the signed value in the AL register into an equivalent 16 bit signed value
in the AX register by duplicating the sign bit to the left. This instruction copies the sign (bit 7) in the source
operand into every bit in the AH register.

Question-10: Which of the following is not an 8086 maximum mode signal?

(A) LOCK (B) S0 (C) ALE (D) QS0

Correct Answer: C
Detailed Solution: ALE is a minimum mode signal.

You might also like