a. [1 mark]
.data
?num1 WORD 1234h
.code
mov ax, ?num1
add ax, bx
What is wrong with above programme?
b. [2 marks]
Write assembly language code to declare a variable that duplicates the value "STACK" 5
times.
c. [4 marks]
Use the following data definitions to answer i - iv
val1 BYTE 20h
val2 WORD 3000h
val3 DWORD OFFFFh
i.
Write an instruction to negate val2
ii.
Write an instruction that increments val1
iii.
Write an instruction that subtracts val3 from eax
iv.
Write an instruction that subtracts 2FFFh from val2
d. [5 marks]
Translate the following expression into assembly language. Do not allow a, b, c or d to
be modified. (All values are signed double words)
d = b + (c + a)
e. [2 marks]
array1 BYTE 3, 10, 10h, 01001011b
array2 WORD 2 DUP (3 DUP (?))
i. Write assembly language code to compute the number of elements in array2.
ii. How many elements are in array2?