Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 28th, 2004, 12:23 PM   #1
lepricaun
Hobbyist Programmer
 
lepricaun's Avatar
 
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5 lepricaun is on a distinguished road
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
__________________
http://www.white-scorpion.nl
lepricaun is offline   Reply With Quote
Old Nov 28th, 2004, 1:12 PM   #2
Eggbert
Professional Programmer
 
Eggbert's Avatar
 
Join Date: Nov 2004
Posts: 250
Rep Power: 5 Eggbert is on a distinguished road
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.
Eggbert is offline   Reply With Quote
Old Nov 28th, 2004, 4:07 PM   #3
lepricaun
Hobbyist Programmer
 
lepricaun's Avatar
 
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5 lepricaun is on a distinguished road
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
__________________
http://www.white-scorpion.nl
lepricaun is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:14 PM.

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