0

My eax register has the following value

EAX DDCCBEE6

I want to put the value of eax to buffer so I can use it as it, I mean if I used SetDlgItemText it must set the text value of edit control to eax value which is DDCCBEE6

The value of eax is a result of math instructions

Jason Aller
  • 3,475
  • 28
  • 40
  • 37
  • You can do it manually with [How to convert a binary integer number to a hex string?](https://stackoverflow.com/q/53823756). `sprintf` is slower but maybe easier. – Peter Cordes Mar 31 '21 at 15:15

1 Answers1

1

You can use wsprintf for that purpose:

.data
format  db "%X",0

.data?
buffer  db 256 dup (?)

.code
invoke wsprintfA,ADDR buffer,ADDR format,eax

Note that there are safer alternatives to wsprintf, but I don't know if they can be found in the masm32 include files and import libraries.

Michael
  • 55,116
  • 9
  • 74
  • 120