answersLogoWhite

0


Best Answer

title ascending order using bubble sort

.model small

.stack 64

.data

a db 34h,78h,56h,47h

si_ze dw $-a ;si_ze=no of elements

.code

bubsort:

mov ax,@data

mov ds,ax

mov bx,si_ze

dec bx ;bx=no of passes needed to complete sorting(n-1)

outlup:

mov cx,bx ;cx=no of comparisions to be performed in a pass

mov si,0

inlup:

mov al,a[si]

inc si

cmp al,a[si]

jb go_on

xchg al,a[si]

mov a[si-1],al

go_on:

loop inlup ;dec cx,until cx=0

dec bx

jnz outlup

int 3 ;breakpoint interrupt

align 16

end bubsort

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

Data Segment

arr1 db 8,2,7,4,3 Data Ends Code Segment Assume cs:code, ds:data Begin: mov ax, data mov ds, ax mov es, ax mov bx, OFFSET arr1 mov cx, 5 mov dx, cx L1: mov si, 0 mov ax, si inc ax mov di, ax mov dx, cx L2: mov al, [bx][si] cmp al, [bx][di] jg L4 L3: inc si inc di dec dx cmp dx, 00 je L1 jg L2 L4: mov al, [bx][si] mov ah, [bx][di] mov [bx][si], ah mov [bx][di], al inc si inc di dec dx cmp dx, 00 je L1 jg L2 Exit: mov ax, 4c00h int

21h Code Ends End Begin

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write an assembly language program for arranging nos in the ascending order?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which program translate assembly language into machine language?

Assembly langue is translated into machine language by an assembler.


A program for assembly language for traffic light control?

an assembly language program of traffic light


What is assembly program?

An assembly program is a machine-dependent program written in a low-level symbolic code known as assembly language.


Reserved word in assembly language program?

use of reserved word in assembly language


Example of Password program code in assembly language?

How to write the program un Assembly language to set a password for personal computers?


Write an Assembly language program which implements sorting algorithm both ascending and descending order and display those numbers with certain delay say of 5sec between successive displays?

das


Assembly language program for string concatenation using 8086 microprocessor?

write program to concatenating two sting in 8086 assembly language


Write a program in 8086 assembly language to draw a circle?

You need an 8086 assembly language pencil.


What translation programs converts assembly language programs to object program?

The only translation program that converts assembly language to machine code is an assembler.


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


What application will be used to convert an assembly language source program into machine language?

An Assembler converts assembly language instructions into machine language.


How is a calculator created with an assembly language program?

programaticly