Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to print the digits 0, 1… 9

Posted By: Maya Hughes     Category: Assembly Language     Views: 40770

Write a program to print the digits 0, 1… 9.

Code for Program to print the digits 0, 1… 9 in Assembly Language

DATA SEGMENT
DATA ENDS
CODE SEGMENT
        ASSUME DS:DATA,CS:CODE
        START :
                MOV AX,DATA
                MOV DS,AX

        MOV BL,00H
        MOV CH,00H
        MOV CL,0AH
        
        
    L1   :  MOV DH,00H
        MOV DL,BL
        ADD DL,'0'
        MOV AH,02H
        INT 21H
        INC BL
        LOOP L1
    
                MOV AH,4CH
                INT 21H
CODE ENDS
        END START

;------
;OUTPUT
;------

;    0123456789
  
Share: 


Didn't find what you were looking for? Find more on Program to print the digits 0, 1… 9 Or get search suggestion and latest updates.

Maya Hughes
Maya Hughes author of Program to print the digits 0, 1… 9 is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Assembly Language:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Nomi Khan from United States Comment on: Nov 27
and how we will give space between the numbers as 0 1 2 3 4 5 6 7 8 9 ?

Nomi Khan from United States Comment on: Nov 27
And one more question , when we change the value of CL from 0A to 0C it gives output as 0123456789:;
why it gives colon and semicolon after 9 mean why it doesnt give 0123456789AB ?

Nomi Khan from United States Comment on: Nov 27
how we will print value 0 to 10?

View All Comments