Thanks to visit codestin.com
Credit goes to www.scribd.com

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

MPMC Exp-3

The document provides a manual for writing 8086 Assembly Language Programs (ALP) to perform various tasks such as adding a series of N numbers, finding the maximum and minimum numbers, and sorting given numbers in both ascending and descending order. Each section includes the aim, program code, input data, and expected output. The programs utilize basic assembly instructions and memory locations for data manipulation.

Uploaded by

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

MPMC Exp-3

The document provides a manual for writing 8086 Assembly Language Programs (ALP) to perform various tasks such as adding a series of N numbers, finding the maximum and minimum numbers, and sorting given numbers in both ascending and descending order. Each section includes the aim, program code, input data, and expected output. The programs utilize basic assembly instructions and memory locations for data manipulation.

Uploaded by

gundupranadeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

MP & MC LAB

MANUAL
3a. ADDITION OF N-NUMBERS

Aim: - Write an 8086 Assembly Language Program to add a series of N numbers.

Program:-
ASSUME CS:CODE
ORG 2000H
CODE SEGMENT
START: MOV AX,075AH
MOV DS,AX
MOV AX,0000H
MOV BX,0000H
MOV CX,0005H
MOV SI,2100H
L1: ADD AL,[SI]
JNC L2
INC BL
L2: INC SI
LOOP L1
MOV SI,2200H
MOV [SI],AL
INC SI
MOV [SI],BL
INT 03H
CODE ENDS
END START

Input:- Output:-
At location 075A: 2100, 98H At location 075A: 2200, 44H
075A: 2101, 52H 075A: 2201, 02H
075A: 2102, 75H
075A: 2103, 60H
075A: 2104, 85H
3b. FINDING THE MAXIMUM NUMBER

Aim:- Write an ALP in 8086 to find maximum number from the given numbers.

Program:-
ASSUME CS:CODE
CODE SEGMENT
START: MOV AX,0000H
MOV BX,0000H
MOV SI,2100H
MOV CX,0005H
MOV AL,[SI]
L1: INC SI
MOV BL,[SI]
CMP AL,BL
JNC L2
MOV AL,BL
L2: LOOP L1
INT 03
CODE ENDS
END START

Input:-

At location 075A: 2100H, 07H


075A: 2101H, 03H
075A: 2102H, 09H
075A: 2103H, 04H
075A: 2104H, 02H
075A: 2105H, 01H

Output: Result is in AL i.e., the maximum number AL = 09H


3c. FINDING THE MINIMUM NUMBER

Aim:- Write an ALP in 8086 to find minimum number from the given numbers.

Program:-
ASSUME CS:CODE
CODE SEGMENT
START: MOV AX,0000H
MOV BX,0000H
MOV SI,2100H
MOV CX,0005H
MOV AL,[SI]
L1: INC SI
MOV BL,[SI]
CMP AL,BL
JC L2
MOV AL,BL
L2: LOOP L1
INT 03
CODE ENDS
END START

Input:-
At location 075A: 2100H, 07H
075A: 2101H, 03H
075A: 2102H, 09H
075A: 2103H, 01H
075A: 2104H, 02H
075A: 2105H, 04H

Output: Result is in AL i.e., the minimum number AL = 01H


3d. SORTING OF GIVEN NUMBERS IN ASCENDING

Aim: - Write an ALP in 8086 to perform sorting of given numbers in ascending order.

Program:-

ASSUME CS:CODE
CODE SEGMENT
START: MOV SI,2100H
MOV AX,0000H
MOV CX,0005H
L1:PUSH CX
MOV SI,2100H
MOV CX,0005H
L2:MOV AL,[SI]
INC SI
MOV AH,[SI]
CMP AH,AL
JNC L3
MOV [SI],AL
DEC SI
MOV [SI],AH
INC SI
L3:LOOP L2
POP CX
LOOP L1
INT 03
CODE ENDS
END START

Input:- Output:-
At location 075A: 2100, 05H At location 075A: 2100, 01H
075A: 2101, 07H 075A: 2101, 03H
075A: 2102, 01H 075A: 2102, 04H
075A: 2103, 03H 075A: 2103, 05H
075A: 2104, 04H 075A: 2104, 07H
075A: 2105, 09H 075A: 2105, 09H
3e. SORTING OF GIVEN NUMBERS IN DESCENDING

Aim: - Write an ALP in 8086 to perform sorting of given numbers in descending order.

Program:-

ASSUME CS:CODE
CODE SEGMENT
START: MOV SI,2100H
MOV AX,0000H
MOV CX,0005H
L1:PUSH CX
MOV SI,2100H
MOV CX,0005H
L2:MOV AL,[SI]
INC SI
MOV AH,[SI]
CMP AH,AL
JC L3
MOV [SI],AL
DEC SI
MOV [SI],AH
INC SI
L3:LOOP L2
POP CX
LOOP L1
INT 03
CODE ENDS
END START

Input:- Output:-
At location 075A: 2100, 05H At location 075A: 2100, 09H
075A: 2101, 07H 075A: 2101, 07H
075A: 2102, 01H 075A: 2102, 05H
075A: 2103, 03H 075A: 2103, 04H
075A: 2104, 04H 075A: 2104, 03H
075A: 2105, 09H 075A: 2105, 01H

You might also like