The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: sharpe on June 20, 2011, 08:08:02 PM

Title: Hex code
Post by: sharpe on June 20, 2011, 08:08:02 PM
Hi all,

I am trying to define a variable initialised with some hex values like so:

bytestr byte 54h,68h,65h,...,0

But I am getting an error saying "statement too complex" using winasm.

Does anyone have any ideas?

Additionally, where is the best place to store larger quantities of initialised data, as I often received an error stating that my variable is too large.

Thanks in advance,

sharpe.
Title: Re: Hex code
Post by: dedndave on June 20, 2011, 09:38:30 PM
you may want to create an OBJ from the data item(s), alone
there are a few different programs around to do this

Erol (Vortex) has one named bin2coff...
http://www.vortex.masmcode.com/
Title: Re: Hex code
Post by: xandaz on June 20, 2011, 11:16:18 PM
   i've tried it with winasm and it worked fine. Also variables can be too large. If no errors too much time to assemble. Anyway you should use an Alloc function for those large arrays.
Title: Re: Hex code
Post by: sharpe on June 21, 2011, 08:44:20 AM
OK, I have done a little testing and have figured out what is wrong.
In WinASM, when you define variables for initialised data, each line can be a 48 byte array. If you need more data, then you must define it on the next line.
Here is an example:

szVariable    DB    01h,02h,03h,...48h
                  DB    49h,50h,...,0

I hope this saves someone some time.

Thanks for your answers and advice.

Regards,
sharpe.