Sunday, 1 April 2018

Write a program to display a 10 x 10 solid box of asterisks. Hint: declare a string in the data segment that specifies the box, and display it using loop and level.

.MODEL SMALL
.STACK 100H 

.DATA
    SOLIDBOX  DB  '**********',0DH,0AH,'$'
 
.CODE
MAIN PROC                              ;PROC = Procedure

    MOV AX, @DATA                ; initialize DS
    MOV DS, AX 
   
    MOV CX, 10
   
    LOOP:
    MOV AH, 9
    LEA DX, SOLIDBOX
   
    TOP:
    INT 21H
    LOOP TOP
 
    EXIT:
    MOV AH, 4CH
    INT 21H
    MAIN ENDP
END MAIN

No comments:

Post a Comment