title: How do I print an integer in Assembly Level Programming without printf from the c library?
body: <p>Can anyone tell me the <em>purely assembly</em> code for displaying the value in a register in decimal format? Please don't suggest using the printf hack and then compile with gcc.</p>
  
  <p>Description:</p>
  
  <p>Well, I did some research and some experimentation with NASM and figured I could use the printf function from the c library to print an integer. I did so by compiling the object file with the GCC compiler and everything works fair enough.</p>
  
  <p>However, what I want to achieve is to print the value stored in any register in the decimal form.</p>
  
  <p>I did some research and figured the interrupt vector 021h for DOS command line can display strings and characters whilst either 2 or 9 is in the ah register and the data is in the dx.  </p>
  
  <p>Conclusion:</p>
  
  <p>None of the examples I found showed how to display the content value of a register in decimal form without using the C library's printf.  Does anyone know how to do this in assembly?</p>