MS Fe20172 1

You might also like

You are on page 1of 4

Philadelphia University

Faculty of Engineering

Marking Scheme

Examination Paper
Department of CE

Module: Microprocessors (630313)

First Exam Second Semester Date: 29/03/2018


Section 1
Weighting 20% of the module total

Lecturer: Dr. Qadri Hamarsheh


Coordinator: Dr. Qadri Hamarsheh
Internal Examiner: Dr. Nasser Halasa
Marking Scheme
Microprocessors (630371)
The presented exam questions are organized to overcome course material, the exam contains 4 questions; all
questions are compulsory requested to be answered. Thus, the student is permitted to answer any question out
of the existing ones in this section.
Marking Assignments
The following scheme shows the marks assignments for each question. They show also the steps for which a
student can get marks along the related procedure he/she achieves.
Question 1This question is attributed with 30 points if answered properly
The answer for this question as the following:
1) The first processor that includes pipeline mechanism in the Intel microprocessor family was ------
a) 8085 c) 80286
b) 8086 d) 80386
2) The physical address of the stack is obtained by
a) SS:SI combination c) SS:SP combination
b) ES:BP combination d) ES:SP combination
3) If CS = 0701H, SS = 0801H, SI = 0100H and IP = 0108H the address of the next instruction is:
a) 07090H c) 07110H
b) 07811H d) 07118H
4) An assembly language program is translated to machine code by
a) an assembler c) a compiler
b) an interpreter d) a linker
5) The following is a valid data definition statement:
helloStr WORD 10000h,20000h
a) True b) False
6) In the following data definition, assume that Std begins at offset 2002h. What is the offset of the second
value (6)?
Std DWORD 1,6,5,8,9
a) 2004h b) 200Ah
c) 2006h d) 2008h
Question 2This question is attributed with 35 points if answered properly
The answer for this question as the following:
a) (15 points)
 Steps in a typical read cycle:
1. Read the address of the location.
2. Activate the read signal (control signal).
3. Wait for the memory to retrieve the data.
4. Read the data from the data bus.
5. Drop the memory read control signal to terminate the read cycle. (7.5 points)
 Steps in a typical write cycle:
1. Place the address of the location to be written on the address bus.
2. Place the data to be written on the data bus.
3. Activate the write signal.
4. Wait for the memory to store data.
5. Drop the write signal. (7.5 points)
b) (20 points)
Registers of Microprocessor 8086

(5 points)
AX is used for the accumulator because it is favored by the CPU for arithmetic operations.
Index registers:
BP (Base Pointer): the BP register contain an assumed offset from the stack segment register, as does
the stack pointer.
SP (Stack Pointer): the stack pointer register contain the offset of the top of the stack. The stack pointer
and the stack segment register combine to form the complete address of the top of the stack.
SI (Source Index): This register takes its name from the string movement instruction
DI (Destination Index): the DI register acts as the destination for string movement instruction.
IP (Instruction Pointer): The instruction pointer register always contain the offset of the next
instruction to be executed within the current code segment. The instruction pointer and the code
segment register combine to form the complete address of the next instruction. (6 points)
Flag Registers and bit fields (9 points)

 CF, the Carry Flag: This flag is set whenever there is a carry out, either from d7 after an 8-bit
operation or from d15 after a 16-bit data operation..
 PF, the Parity Flag: This flag is used by the OS to verify memory integrity and by communication
software to verify the correct transmission of data.
 AF, the Auxiliary Carry Flag: If there is a carry from d3 to d4
 ZF, the Zero Flag: The ZF is set to 1 if the result of the arithmetic or logical operation is zero;
otherwise, it is cleared (set to 0).
 SF, the Sign Flag: MSB is used as the sign bit of the binary representation of the signed numbers.
After arithmetic or logical operations the MSB is copied into SF to indicate the sign of the result. The
flag values 1=negative, 0 = positive
 OF, the Overflow Flag: This flag is set whenever the result of a signed number operation is too large,
causing the high-order bit to overflow into the sign bit. The flag values 1 = overflow, 0 = no overflow.
 TF, the Trap Flag: When this flag is set it allows the program to single step, meaning to execute one
instruction at a time. Used for debugging purposes. The flag values are 1 = on, 0 = off.
 IF, Interrupt Enable Flag: This bit is set or cleared to enable or disable only the external interrupt.
 DF, the Direction Flag: This bit is used to control the direction of the string operations and used for
block data transfer instructions, such as MOVS, CMPS, SCAS, it selects increment or decrement mode for
the DI and/or SI registers.
Question 3 This question is attributed with 15 points, if answered properly. The answer for this question as the
following:
a) declare an array named Y of 10 signed double words initialized to 1, 2, ..., 10.
Solution

Y SDWORD 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

b) declare a Null-terminated string named prompt_msg with a message “Enter Your Password”
Solution

prompt_msg Byte " Enter Your Password: ",0

c) Declare an uninitialized word labeled “Num”.


Solution

Num WORD ?

d) Declare 4-bytes array named Marks of 100 numbers, all initialized to 0.


Solution

Marks DD 100 DUP(0)

e) Declare a string variable named SysInfo containing the word “TEST” repeated 500 times.
Solution

SysInfo Byte 500 DUP(“TEST”)

Question 4 This question is attributed with 20 points, if answered properly. The complete code as the
following:
Solution
TITLE Calculate equation (Calculate.asm)
;Description: program that implements the following arithmetic expression:
;𝑹𝒆𝒔𝒖𝒍𝒕 = 𝐓𝐞𝐦𝐩𝐫𝐚𝐭𝐮𝐫𝐞𝟏 + 𝐓𝐞𝐦𝐩𝐫𝐚𝐭𝐮𝐫𝐞𝟐 + 𝟕 − 𝐓𝐞𝐦𝐩𝐫𝐚𝐭𝐮𝐫𝐞𝟑
;Last update: 29/03/2018
INCLUDE Irvine32.inc
.stack 1024h (5 points)
.data
Temprature1 SDWORD 45
Temprature2 SDWORD 20
Temprature3 SDWORD -30
Result SDWORD ? (5 points)
.code
main PROC
mov eax, Temprature1
add eax, Temprature2
add eax,7
sub eax, Temprature3
mov Result, eax
call DumpRegs
exit
main ENDP
END main (10 points)

You might also like