Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Print hexadecimal in Assembly

Posted on 2000-03-27
1
Medium Priority
?
1,438 Views
Last Modified: 2008-03-06
How to print on screen hexadecimal value in Assembly language?

E.g. if BX contains 55FFh how can it be printed on screen like "55FF"?
0
Comment
Question by:serg111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
balakrishnan_t earned 150 total points
ID: 2663079
There is no single command do this....u have to write toutines to do that... i hope u will understand the below given program...compile it and run it...u will get the answer....

Incase if u r not able to understand, make a comment , i can explain u

Program
*******

..model small
..386
..data
..code

Print_Char proc uses Ax
             Mov       Ah,02h
             Int       21h
             Ret
Print_Char  Endp                          

Print_Byte  proc uses Ax  Cx  Dx
             
         Mov       Ah,Al
         And       Ah,0f0h
         Mov       Cx,0004h
         Shr       Ah,Cl
         Cmp       Ah,09h
         Jbe        ll1
         Add       Ah,07h
ll1:     Add       Ah,30h
             Mov       Dl,Ah
             Call      Print_Char
             And       Al,0fh
             Cmp       Al,09h
             Jbe        ll2
             Add       Al,07h
ll2:       Add       Al,30h
             Mov       Dl,Al
             Call      Print_Char
             Ret
Print_Byte Endp            
             
Print_Ax proc  uses  Ax
         Push      Ax
             Mov       Al,Ah
             Call      Print_Byte
             Pop       Ax
             Call      Print_Byte
             Ret
Print_Ax  Endp            

start:
      mov bx,0a9ffh  
      mov ax,bx
      call print_ax
     
      mov  ah,4ch
      int 21h
end start      

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question