[su_box title=”Bubble Sort” style=”bubbles” box_color=”#1d318d”]

org 100h
.data
n dw 15
nl db 0ah, 0dh, 024h

.code
mov cx, n
sub cx, 1

mov ah, 2
l1:
mov dl, ‘ ‘
int 21h
loop l1

mov dl, ‘*’
int 21h
mov ah, 9
lea dx, nl
int 21h

mov di, 1
mov bx, 1
xor cx,cx
mov cx, n
sub cx, 2
l2:

mov si, cx

sp1:
dec si
mov ah, 2
mov dl, ‘ ‘
int 21h
cmp si, 0
jg sp1

mov ah, 2
mov dl, ‘*’
int 21h

insp:
mov ah, 2
mov dl, ‘ ‘
int 21h
dec di
cmp di, 0
jg insp

mov ah, 2
mov dl, ‘*’
int 21h

add bx, 2
mov di, bx

mov ah, 9
lea dx, nl
int 21h
loop l2

xor cx, cx
mov bx, n
sub bx, 1
mov cx, n
add cx, bx
up:
mov ah, 2
mov dl, ‘*’
int 21h
loop up
ret

[/su_box]

Output Screen: 

Hollow Triangle in Assembly Language

 

 

 

" data-link="https://twitter.com/intent/tweet?text=Hollow+Triangle+Code+in+Assembly+Language&url=http%3A%2F%2Ftheencarta.com%2Fhollow-triangle-assembly-language%2F&via=">">Tweet
0 Shares

4 COMMENTS

  1. I haven’t checked in here for a while as I thought it was getting boring, but the last few posts are great quality so I guess I’ll add you back to my everyday bloglist. You deserve it my friend 🙂

LEAVE A REPLY

Please enter your comment!
Please enter your name here