0% found this document useful (0 votes)
139 views4 pages

MP20171 2

This document contains instructions and questions for a computer engineering exam on microprocessors. It is divided into two sections: The first section contains 5 multiple choice questions testing basic assembly language concepts like instructions, addressing modes, and arithmetic operations. The second section contains 3 programming questions: 2 ask the student to analyze code snippets and explain outputs; the other asks the student to write code to transfer an array of data bytes from one memory location to another using indirect addressing. It also asks the student to write a program that displays a string in 4 different colors using a procedure from the Irvine library.

Uploaded by

Sara Almetwally
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)
139 views4 pages

MP20171 2

This document contains instructions and questions for a computer engineering exam on microprocessors. It is divided into two sections: The first section contains 5 multiple choice questions testing basic assembly language concepts like instructions, addressing modes, and arithmetic operations. The second section contains 3 programming questions: 2 ask the student to analyze code snippets and explain outputs; the other asks the student to write code to transfer an array of data bytes from one memory location to another using indirect addressing. It also asks the student to write a program that displays a string in 4 different colors using a procedure from the Irvine library.

Uploaded by

Sara Almetwally
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/ 4

Philadelphia University Student Name:

Student Number:
Faculty of Engineering Serial Number:

Second Exam, First Semester: 2017/2018


Dept. of Computer Engineering
Course Title: Microprocessors Date: 27/12/2017
Course No: 0630313 Time Allowed: 50 minutes
Lecturer: Dr. Qadri Hamarsheh No. Of Pages: 4

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 4 questions totaling 20 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 and Familiar: 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 Assembly Language Fundamentals: Instructions,
Directives, Addressing Modes, and Conditional and Unconditional instructions, Pointers, and Arrays.

Question 1 Multiple Choices (5 marks)

Identify the choice that best completes the statement or answers the question.
1) Assume that the AX register contains the value 6521 H. What will be the contents of AX after
execution the instruction:
SUB AL, AH
a) 65BC H c) BC21 H
b) 4421 H d) 6544 H
2) Which of the following is an illegal 8086 instruction?
a) add ax, [cx] c) inc [si]
b) mov ax, [bx] d) aDd bx, [dx]
3) Let W be an array of Words, one of the following is a correct code to set the fifth element in W to
100.
a) mov [W+10], 100
b) mov [W+2*4], 100
c) mov [W+5], 100
d) None of the above
4) What does the NOT instruction do?
a) Two’s Complement b) One’s Complement
5) What will be the contents of register AL after the following has been executed
MOV BX, F78Ch
MOV AL, 7Eh
ADD AL, BL
a) 6A and carry flag is set c) 0A and carry flag is set
b) 6A and carry flag is reset d) 0A and carry flag is reset

1
Question 2 (8 marks)
a) Indicate which of the following instructions is wrong and state the reason. (3 marks)
Instruction answer Reason
INC CX, 2

SUB DS, 3H

MOV [1234H] , AX

add [esi+offset x], al

CMP DX

ADD [BX], 3H

b) 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

2
c) Write down the value of each destination operand if the instruction is correct; assume that the offset
of the x1 is 0000. (3 marks)
.data
x1label LABEL WORD
x1 BYTE 79h,25h,02h,05h
x2 WORD 7654h,1203h
x3 DWORD 12345678h
.code
mov ax, x1label; ax = ------------
mov ax, WORD PTR [x1 +2] ; ax = ------------
mov bl, BYTE PTR x3; bl = ------------
mov bl, BYTE PTR [x2 +2] ; bl = ------------
mov ax, WORD PTR [x3 +2] ; ax = ------------
mov eax, DWORD PTR x2; eax = ------------
mov cx, offset x1 +3 ; cx = ------------
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, Addressing Modes, Conditional and Unconditional instructions, Stack,
Pointers, Arrays and Procedures.

Question 3 (3 marks)

The 8 data bytes are stored from memory location E000H to E007H. Write 8086 Assembly Language code
to transfer the block of data to new location B001H to B008H using indirect addressing.

Solution

3
Question 4 (4 marks)

Write a program that displays a string "This line is displayed in color" in four different colors, using
the SetTextColor procedure from the Irvine library. (Any colors may be chosen)

Solution

Good Luck
4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy