Microprocessor and Microcontroller Lab 2 | Read Now

Microprocessor and Microcontroller Lab 2

2] Design and develop an assembly program to sort a given set of ‘n’ 16- bit numbers in ascending order. Adopt bubble sort algorithm to sort given elements.

2] Program Code(las2.asm)

.model small
.stack 10
	org 01h
	a db 03h,01h,04h,02h
	count dw 04

mov ax,@data
mov ds,ax
mov bx,count
dec bx

outloop:mov cx,bx
	mov si,0

inloop:	mov al,a[si]
	inc si
	cmp al,a[si]
	jl down
	xchg al,a[si]
	mov a[si-1],al

down:	loop inloop
	dec bx
	jnz outloop

mov ah,4ch
int 21h

Leave a Reply

Your email address will not be published. Required fields are marked *

WhatsApp Icon Join For Job Alerts