Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Assembly (http://www.programmingforums.org/forum20.html)
-   -   Printing Numbers To The Screen In 16-bit Asm (http://www.programmingforums.org/showthread.php?t=1315)

lepricaun Nov 28th, 2004 12:23 PM

hi all,

i'm having trouble printing numbers to the screen:

:


.model small
.stack
.data
.code

start:

mov ah,02h
mov dl, 48
int 21h

mov ax,4c00h
mov int 21h

end start

this code will print the character '0' to the screen, but how i can i let my code print the contents of dl (48) to the screen instead?

thanks in advance,

Kind regards

Eggbert Nov 28th, 2004 1:12 PM

In assembly language you can only print characters. What you need to do is convert the binary representation of 48 to it's character representation of '4' '8'. A web search would help you more than a quick solution, so I'll direct you to www.google.com. :)

lepricaun Nov 28th, 2004 4:07 PM

thanks for your reply, that's all i needed to know... i just hoped there was another way of printing them, but appearantly there isn't :(


All times are GMT -5. The time now is 2:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC