You are on page 1of 6

Birla Institute of Technology and Science Pilani, Hyderabad Campus

II Semester 2018-2019
CS/ECE/EEE/INSTR F241 2. The decoding logic (using absolute addressing) for an 8086 processor is
Microprocessor Programming and Interfacing shown below. This is the only decoding circuit in the computing system and the
Comprehensive Examination - Part B (Open Book) rest of the address lines are used with the memory chips.
Time: 90 min. Date: 01-05-2019 MM: 60
(Note: Write the answers in the space provided, else answers will NOT be
evaluated. Overwriting is NOT allowed).

ID No.: Faculty Copy Name: Faculty Copy

1. a) Change the sequence of instructions given below to multiply AX by (10) 10.


[4M]
1. MOV BX, AX
2. MOV CL, 2
3. SHL AX, 1
4. ADD AX, BX Answer the following questions
5. SHL AX, CL
a) How much memory does the system have? [1M]
Answer: Write the correct sequence in the given table.
Answer: 256K
3 1 2 5 4
b) How much of this memory is RAM? [1M]
b) Change the sequence of instructions given below to count the number of 1’s in a
Answer: 160K
byte and write the value of counts into BL register. [6M]
1. DATA1 DB 61H
c) What is the size of the RAM and ROM Chips used? [1M]
2. SUB BL, BL
3. AGAIN: ROL AL, 1 Answer: 16K
4. JNZ AGAIN
5. MOV DL, 8 d) What is the memory map (in Hex)? [3M]
6. INC BL
Memory Chip Starting address Ending address
7. NEXT: DEC DL
ROM2 88000 8FFFF
8. MOV AL, DATA1
9. JNC NEXT RAM3 A8000 AFFFF
10. INT 03H RAM4 B0000 B7FFF

Answer: Write the correct sequence in the given table. 3. Answer the following questions for 8086 microprocessor. [1 x 6 = 6 M]
1 2 5 8 3 9 6 7 4 10 a) How single stepping can be done in 8086 assembly language programs?
Answer: Set Trap Flag
c) The contents of different registers are given below.
DS = 2000H, SS = 5000H, BX = 4100H, SI = 1245H, DI = 4500H, BP= 3414H. b) Find the starting address (in Hex) at which CS corresponding to interrupt
The Physical address generated by the instruction MOV AX, [SI+BP+9] is vector INT 61H would be stored in memory.
__________ [2M]
Answer: 186H
Answer: 54662H
c) What is the size (in bytes) and opcode (in Hex) of interrupt instruction INT 3? 5. The below figure shows an 8255A interfaced with 8086 microprocessor. Perform
the following:
Answer: One, CCH a) Write an 8086 assembly language program to read the DIP switches and display
the readings
d) What instruction can be used to disable INTR input?
from Port B at Port A, and
Answer: CLI from Port CL at Port CU. [4 M]

e) Consider the occurrence of Type 2 interrupt NMI. In the Figure below, the
waveform shown is connected directly to the NMI pin of Intel 8086. At which Vcc
point 1 or 2 is the occurrence of the NMI interrupt recognized by Intel 8086? A7 PA7
A6 Buffer
A5
A4 PA0
CS
A3
A2 PC7
Buffer
Answer: Point 1 PC4
A1 A1
f) What is the starting address of IP for the interrupt that is generated using the A0 A0 8255A
PC3 .
following program? RD

MOV AX, F0F0H WR PC0 .


MOV BL, 06H
RESET
PB7 .
DIV BL
PB0 . DIP
Answer: 0000H Switch

Vcc
4. Complete the timing diagram of the memory read operation of 8086 in
maximum mode. [6M]
Answer: PORTA EQU 00FCH
PORTB EQU 00FDH
PORTC EQU 00FEH
CREG EQU 00FFH
MOV AL, 83H
OUT CREG, AL
IN AL, PORTB
OUT PORTA, AL
IN AL, PORTC
MOV CL, 04H
SHL AL,CL
OUT PORTC, AL
HLT
b) Write the addresses of all the ports and control register (In Hex). [2 M] c) Interface 8254 at an address 0040H for counter 0 and write assembly language
program to interrupt the processor after 10 ms using counter 1.The 8086 and 8254
Answer: run at 6MHz and 1.5 MHz respectively. [6 M]
Port A: 00FCH, Port B: 00FDH, Answer:
Port C: 00FEH, Creg: 00FFH

6. a) Is there a method to keep the OUT of any counter in 8254 to stay low for
infinite time? Explain with proper example and timing diagram indicating all the
signals. [3 M]

Answer:

b) Use 8254 to generate an interrupt every 1 sec for a 2MHz clock. Mention all your
assumptions clearly. Draw the design with all the necessary signals. [5 M]

Answer:

7. a) Determine the instruction from the opcode, assuming the processor is working
in 16-bit mode. [4 M]
(i) 88 B8 4B 06 H
Answer: MOV [BX+SI+64B], BH

(ii) A7 H
Answer: CMPSW
b) The data “BITSHYDERABAD” is stored at memory location starting from the
offset 1904H in DS and the data “MICROPROCESSOR” is stored at memory
location starting from the offset 1912H in ES. [2 M+ 2 M+ 2 M]
(i) Write an instruction to change the data in ES to “MACROPROCESSOR”, if SI=
190DH and DI=1913H. Assume auto-increment mode.
Answer: MOVSB

(ii) After performing the operation in part (i), if the following instructions are
executed, what are the contents of SI and DI. Assume the contents of AX are
FFEEH.
STD
STOSW

Answer: SI = 190EH, DI = 1912H

(iii) Which instruction can be used to check the equality of the data present in ES
and DS.
Answer: CMPSB
4 q-)
CLK
L-fl-
uunt down ot'P's
)
AoIt

oUf I
I

Yu, t^Je c-etm ku+ th e rur ol ^-d Counhr 's\


1bru tg\ GArt iry,^k lo* , d*'"fl lhe
lo,r, dor ;nh;b
bU

Cou,n| 6f guu''n v d;n '

ro a pilse e{eril ! c *''"1 n^ '^* dnc} '


iq obraLn ," 'S'e

that thDd'n\ be uoed i'D zxl,b' Bu'b' tlu


t\e (au't vilpe cou-nl t* '
vahe , 2o , ,6
't/, lo o *tr lut a l6'b& |

'Thu'alont'''wLneecllow)etwocouttferld'"dhba)'lolla'v'

Ccrxrtx L "n ;4* -- 7 ' Ck -- zUHzl Cout : J ot o o o

tn od.-o-&. f, flrt' , C ZSOH

gsrtfier& io urP'L = our L / clk:2nnHt]


L naln Cow$= 4o=
zBH
xtocle z

ctk O r',t*r) Sr, wQ W


C*"' f^t';*'-P t)
5D,ooo
x 40

ctk (z nlr Hz) . LY l oA 67""tlg


C^A'I LL'- dre m 1tff?-
o ttly ( clenircl o'rtlut )
: tl twter o
d c) Addru sl O0 011 + c'o

5 w>inl (ownterl'
9ntn,'"'Yf Al[e' lon U

8ob6 -+ bNHt-
8v5* + l'5MHr
.3
5f =tOXtq = t5ooo
o, 66lus t 3hrlgH

gsrtrol worQ *oH


"
r4 ov AL 1 +ot1
ouT tt6H t AL
3AqSH
F{ov AXr
ouf 42n &|
' AH
F{oV '\L'
ou1 AL
+LH
'