Generic Hollow Square

; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt

org 100h

.data
A db 0
B db 0
C db 0ah
D db 0dh

str1 db ‘Enter square No $’
str2 db ‘*’

.code
;Enter square 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 Line of *
;mov cx,5
label:
mov dx,’*’
mov ah,2
int 21h
loop label

;For * * Line
mov cl,a
sub cl,2
label1:
mov bx,cx

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

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

mov cl,a
sub cl,2
label2:
mov dx,’ ‘
mov ah,2
int 21h
loop label2

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

mov cx,bx
loop label1

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

mov cl,a
label4:
mov dx,’*’
mov ah,2
int 21h
loop label4

;mov a,al
;sub a,48
;mov cl,a
;mov dl,c
;mov ah,2
;int 21h
;mov dl,d
;mov ah,2
;int 21h
;lableouter:
;mov bl,cl
;mov cl,a
;label:
;mov dx,’*’
;mov ah,2
;int 21h
;loop label
;mov cl,bl
;mov dl,c
;mov ah,2
;int 21h
;mov dl,d
;mov ah,2
;int 21h
;loop lableouter
ret

OutPut Screen:

Generic Hollow Square Code

 

Find More Assembly Codes Here!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.