let's assume I have this code:

Call NewOffset
NewOffset:
pop esi
lea ebx,
....
MyData db 'Test', 0

The "lea ebx, " is compiled with Tasm
only 3 bytes lenght...but with masm it has 6 bytes..
because instead of lea ebx, , it makes it lea ebx, and so on
is there any way to fix this? (besides using tasm or other compiler)
Posted on 2002-02-14 16:13:34 by DZA
Maybe, Try:
Call NewOffset 

NewOffset:
pop esi

YourOffset = MyData - NewOffset
lea ebx, [esi + YourOffset]
....
MyData db 'Test', 0
If this produces the same thing, then your stuck? :confused:
Posted on 2002-02-14 16:24:09 by bitRAKE
thanx, this way works:)
weird...
Posted on 2002-02-14 16:39:08 by DZA
It has to do with the address being a forward reference during the first pass of the assembler - if you want to know why. ;) MASM isn't able to correct the size of the operand on the second pass, so it predicts the largest size. :( The way I suggest, forces MASM to figure out the size before it does anything.
Posted on 2002-02-14 16:46:07 by bitRAKE
probably the best way is to use the assembler as it was designed, put the data in the .DATA section instead of trying to implement TASM code in MASM.

MASM allows you to use the following format,


.DATA
MyVar db "hi, I am a BYTE sequence.",0
.CODE


Then implement you code that references the data in the .DATA section.

Regards,

hutch@movsd.com
Posted on 2002-02-14 17:01:30 by hutch--