Cat 2
Cat 2
.data
var1 dw 0
var2 dw 6
var3 db 5
a) Show whether the following MOV statements are legal or illegal, explain the illegal mov
instructions: (10 Marks)
i). mov ax,bx
ii). mov var2,al
iii). mov ax,bl
iv). mov bh,4A6Fh
v). mov dx,3
vi). mov var1,bx
vii). mov al,var3
viii). mov cs,0
ix). mov ip,ax
x). mov var1,var2
xi). mov ds,1000h
xii). mov ds,es
b) What will AX equal after the following instructions have executed? (4 Marks)
.code
mov ax, array1
inc ax
Add ah, 1
Sub ax, array1
.data
Array1 dw 10h, 20h
Array2 dw 30h, 40h
.data
c) What will be the hexadecimal value of the destination operand after each of the following
instructions execute in sequence? (2 Marks)
i). Mov al, var1
ii). Mov ah, [var1+3]
d) What will be the value of the destination operand after each of the following instructions
execute in sequence (2 Marks)
i). Mov ax,var2
ii). Mov ax, [var2+4]
iii). Mov ax, var3
iv). Mov ax, [var3-2]
e) Translate the following C++ expression to assembly language (2 Marks)
i). X(Y*4)+3
Instructions
1. Attempt all the questions. Show all your workings where applicable.
2. Work in a group of 3 students (Max). No individual assignments will be marked.
3. UPLOAD ON MOODLE a pdf version of your typed work (not images of handwritten
text) as per the scheduled deadline. No unnecessary extension will be granted to any
students.