SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 151 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2.  .STACK 100H
  3.  
  4.  .DATA
  5.     PROMPT  DB  ' Displaying numbers from 0 to 9 is : $'
  6.  
  7.  .CODE
  8.    MAIN PROC
  9.      MOV AX, @DATA                ; initialize DS
  10.      MOV DS, AX
  11.  
  12.      LEA DX, PROMPT               ; load and print PROMPT
  13.      MOV AH, 9
  14.      INT 21H
  15.  
  16.      MOV CX, 10                   ; initialize CX
  17.  
  18.      MOV AH, 2                    ; set output function  
  19.      MOV DL, 48                   ; set DL with 0
  20.  
  21.      @LOOP:                       ; loop label
  22.        INT 21H                    ; print character
  23.  
  24.        INC DL                     ; increment DL to next ASCII character
  25.        DEC CX                     ; decrement CX
  26.      JNZ @LOOP                    ; jump to label @LOOP if CX is 0
  27.  
  28.      MOV AH, 4CH                  ; return control to DOS
  29.      INT 21H
  30.    MAIN ENDP
  31.  END MAIN
  32.  
  33.  ;**************************************************************************;
  34.  ;**************************************************************************;
  35.  ;------------------------------  THE END  ---------------------------------;
  36.  ;**************************************************************************;
  37.  ;**************************************************************************;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top