Saturday, 24 March 2018

How to print 1 to 9 using for loop in Assembly Language?

.MODEL SMALL
.STACK 100H
.CODE
MAIN PROC    ; output: 123456789
 
 
    MOV CX, 9
 
    LOOP:
    MOV AH,2
    MOV DL, 1
    ADD DL, 30H
 

    TOP:
    INT 21H
    INC DL
    LOOP TOP
   
    EXIT:
   
    MOV AH,4CH
    INT 21H
    MAIN ENDP
END MAIN

1 comment: