0% found this document useful (0 votes)
39 views8 pages

Mpfe 20182 1

Uploaded by

youcef mokrane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views8 pages

Mpfe 20182 1

Uploaded by

youcef mokrane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Philadelphia University Student Name:

Student Number:
Faculty of Engineering Serial Number:

Final Exam, Second Semester: 2018/2019


Dept. of Computer Engineering
Course Title: Microprocessors Date: 01/06/2019
Course No: 0630313 Time Allowed: 2 hours
Lecturer: Dr. Qadri Hamarsheh No. Of Pages: 8

Instructions:
 ALLOWED: pens and drawing tools (no red color).
 NOT ALLOWED: Papers, calculators, literatures and any handouts. Otherwise, it will lead to the non-approval of your
examination.
 Shut down Telephones, and other communication devices.
Please note:
 This exam paper contains 5 questions totaling 40 marks.
 Write your name and your matriculation number on every page of the solution sheets.
 All solutions together with solution methods (explanatory statement) must be inserted in the labelled position on the
solution sheets.
 You can submit your exam after the first hour.

Basic notions: The aim of the questions in this part is to evaluate the required minimal student knowledge and skills. Answers in
the pass category represent the minimum understanding of IA-32 Processor Architecture, Assembly Language Fundamentals:
Instructions, Directives, Identifiers, Defining Data, Symbolic Constants, Data Transfers, Addressing, and Arithmetic instructions
Addressing Modes, Conditional and Unconditional instructions, Stack, Pointers, Interrupts, Arrays and Procedures.

Question 1 Multiple Choices (10 marks)


Identify the choice that best completes the statement or answers the question.
1) Which microprocessor accepts the program written for 8086 without any changes?
a) 8085 b) . 8087
c) 8088 d) None of the above

2) One of the following is not a valid segment address


a) 00000 b) E0840
c) 8CE90 d) 8CE91

3) Which group of instructions do not affect the flags?


a) Arithmetic operations b) Branch operations
c) Logic operations d) Data transfer operations

4) Which of the following will generate assembly error?


a) var1 BYTE 1101b, 22, 35
b) var3 BYTE '$','98778',
c) var2 BYTE "ABCDE", 18
d) None of the above

5) In the following data definition, assume that X2 begins at offset 4000h. What is the offset of the third
value (66)?
X2 DWORD 37, 49, 51, 66, 77
a) 4004h b) 4008
c) 400A d) 400C

1
6) _____________ can be used as indexed registers in real addressing mode.
a) BX, SI, DI
b) SI, DI, , DS
c) AX, SI, DI
d) AX, BX, CX

7) Which of the following is an illegal 8086 instruction?


a) add ax, [si] b) dec [si]
c) mov ax, [si] d) aDd bx, [si]

8) From hardware viewpoint, the overflow flag (OF) can be implemented using the following logic
expression:
a) OF = CF AND MSB
b) OF = CF OR MSB
c) OF = CF XOR MSB
d) None of the above

9) Assume that the AX register contains the value 6521 H. What will be the contents of AX after execution
the instruction:
CMP AL, AH
a) 65BC H b) BC21 H
c) 4421 H d) 6521 H

10) What will be the final value of ax?


mov ax, 6
mov ecx, 4
L1:
inc ax
loop L1
a) 11 b) 10
c) 9 d) None of the above

2
Familiar and Unfamiliar problems solving: the aim of the questions in this part is to evaluate that the student has some basic
knowledge of the key aspects of the lecture material and can attempt to solve familiar and unfamiliar problems of Assembly
Language Fundamentals: Instructions, Directives, Identifiers, Defining Data, Symbolic Constants, Data Transfers, Addressing,
and Arithmetic instructions Addressing Modes, Conditional and Unconditional instructions, Stack, Pointers, Interrupts, Arrays
and Procedures.
Question 2 (10 marks)
a) Explain the following terms: (1.5 marks)

Term Description

Virtual memory:

Real mode

Protected mode

b) Discuss the following assembler directives with examples (2.5 marks)


DWORD
OFFSET
ENDP
EQU
SIZEOF
Solution

3
c) Explain Memory Models that can be used in assembly language. (3.5 marks)

Solution

d) Explain the various types interrupts in 8086 microprocessor. (2.5 marks)


Solution

4
Question 3 (10 marks)

a) Use the following data declarations. (2 marks)


.Data
Goal Byte 1, 2, 3, 4
Mail DWord 12345678h, 34567890h
MailSize = lengthof Mail
Name Byte “Ahmed”, 0
Indicate whether or not each of the following assembly code is valid:

Ñ Instruction Answer

1) CMP AL, GOAL

2) Sub SS, MailSize

3) MOV [1234H] ,AX

4) xchg Goal, Name

b) Where indicated, write down the values of the Carry, Sign, Zero, and Overflow flags after each
instruction has executed: (2 marks)
mov ax, 7FF0h
add AL, 10h ; CF = -------- SF = -------- ZF = -------- OF = --------

add AH, 1 ; CF = -------- SF = -------- ZF = -------- OF = --------

add ax, 2 ; CF = -------- SF = -------- ZF = -------- OF = --------

c) Use the following data declarations. (2 marks)


X BYTE 10h,20h,30h,40h,50h, 60h, 70, 'a',0a
Y WORD 100h,200h,300h,400h
Z DWORD 10000h,20000h, 30000h, 40000h, 50000h, 60000h
Fill in the contents of the specified registers in the following code:
mov al,[ X +3] ; AL = --------

mov ax,[Y+2] ; AX = --------

mov eax,[Z+TYPE arrayD]; EAX = --------


mov esi,4
mov edx, Z [esi*TYPE Z]; edx = --------

5
d) What will be the final value stored in memory (SUM) after the execution of the following assembly
code (2 marks)
.DATA
NUMBERS SByte 3, -1, 4, 2, 5, 9, -2, -7
SUM SByte ?
.CODE
.STARTUP
MOV SI, OFFSET NUMBERS
MOV AX, 0H
MOV CX, 4
L1:
MOV BL, [SI]
ADD AL, BL
ADD SI, 2
LOOP L1
MOV SUM, AL
Solution

e) What exactly will be displayed by the following assembly program? (2 marks)


INCLUDE Irvine32.inc
.DATA
X DWORD 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
.CODE
MAIN PROC
mov eax, X
call WriteHex
call CrLf
mov eax, [X]
call WriteHex
call CrLf
mov esi, 8
mov eax, X [esi]
call WriteHex
call CrLf
mov esi, OFFSET X
mov eax, [esi]
call WriteHex
call CrLf
EXIT
MAIN ENDP
END MAIN
Solution

6
Question 4 (4 marks)
Write a complete assembly program that computes the following equations

In your code:
 Declare the following uninitialized variables:
 2-byte signed integers: Y, X1, X2 .
 2-byte unsigned integers: Z, X3, X4.
 Declare the constant symbolic C and assign it the value 200.
 In code section, assign variables X1=FFh, X2=-10, X3=555, X4 =100
 Compute and .
 Assume that real Addressing-mode is used.
 Use one segment for both code and data sections.

Solution

7
Question 5 (6 marks)
Write an Assembly Language program to compare two strings and display if they are equal.
The program should:
 Enter two strings (100 characters for each string) from keyboard.
 Display the message "Strings are equal" when the strings are equal and the message "Strings
are not equals" otherwise.
 Use Protected Mode Programming.
 Use Indirect Addressing Mode.
 Use Irvine32 library for input and output.

Solution

Good Luck
8

You might also like