Home | | Microprocessors and Microcontrollers | 8086 Microprocessor Modular programming

Chapter: Microprocessor and Microcontroller : 8086 Microprocessor

8086 Microprocessor Modular programming

1) ALP for Multiplication of two 32-bit numbers 2) ALP to Sort a set of unsigned integer numbers in ascending/ descending order using Bubble sort algorithm.


Modular programming


1) ALP for Multiplication of two 32-bit numbers

2) ALP to Sort a set of unsigned integer numbers in ascending/ descending order using Bubble sort algorithm.


ALP for Multiplication of two 32-bit numbers

DATA SEGMENT

MULD DW 0FFFFH, 0FFFFH

MULR DW 0FFFFH, 0FFFFH

RES DW 6 DUP (0)

DATA ENDS

ASSUME CS: CODE,DS: DATA

CODE SEGMENT

START: MOV AX, DATA

MOV DS, AX

MOV AX, MULD

MUL MULR

MOV RES, AX

MOV RES+2, DX

MOV AX, MULD+2

MUL MULR

ADD RES+2, AX

ADC RES+4, DX

MOV AX, MULD

MUL MULR+2

ADD RES+2, AX

ADC RES+4, DX

JNC K

INC RES+6

K: MOV AX, MULD+2

MUL MULR+2

ADD RES+4, AX

ADC RES+6, DX

MOV AH, 4CH

INT 21H

CODE ENDS

END START

 

ALP to Sort a set of unsigned integer numbers in ascending/ descending order using Bubble sort algorithm.

DATA SEGMENT

 

A DW 0005H, 0ABCDH, 5678H, 1234H, 0EFCDH, 45EFH

DATA ENDS

ASSUME CS: CODE, DS: DATA

CODE SEGMENT

START: MOV AX, DATA

 

MOV DS, AX MOV SI, 0000H MOV BX, A[SI]

DEC BX

 

X2: MOV CX, BX MOV SI, 02H

 

X1: MOV AX, A[SI]

INC SI

INC SI

CMP AX, A[SI]

XCHG AX, A[SI]

MOV A[SI-2], AX

X3: LOOP X1

DEC BX

JNZ X2

MOV AH, 4CH

INT 21H

CODE ENDS

END START


Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Microprocessor and Microcontroller : 8086 Microprocessor : 8086 Microprocessor Modular programming |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.