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

KING KHALID UNIVERSITY Subject: CPE 220

College of Computer Sciences Microprocessor and Interfacing


Date: 23 May 2015 Sections: 1019, 1020, 2679
5 Shaaban 1436 IF • Time: 01:00 — 03:00 PM
Subject Coordinator Rooms: 56/1/A, 57/1/A, 55/2/A
Knowledge area chairman: Total Marks : 50
Head of Department: Duration: 2h

— Final Exam / 2°d Semester, 1435/1436

Student Name: Student Id: Section•

Information for Candidates:


• This examination paper contains S questions totaling 50 marks.
• The marks for parts of questions are shown in round brackets.
Advice Candidates:
• You should answer all questions.
• You should write your answers clearly.

Question I: Fill up the missing word [5x 1=5 Marks]


1. The instruction move the contents of memory location 2000H to register BX.
2. The instruction XRI 8811

3. Each instruction is represent by an binary value

4. The contents of accumulator are copied into the I/O port 78H equivalent to

5. An is a concept that refers to a point of interaction between components, and is applicable at the level
of both hardware and software.

Question II: Choose the Correct Answer [5 x 1=5 Marks]


1. Stack Pointer register (SP) is used to

a) Hold the result of ALU operations c) Address the top of stack


b) Holds address of instruction being executed d) None of these

2. Number of the times the instruction sequence below will loop before coming out of loop is
MOV AL, 00h
Al: INC AL
JNZ Al
a) 00 b) 01 c) 255 d) 256
3. Check the contents of AL and six condition flags if register AL = 7Fh and the instruction ADD AL,1 is executed ?

a) AL = 80h, CY = 0, PF = 1, AF = 1, ZF = 1, SF= I c) AL = 80h, CY = 0, PF = 1, AF = 1, ZF = 1, SF = 1


b) AL = 80h, CY = 1, PF = 0, AF = 0, ZF = 0, SF= 1 d) AL= 80h, CY = 0, PF = 0, AF = 1, ZF = 0, SF= 1

1/4
4. What is the output of the following code
SI=10010011 10101101, CY=0
SHR SI, 1
a) 93ADH, CY=1, PF=1 b) 49D6H, CY=1, PF=1 c) 4D6CH, CY=1, PF=1 d) D1CCH, CY=1, PF=1

5. What is the output of the following code


BX=5CD3H, CL=8
ROL BX, CL

a) 0101110011010011, CY=0 c) 0110100010011101, CY=1


b) 1101001101011100, CY=0 d) 1011100110001100, CY=1

Question III: Definition/Write short notes [2+2+4+4+3=15 Marks]

1. Draw the schematic diagram of the Arithmetic and Logic Unit (ALU) of the 8085 microprocessor.

2. Explain the functions of the Bus Interface Unit (BIU) of the 8086 microprocessor.

3. Complete and explain the 8086 timing diagram for writing data to memory

CLK

ADDRESS

ADDRESS/DATA -
WR

4. State the different addressing mode for the 8086 microprocessor and give an example for the Direct addressing mode
and Register indirect addressing mode.

5. Assume that DS=10CFH, SS=1F49H, BX=2100H and BP=7000H. Show the exact physical memory location where
AX is stored in each of the following:

a) MOV [BX+12],AX
b) MOV [BP+13],AX
Question IV: Explain in detail [4 x 5=20 Marks]

1. If DS = IOCEH and the offset is F49DH,

(a) Calculate the physical address.


(b) Calculate the lower range of the data segment.
(c) Calculate the upper range of the data segment.
(d) Show the logical address.

2. Assume that the DS register is 549CH.

(a) Calculate the lower range of the data segment.


(b) Calculate the upper range of the data segment.
(c) Does the data segment cover the memory location of physical address 64F00?

2/4
3. Assuming that SP=8056H, AX=149FH, BX=1DE5H, and CX=410EH show the contents of the stack as each of the
following instructions is executed:

PUSH AX
PUSH BX
PUSH CX
SS:8056H FE FE FE FE
SS:8055H
SS:8054H
SS:8053H
SS:8052H
SS:8051H
SS:8050H

START After After After


PUSH AX PUSH BX PUSH CX
SP=8056H SP= SP= SP=

4. Write an Assembly Language Program that adds four words of data and saves the result. The values will be 234DH,
1DE6H, 3BC7H, and 566AH. Verify that the sum is D364.
Question V: Application/Problem solving [1 x 5=5 Marks]

1. In order to verify the status of eight switches numbered from 0 to 7 connected to the parallel PORT of the PC as
shown in Figure 1, their status is continually tested. '1' indicates that the switch is ON, '0' indicates that the switch
is OFF. We assume that only one switch can change state at a time.
In this exercise it is proposed to determine the number of the switch set to 1. For example, if the switches combination
is "00100000", the number will be 5.

a. Draw the corresponding flow chart


b. Write the corresponding 8086 Assembly Language Program.

vcc

854 2
10K
110 To the microprocessor
Toggle switches parallel PORT
U1
MI= 1A1 1Y1 18 D
1111111==1 1A2 1Y2 1 a
tcJ 1A3 1Y3 t
IMMIC=ZI 1A4 1Y4 1 a
11•111= 2A1 2Y1
2A2 2Y2 13
2A3 2Y3 u
2A4 2Y4 s
1G
• 2G
74ALS244

SEL

Figure 1.

3/4
,4

You might also like