News:

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

Procedure calls

Started by bf2, June 01, 2011, 05:05:45 PM

Previous topic - Next topic

cobold

Hi,

QuoteWhat i try to do is initialize a variable called testInt.
...
...

testInt=7

to initialize an unsigned/signed integer:

testInt DWORD 7 ; unsigned
testInt dd 7 ; same as above but less typing :-)
testInt SDWORD 7 ; signed


Quote
When i put as argument value '-10' i get a strange value.
....
But how do i store a negative value in a register?

You simply "mov" the value to the register:
mov eax,-10

If you know your value is signed, use str$(eax), if unsigned --> ustr$(eax), OR

invoke dwtoa,eax,ADDR someText to convert SIGNED value to Ascii.

hth




JayJay

Hi cobold,

I succeeded thank you verry much. :U The problem was just super small. I needed to change this line
    invoke  MessageBox,0, ustr$(eax),ADDR capt,MB_OK

into:
    invoke  MessageBox,0, str$(eax),ADDR capt,MB_OK