Q3:-
Print diamond shape in assembly?
;Title:Diamond pattern
org 100h
.model small
.data
space dw 11
star dw 1
space1 dw 5
star1 dw 13
.code
main proc
mov cx,7
outer:
mov bx,cx ;store
mov cx,space
k:
mov dl,32
mov ah,02
int 21h
loop k
dec space
mov cx,star
l:
mov dl,'*' ;3;5;7
mov ah,02
int 21h
loop l
inc star ;add space,2
inc star
mov dl,0Ah
mov ah,02
int 21h
mov dl,0Dh
mov ah,02
int 21h
mov cx,bx
loop outer
mov cx,7
outer1:
mov bx,cx ;store
mov cx,space1
j:
mov dl,32
mov ah,02
int 21h
loop j
inc space1
mov cx,star1
s:
mov dl,'*' ;3;5;7
mov ah,02
int 21h
loop s
dec star1 ;add space,2
dec star1
mov dl,0Ah
mov ah,02
int 21h
mov dl,0Dh
mov ah,02
int 21h
mov cx,bx
loop outer1:
ret
end main
endp