Mikki File
Mikki File
Submitted to:
Submitted by:
Yashika 102283033
Komal 102283043
TIET, Patiala
Index
SNo. TITLE Page
No.
1 Write an assembly language program to add two 16-bit numbers in 3
8086.
2 Write an assembly language program to add two 16-bit numbers in 4
8086.
3 Write an assembly language program to add two 16-bit 5
numbers in 8086.
4 Write an assembly language program to add two 16-bit 6
numbers in 8086.
5 Write an assembly language program to add two 16-bit 7
numbers in 8086.
6 Write an assembly language program to add two 16-bit 12
numbers in 8086.
7 Write an assembly language program to add two 16-bit 14
numbers in 8086.
8 Write an assembly language program to add two 16-bit 16
numbers in 8086.
9 Write an assembly language program to add two 16-bit 18
numbers in 8086.
10 Write an assembly language program to add two 16-bit 20
numbers in 8086.
2
Experiment 1
Q1) Write an assembly language program to
add two 16-bit numbers in 8086.
Ans) MOV AX,15H
MOV BX,15H
ADD AX,BX
HLT
OUTPUT:
Fig 1
3
Experiment 2
Q2) Write an assembly language program to
subtract two 16-bit numbers in 8086.
Ans) MOV AX,15H
MOV BX,10H
ADD AX,BX
HLT
OUTPUT:
Fig 2
4
Experiment 3
Q3) Write an assembly language program to
multiply two 16-bit numbers in 8086
Ans) MOV AX,[1001H]
MOV BX,[1003H]
MUL BX
HLT
OUTPUT:
5
Fig 3
6
Experiment 4
Q4) Write an assembly language program to divide two 16-bit numbers in 8086.
Ans) MOV AX,[1001H]
MOV BX,[1003H]
DIV BX
HLT
OUTPUT:
Fig 4
7
Experiment 5
Q5) Write an assembly language program to
demonstrate AAA, AAS, AAM, AAD, DAA
and DAS in 8086.
Ans) AAA Instruction
MOV AX,010FH
AAA
HLT
Fig 5.1
8
AAS Instruction:
MOV AX,020FH
AAS
HLT
Fig 5.2
AAM Instruction:
MOV AL,'3'
MOV BL,'9'
AND AL,0FH
9
AND BL,0FH
MUL BL
AAM
OR AX,3030H
Fig 5.3
AAD Instruction:
MOV AX,0207H
MOV BL,05H
AAD
DIV BL
10
Fig 5.4
DAA Instruction:
MOV AL,73H
ADD AL,45H
DAA
HLT
11
Fig 5.5
DAS Instruction:
MOV AL,81H
SUB AL,33H
DAS
HLT
12
Fig 5.6
Experiment 6
Q6) Write an assembly language program to
find out the count of positive numbers and
negative numbers from a series of signed
numbers in 8086.
Ans) MOV CL,0AH
MOV BL,00H
MOV DL,00H
13
SHL AL, 01
JNC L2
INC DL
JMP L3
L2: INC BL
L3: INC SI
DEC CL
JNZ L1
MOV [100AH], BL
MOV [100BH], DL
HLT
Output:
14
Fig 6
Experiment 7
Q7) Write an assembly language program to find out the largest number from a given
unordered array of 8-bit numbers, stored in the locations starting from a known address in
8086.
15
Ans) MOV CL, 0AH
L1: INC SI
CMP AL, BL
JC L2
JMPL3
JNZ L1
MOV [100AH], AL
HLT
Output:
16
Fig 7
Experiment 8
Q8) Write an assembly language program to convert the largest number from a given
unordered array of 16-bit numbers, stored in the locations starting from a known address
in 8086.
17
Ans) MOV BX, 1000H
INC BX
DEC CL
Back: INC BX
INC BX
JNC Next
MOV AX, [BX]
Next: DEC CL
JNZ Back
MOV [1020H],
AXHLT
18
Output:
Fig 8
Experiment 9
Q9) Write an assembly language program to print Fibonacci series in 8086.
19
Ans) MOV AL,00H
MOV SI,500H
MOV [SI],AL
ADD SI,01H
ADD AL,01H
MOV [SI],AL
MOV CX,[0000H]
SUB CX,0002H
L1:MOV AL,[SI-1]
ADD AL,[SI]
ADD SI,01H
MOV [SI],AL
LOOP L1
HLT
Output:
20
Fig 9.1
Fig 9.2
Fig 9.3
21
Experiment 10
Q10) Write an assembly language program to perform the division 15/6 using the ASCII codes.
Store the ASCII codes of the result in register DX.
Ans) MOV AX,"15"
MOV BX, "6"
AAD
DIV BH
ADD AX,3030H
MOV [SI], AX
HLT
Output:
Fig 10
22