0% found this document useful (0 votes)
2 views21 pages

Assignment1 Microprocessor8086

The document provides a series of assembly language programs for the 8086 microprocessor, demonstrating basic arithmetic operations (addition, subtraction, multiplication, division) as well as advanced operations like AAA, AAS, AAM, AAD, DAA, and DAS. It also includes programs to count positive and negative numbers, find the largest number in arrays of both 8-bit and 16-bit numbers, print the Fibonacci series, and perform division using ASCII codes. Each program is accompanied by specific assembly instructions and concludes with a halt command.

Uploaded by

sharonlal.spc
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views21 pages

Assignment1 Microprocessor8086

The document provides a series of assembly language programs for the 8086 microprocessor, demonstrating basic arithmetic operations (addition, subtraction, multiplication, division) as well as advanced operations like AAA, AAS, AAM, AAD, DAA, and DAS. It also includes programs to count positive and negative numbers, find the largest number in arrays of both 8-bit and 16-bit numbers, print the Fibonacci series, and perform division using ASCII codes. Each program is accompanied by specific assembly instructions and concludes with a halt command.

Uploaded by

sharonlal.spc
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

ASSIGNMENT 1

8086 Microprocessor
1. Add two 16 bit numbers in 8086 microprocessor

MOV AX,3719H
MOV BX,7089H
ADD AX,BX
HLT ; halt!
2. Subtract two 16 bit numbers in 8086 microprocessor

MOV BX,3719H
MOV AX,7089H
SUB AX,BX
HLT ; halt!
3. Multiply two 16 bit numbers in 8086 microprocessor

MOV AX,1234H
MOV BX,5678H
MUL BX
HLT ; halt!
4. Divide two 16 bits numbers

MOV BX,1234H
MOV AX,5678H
DIV BX
HLT ; halt!
5. to demonstrate AAA, AAS, AAM, AAD, DAA and DAS in
8086.
a. AAA
SUB AH,AH
MOV AL,'6'
ADD AL,'7'
AAA
OR AL,30H
HLT ; halt!
b. AAS

SUB AH,AH
MOV AL,'3'
SUB AL,'9'
AAS
OR AL,30H
HLT ; halt!

c. AAM
MOV AL,'3'
MOV BL,'9'
AND AL,0FH
AND BL,0FH
MUL BL
AAM
OR AL,30H
HLT ; halt!

d. AAD
MOV AX,'15'
MOV BH,'6'
SUB AX,3030H
SUB BH,30H
AAD
DIV BH
ADD AX,3030H
MOV DX,AX
HLT ; halt!

e. DAA
MOV AL,71H
ADD AL,43H
DAA
HLT ; halt!

f. DAS
MOV AL,71H
SUB AL,43H
DAS
HLT ; halt!

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 ; halt!
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 ; halt!
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.
MOV BX,1000H
MOV CL,[BX]
INC BX
MOV AX,[BX]
DEC CL
BACK:INC BX
INC BX
CMP AX,[BX]
JNC Next
MOV AX,[BX]
Next:DEC CL
JNZ BACK
MOV [1020H],AX
HLT ; halt!
9. Write an assembly language program to print Fibonacci
series in 8086.
MOV SI,3000H
MOV CX,0AH
XOR AL,AL
MOV [SI],0AH
INC SI
MOV [SI],00H
ADD AL,01H
INC SI
MOV [SI],00H
INC SI
MOV [SI],AL
Back:ADD AL,[SI]
INC SI
MOV [SI],AL
DEC SI
MOV AL,[SI]
INC SI
LOOP Back
HLT ; halt!
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'
MOV BH,'6'
SUB AX,3030H
SUB AH,30H
AAD
DIV BH
ADD AX,3030H
MOV DX,AX
HLT ; halt!

You might also like