You are on page 1of 2

Assignment #1

Due Date: 15 Nov, 2021 till 4:00 PM

Note: A handwritten assignment must be submitted in my office before the due date and
time. Plagiarism will not be accepted in any case.

Q1: [10]
Dry run the following code and write down the updated value in variables and registers at
the END of program.
Note: Initially value in all register is zero.

[ORG 0x100]

MOV AH, [var1]


MOV BX, [var2]
ADD AX, BX
MOV [var3], AX
MOV CH, [var4]
MOV AX, [var5]
MOV BX, [var5+2]

MOV AX,0x4C00
int 21h

var1: db 0X10
var2: dw 0X20
var3: dw 0X20
var4: dw 0X40
var5: dd 0xABCD, EF56

Q2. [10]
Give the value of the zero flag, the carry flag, the sign flag, and the overflow flag after each
of the following instructions if AX is initialized with 0x1254 and BX is initialized with 0x0FFF.

a. add ax, 0xEDAB


b. sub ax, bx
c. add bx, 0xF001
d. sub bx,F=0xFFFA

Q3. [10]
Write a program that find the sum of numbers in between the range of maximum number
and the minimum number in an array of 10 elements.

For example:
Array: dw -22, 30,0, 20, -120, -10, -70,1000, 50, -100
Count: dw 778
Assignment #1
Due Date: 15 Nov, 2021 till 4:00 PM

Q4: [10]
Write a program to calculate the square of 20 by using a loop that adds 20 to the
accumulator 20 times.

Q5: [10]
Consider the following assembly program. What changes are made in the affected memory
locations after execution of following code? Draw the relevant memory locations.

Value of DS = 0xA000

MOV AX, [0XBCD0]


MOV BX, [0XBCD2]
ADD AX, BX
MOV [0XBCD4], AX

You might also like