hm is there an easy way or at least a way to display the content of for example eax in an msgbox ? sure i could use a buffer or whatever and simply move than eax into the buffer/handle but hm well thatīs not my question ;) so something like an .. invoke I_call_an_api,parm1,parm2 have the result now in eax and want to display that now invoke MessageBox,0,addr eax (of course not working),0 MB_OK
Posted on 2001-04-22 13:15:00 by newbie
Well try this:

.data
WsTemp db "Value of eax : %u ",0
WsBuffer BYTE 30 dup(?)
AppName db "Hello",0
.code
invoke SomeApiCall
;Return value is in eax now
invoke wsprintf,ADDR WsBuffer,OFFSET WsTemp,eax
invoke MessageBox,0,ADDR WsBuffer,ADDR AppName,0
WsTemp is the template for wsprintf.. %u means that we're passing an unsigned integer (a number) wsprintf is a really powerful function... but makes quite a headache when you're new to it..
Posted on 2001-04-22 13:58:00 by JimmyClif
hm thanx but thatīs exactly not what i wanted since it uses a buffer ;)
Posted on 2001-04-22 14:52:00 by newbie
newbie: What you want is just not possible. You'll have to use a buffer, simply because any text you want to display has to be stored somewhere. You can't directly display eax, because it's just a number, 32 bits representing a value, not a text string. But what's wrong with using a buffer? JimmyClif's code works fine.. I hope this will clearify some things, Thomas
Posted on 2001-04-22 15:52:00 by Thomas
Hi Newbie you are missing some concepts here...i suggest a reading of the "Art of Assembly language" any register/or value HAS to be converted to and ASCII string and that string must be then converted to pixels in order to appear as printed on screen.... Now all this can be HIDDEN from you as a HLL programmer or even as a ASM programmer (by some wrapper prodedure) .... but i dont see how NOT KNOWING the TRUE will ever help you :D make the above example a PROC (procedure, use ENDP at the end) haveing eax as a DWORD parameter and you have your wrapper....you can after that ignore the TRUE facts about the inner workings of that procedure...and still print eax....but why?
Posted on 2001-04-22 16:54:00 by BogdanOntanu
Newbie, What the members have told you here is correct, the contents of a register does not display by itself in ascii format. To get it into human readable form it must be converted to zero terminated ascii first then displayed in whatever form you require. There is a debugging DLL that comes with MASM32 that will do what you are after. It was designed to make these quick value tests easy to do. It uses a set of macros that call the DLL from your source code. After your API call, ShowReturn hWnd, eax will display a message box with the conversion done in decimal, hex and binary. The latest versions of the macros are written by the code wizard, Prostart so try it as it will save you a lot of messing around. Regards, hutch@pbq.com.au
Posted on 2001-04-22 19:32:00 by hutch--
OK, here's the simple answer: Everyone else who answered is wrong. Only kidding... and I feel your pain. I had it too once, wishing a simple single line instruction so I could just see what is in a register as the program runs. Been there, done that. Got the T shirt. So I wrote some macros. They will display a register (or memory location) in hex or decimal in a message box (or in a console window) (or save em to a text file). It will also do strings. AND... when you're done debugging, you can leave it all there because they only compile to code when told to do so. Catch em on my site.
Posted on 2001-04-22 23:45:00 by Ernie