How can I print/display any 3-digit no. on the monitor using MASM ?
Hello Annian, what have you tried so far?
Annian,
Have you tried dwtoa?
.data
BinaryValue dd 0 ; Binary value
ASCIIValue db 6 dup(0) ; ASCII value
.code
invoke dwtoa, BinaryValue, ADDR ASCIIValue ; Convert double word Binary value value to ASCII
Once you have performed the above, if you are converting a 3 digit value to ASCII; you will wind up with a 3 digit ASCII value that is zero terminated and can be easily displayed depending upon how you wish to display it, console or window. I would encourage you to use the data declarations just as is so that you can use this bit of code in a multitude of applications.
Paul
invoking C function printf(),
look at this:
http://www.masm32.com/board/index.php?topic=5260.0 contains examples for download and a pasted code reply by Vortex(last reply currently)
wsprintf also can do the job.
wolfshad3,
I like Vortex's method, also. He has always been a good partner in our project and always contributes very important code. I was just waiting to see what method of display Annian wants to use before further posting.
Paul