[su_box title=”Hollow Triangle” style=”bubbles” box_color=”#1d318d”]

org 100h

; add your code here
.data
space db ” $”
exspc dw 8
inspc dw -1
row db 8
line db 0dh,0ah,”$”
.code

body:
mov cx,exspc ;printing external spaces
outer_space:
mov ah,2
mov dl,space
int 21h
loop outer_space

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

cmp row,8
je else:
mov cx,inspc ;printing internal spaces
inner_space:
mov ah,2
mov dl,space
int 21h
loop inner_space

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

else:
mov ah,9 ;line feed
lea dx,line
int 21h

cmp row,1
je full
jne one
full:
mov cx,17
print:
mov ah,2
mov dl,’*’
int 21h
loop print
jmp finish
one:

inc inspc
inc inspc
dec exspc
dec row

jmp body
finish:
ret

[/su_box]

 

OutPut Screen:

 

Find More Assembly Codes Here!

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

3 COMMENTS

  1. An attention-grabbing discussion is worth comment. I feel that you should write more on this subject, it might not be a taboo subject however usually persons are not enough to talk on such topics. To the next. Cheers

LEAVE A REPLY

Please enter your comment!
Please enter your name here