Masm:

mov , -1

when I do the equavilant of this in hla like this:

mov (-1, );

I get an "unspecified memory size" error.

How can I do a const to mem32 mov instruction?


I tried this and it seems to work (no error message)

mov (-1, ebx);
mov (ebx, );

but it seems like an extra step to make.
Posted on 2003-11-17 23:19:49 by Kain
Are you sure you can assemble the following in masm?



mov [eax+12], -1


you need something like


mov dword ptr[eax+12],-1
Posted on 2003-11-17 23:32:01 by roticv
In HLA that would be
 


mov( -1, (type dword [eax + 12 ] ));
Posted on 2003-11-18 06:52:11 by Odyssey

Are you sure you can assemble the following in masm?



mov [eax+12], -1


you need something like


mov dword ptr[eax+12],-1


Yup, your right, that won't assemble. I was trying to figure out different ways to translate and got my code mixed up. I'll have to rework it and present the problem again later.

Originally posted by Odyssey
In HLA that would be...


Thanks, that works out.
Posted on 2003-11-18 11:39:14 by Kain
I don't know how much of AOA you have read so far but the chapter on memory access and organisation discusses type coercion. Thats in the ebook version.
Posted on 2003-11-18 11:47:02 by Odyssey

I don't know how much of AOA you have read so far but the chapter on memory access and organisation discusses type coercion. Thats in the ebook version.


Also in the published edition :-)
Cheers,
Randy Hyde
Posted on 2003-11-18 12:15:02 by rhyde

I don't know how much of AOA you have read so far but the chapter on memory access and organisation discusses type coercion. Thats in the ebook version.


I read it but I was trying to type coerce the wrong element (duh!)

Anyway, with the help above I traced the root of my error. I was staring right at the the solution in the hla docs but I couldn't see it.

Originally, I was trying to translate

Masm: mov [_sections+12], -1

to

hla: mov (-1, _sections[+12]);

Couldn't figure out why the parser was complaining, so I went the long way around using lea and registers (and type coercions).

I finally learned the proper hla syntax for this:

mov (-1, _sections[12]);

and it worked out dandy. That '+' in the syntax difference made me lose an hour. Oh well, code and learn (hopefully).
Posted on 2003-11-18 15:53:29 by Kain