: 𝟐𝒏𝒅 Level
Republic of Yemen
Level
Al-janad University for Science & Technology
Semester : 𝟐𝒏𝒅 2019/2020
Faculty of Engineering and IT
Duration : 2 Hours
Dept. of Mechatronics Engineering
Lecturer : Eng. Ahmed AL-absy
Date
: 23/9/2020
MICROPROCESSOR LAB-FINAL EXAM
Q
ANSWER ONLY ABOUT FOUR QUESTIONS.
M
Choose the best answer for the following multiple-choice:
10
1.
The conditional branch instruction JNS performs the operations when if __.
A. SF = 0
2.
B. PF = 0
C. ZF = 0
D. CF = 0
In the following data definition, assume that Marks begins at offset 2100h. What is the offset of the value (77)?
Marks DW 88, 44, 55, 90, 77
Q1
A. 2104h
B. 2105h
3. Stack memory is maintained by two registers,
C. 2108h
A. BP, BI
C. CS, SP
4.
B. SS, SP
D. None of the above
D. AX, BX
What will be the contents of register AL after the following has been executed?
MOV BL, 8Ch
MOV AL, 7Eh
ADD AL, BL
A. AL = 0Ah, CF = 1
5.
B. AL = 6Ah, CF = 1
C. AL = 0Ah, CF = 0
D. AL = 6Ah, CF = 0
C. XOR
D. NOT
The instruction TEST is most similar to----------
A. AND
B. OR
Write the appropriate comments after each instructions.
10
.DATA
VAR1 DW 1000h
VAR2 DW 2000h
ARRAY1 DB 10h,20h,30h,40h,50h
ARRAY2 DW 100h,200h,300h
Q2
.CODE
MOV BL, 9Bh
MOV AX, BX
;AX=
..................................
XCHG AX, VAR1
;VAR1= ...................................
MOV AL, ARRAY1
;AL =
...................................
MOV AL, [ARRAY1+1]
;AL =
...................................
MOV AX, [ARRAY2+2]
;AX =
...................................
Use the following data definitions:
.DATA
Num1 DW 100
Num2 DB 225
Char1 DB 'Y'
Num3 DD 0, 10,30,40,50
Is the following instructions are legal (L) or illegal (I) ? If they are illegal say why and correct them?
10
Instruction
Q3
Legal/Illegal
Reason
Correction
MOV IP, Num1
XCHG AL, Num2
SUB Char1, 'A'
INC Num3, 1
MOV [BX], [SI]
ADD B1, B2
SUB 5, B1
Indicate the hexadecimal value of the destination operand and the flags values next to each instruction.
Registers
Instruction
Content
AX=0000h
Q4
Content
SUB AX, BX
AX=
AL=00h
DEC AL
AL=
AX=FFE0h
MUL 10h
AX=FFE0h
BX=8000h
Destination
BX=0003h
DX=FFFFh
AL= 11111100b
CF=1
DIV BX
PF
CF
OF
0
AX =
DX =
ROL AL, 6
AL=
RCR AL, 6
AL=
.DATA
0
AF
DX =
AL=
.Modle Small
SF
AX =
SHL AL, 6
# This is Final Assembly Exam
ZF
10
For the program in the left of this the box do
the following:
1- Find Mistakes in the Assembly code.
MSG1 DW 'Welcome to Assembly', 0
2MSG DB "This is The Final exam",'$'
ARRAY1 DB 3Bh, F5h, 6Dh, 'AB', 3Dup(?)
VAR1 DW 5Ah
$VAR DB 256
VAR2 DD 7FF0h
Q5
VAR3 DB ?
.CODE
MAIN:
MOV DS, @DATA
MOV AX, VAR2
MOV DX, VAR1
MOV IP, VAR2
MOV VAR3, 8Ah
MOV AH, 4C00h
INT 21h
END MAIN
2- Rewrite the program in a right way after
correcting mistakes.
10