The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: gnn42 on January 08, 2012, 01:13:05 PM

Title: db hexa value , error
Post by: gnn42 on January 08, 2012, 01:13:05 PM
Hello i try to declare a new string inside my data segment, but i got a strange error:

My str

str db 0xEB,0x0F,0xBE,0x39,0xE7,0x56,0x76,0xFF,0xD6,0xB8

And the error,

A2206 missing operator in expression


Thank you for help.
Title: Re: db hexa value , error
Post by: qWord on January 08, 2012, 01:37:35 PM
MASM doesn't support this syntax for hexadecimal numbers. instead the 'h'-suffix is used:
str db 0EBh,0F,39h
Title: Re: db hexa value , error
Post by: dedndave on January 08, 2012, 03:41:30 PM
Quotestr db 0EBh,0F,39h

i think that's the first time i ever saw qWord make a mistake   :bg

str db 0EBh,0Fh,0BEh,39h,0E7h,56h,76h,0FFh,0D6h,0B8h

i would use a longer name   :P
"str" may be used elsewhere, and is actually a Hungarian-notation prefix
"str1" is a little better
Title: Re: db hexa value , error
Post by: gnn42 on January 08, 2012, 04:39:32 PM
Ok it works, thank you.