News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how can i dsplay a variable in assemble

Started by zeeme, February 24, 2008, 03:40:57 PM

Previous topic - Next topic

zeeme

i am new to assembly plz tell me that how can i dsplay or print any variable on screen...???...
plz tell me in simple  words...

Brett Kuntz

I assume you mean in a Console Application? (like a DOS box)

There are some great tutorials found in the MASM directory:

/masm32/tutorial/console/demo1

Also, you can use a procedure called wsprintf to place varibles of any sorts into a text string to display:


.data

buffer db 128 dup(?)
my_value dd 123456
my_string db "The Value Is Equal To: %u", 0

.code

invoke wsprintf, addr buffer, addr my_string, my_value
invoke MessageBox, 0, addr buffer, 0, 0


http://msdn2.microsoft.com/en-us/library/ms647550.aspx