[su_box title=”Generic Diamond” style=”bubbles” box_color=”#1d318d”]

org 100h

.data
A db 0
B db 0
C db 0ah
D db 0dh
countstr db 0
str db 1
space db 0

str1 db ‘Enter odd Diamond $’
str2 db ‘*’
spaces db ‘ ‘

.code
;Enter odd Diamond No
lea dx,str1
mov ah,9
int 21h

;Taking Number
mov ah,1
int 21h
;Saving in ‘a’
mov a,al
sub a,48
mov cl,a
;For Next Line
mov dl,c
mov ah,2
int 21h
mov dl,d
mov ah,2
int 21h

;For space find Line
mov al,a
mov bl,2
mov ah,0
div bl
mov space,al
mov countstr,al
inc countstr
inc countstr
inc countstr
inc countstr
inc space

mov cl,a
;loop of fuul diamond
full:
mov b,cl
;dec space

mov ch,0
mov cl,space

cmp space,0
Je cxd
;for printing spaces
spa:
mov dl,spaces
mov ah,2
int 21h
loop spa
;stars

mov cl,str
;star
star:
mov dl,str2
mov ah,2
int 21h
loop star

;For Next Line
mov dl,c
mov ah,2
int 21h
mov dl,d
mov ah,2
int 21h

;dec spacx
dec space

inc str
inc str

mov cl,b
loop full

cxd:

mov al,a
mov str,al
dec str
dec str

mov cl,b
inc space
inc space

full2:
mov b,cl

mov cl,space
;for printing spaces
spa1:
mov dl,spaces
mov ah,2
int 21h
loop spa1

cmp str,0
JLE exit1

mov cl,str
;Star
star1:
mov dl,str2
mov ah,2
int 21h
loop star1

;For Next Line
mov dl,c
mov ah,2
int 21h
mov dl,d
mov ah,2
int 21h
;
;
dec str
dec str
inc space
mov cl,b
loop full2

exit1:

ret

[/su_box]

 

OutPut Screen:

Generic Diamond Code

 

Find More Assembly Codes Here!

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

12 COMMENTS

  1. Cheap Discount Tadalis Sx 5mg Cialis Price [url=http://cialonlinecs.com]cialis generic[/url] Viagra Dapoxetine Avis Propecia Dose It Really Work Levitra 10 Mg Contraindicaciones

  2. Hi would you mind letting me know which webhost you’re
    utilizing? I’ve loaded your blog in 3 different web browsers and I must say this blog
    loads a lot faster then most. Can you suggest a good
    internet hosting provider at a fair price? Kudos, I appreciate it!

  3. Howdy exceptional website! Does running a blog like this require
    a massive amount work? I have no expertise in computer programming however I had
    been hoping to start my own blog in the near future.

    Anyhow, if you have any ideas or tips for new blog owners please share.
    I understand this is off subject nevertheless I simply needed to ask.
    Thanks a lot!

LEAVE A REPLY

Please enter your comment!
Please enter your name here