Objective:
Using this simple code, we can easily print a string as we need.
Instruction:
M1 DB 'Maria',0DH,0AH,'$' -> This line instructs that need to print Maria
MOV CX,10 -> The name 'Maria ' will print for 10 times
Code:
.MODEL SMALL
.STACK 100H
.DATA
M1 DB 'Maria',0DH,0AH,'$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV CX,10
PRINT_LOOP:
MOV AH,9
LEA DX,M1
INT 21H
DEC CX
JNZ PRINT_LOOP
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
Using this simple code, we can easily print a string as we need.
Instruction:
M1 DB 'Maria',0DH,0AH,'$' -> This line instructs that need to print Maria
MOV CX,10 -> The name 'Maria ' will print for 10 times
Code:
.MODEL SMALL
.STACK 100H
.DATA
M1 DB 'Maria',0DH,0AH,'$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV CX,10
PRINT_LOOP:
MOV AH,9
LEA DX,M1
INT 21H
DEC CX
JNZ PRINT_LOOP
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
Thanks!!
ReplyDeleteI was really confused by the 0DH,0AH , where to put them , u saved my day , thank again:D
This comment has been removed by the author.
ReplyDeleteWow
ReplyDelete