You are on page 1of 3

COAL

ASSIGNMENT - # 3

Name : Shaheer Jalil

Program : BSCS

Section : 3-C

SAP ID : 70077813

Submission Date : 12/12/2020

Submitted To : Miss Saher


1. Write, run and analyze the result of a program that performs the following.
Assume byte1=230, word1=9980, word2=300, double-word= 456400 (2
marks)
a. Word1/byte1
b. Word1*word2

(a)
.model small
.data
quotient db ?
remainder db ?

.code
main proc far
mov ax, 9980h
mov bl, 230
div bl
mov quotient, al
mov remainder, ah

endp
end main

(b)
.model small
.data
data_1 dw 9980h
data_2 dw 300h
result dw ?

.code
main proc far
mov ax, data_1
mul data_2
mov result, ax
mov result+2, dx

endp
end main
2. Which of the following code performs the same operations as LOOP. (2 marks)
a. Dec CH
JNZ XXX
b. DEC CX
JNZ XXX

Answer:

The code that performs the same operation as LOOP is:


(b) DEC CX
JNZ XXX

3. What is the value of BH after the following? (2 marks)

SUB BH, BH
STC
RCR BH, 1
STC
RCR BH, 1

Answer:

The value of BH after the code will be:


BH C0H

4. Match the following instructions mnemonic with its function. (4 marks)


________ DAA a) ASCII addition
________ DAS b) ASCII subtraction
________ AAS c) BCD subtraction
________AAA d) BCD addition

Solution:

DAA__BCD addition
DAS__BCD subtraction
AAS__ASCII subtraction
AAA__ASCII addition

You might also like