Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

8086 Lab File

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

MICROPROCESSORS BASED SYSTEMS DESIGN

(UCS617)

8086 LAB ASSIGNMENT

Submitted By:

Kanav Kant 101803021


Kashish Tayal 101803022
Ishaan Takkar 101803025
Shaurya Vats 101803588

Submitted To:
Ms. Swati Sharma

Thapar Institute Of Engineering & Technology


Patiala-147001
S no. Description Page
no.
1. Write an assembly language program to add two 16-bit numbers in 3
8086.
2. Write an assembly language program to subtract two 16-bit numbers in 3
8086.
3. Write an assembly language program to multiply two 16-bit numbers in 4
8086.
4. Write an assembly language program to divide two 16-bit numbers in 4
8086.
5. Write an assembly language program to demonstrate AAA, AAS, 5
AAM, AAD, DAA and DAS in 8086.
6. Write an assembly language program to find out the count of positive 8
numbers and negative numbers from a series of signed numbers in
8086.
7. Write an assembly language program to convert to find out the largest 9
number from a given unordered array of 8-bit numbers, stored in the
locations starting from a known address in 8086.
8. Write an assembly language program to convert to find out the largest 10
number from a given unordered array of 16-bit numbers, stored in the
locations starting from a known address in 8086.
9. Write an assembly language program to print Fibonacci series in 8086. 11
10. Write an assembly language program to perform the division 15/6 using 12
the ASCII codes. Store the ASCII codes of the result in register DX.

2|Page
1. Write an assembly language program to add two 16-bit numbers in 8086.

MOV AX, 0001h


MOV BX, 0002h
ADD AX, BX
HLT

2. Write an assembly language program to subtract two 16-bit numbers in 8086.

MOV AX,1234H
MOV BX,1236H
SUB AX,BX
HLT
3. Write an assembly language program to multiply two 16-bit numbers in
8086. MOV AX, 1234H
MOV BX, 45F4H
MUL BX

4. Write an assembly language program to divide two 16-bit numbers in


8086. MOV AX,800AH
MOV BX,1856H
DIV BX
MOV [700H],AX
HLT
5. Write an assembly language program to demonstrate AAA, AAS,
AAM, AAD, DAA and DAS in 8086.

i. AAA
MOV AL,'9'
ADD AL,'2'
AAA
MOV [100H],AX
HLT

ii. AAS
MOV AX,39H ; Load ASCII 9
SUB AL,31H ; Subtract ASCII 1
AAS ; Adjust difference ADD
AX,3030H ; Answer in ASCII
iii. AAM

MOV AL, 05H


MOV BL, 09H
MUL BL
AAM
MOV [100H], AX
HLT
iv. AAD
MOV BL, 09H
MOV AX,0607H
AAD
DIV BL

v. DDA
MOV AL,9H
ADD AL,1H
DAA
MOV [100H],AX
HLT
vi. DAS
MOV AL,45H
SUB AL,27H
DAS
MOV [100H],AX
HLT

6. Write an assembly language program to find out the count of positive


numbers and negative numbers from a series of signed numbers in
8086.

MOV CL, 0AH


MOV BL, 00H
MOV DL, 00H
LEA SI,[1000H]
L1: MOV AL,
[SI] 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

7. Write an assembly language program to convert 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.

MOV CL, 0AH


LEA SI, [1000H]
MOV AL, [SI]
L1: INC SI
MOV BL, [SI]
CMP AL, BL
JC L2
JMP L3
L2: MOV AL,
BL L3: DEC CL
JNZ L1
MOV [100AH], AL
HLT
8. Write an assembly language program to convert to find out the largest
number from a given unordered array of 16-bit numbers, stored in the locations
starting from a known address in 8086.

LEA SI, [1200H]


MOV CL,[SI]
INC SI
MOV AL,
[SI] DEC CL
L2: INC SI
CMP AL,[SI]
JNB L1
MOV AL,
[SI] L1: DEC
CL JNZ L2
MOV DI,1300H
MOV [DI] , AL
HLT
9. Write an assembly language program to print Fibonacci series
in 8086. ANS.

LEA SI,[100H]
MOV CL,07H ; Load the count value for CL for looping
MOV AX,00H
MOV BX,01H
L1: ADD
AX,BX MOV
[SI],AX MOV
AX,BX MOV BX,
[SI]
INC SI
LOOP L1
HLT
10. 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.

MOV AX,'15'
ADD BX,'6'
SUB AX,3030H
SUB BL,30H
AAD
DIV BL
ADD AX,3030H
MOV
[100H],AX HLT

You might also like