flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Assume The Assumptions! |
Author |
|
revolution 04 May 2009, 01:43
The fault is here:
Code: mov ebx,[ebx+TestStruct2.Key2] ; shouldn't work You can prove the the above line is wrong by doing this: Code: include 'macro\struct.inc' include 'macro\masm.inc' use32 struct TestStruct1 Key1 rq 1 ;<-- change to quad word for testing ends struct TestStruct2 Key2 TestStruct1 ends mov ebx,[ebx+TestStruct2.Key2] ; shouldn't work |
|||
04 May 2009, 01:43 |
|
LocoDelAssembly 04 May 2009, 01:48
revolution, could you start a thread in Compiler Internals about this bug?
Thanks |
|||
04 May 2009, 01:48 |
|
Mercury Knight 04 May 2009, 02:10
Wow... looking for one bug shows up another!
And I can see where using Code: mov ebx,[ebx+TestStruct2.Key2] shouldn't work since TestStruct2.Key2 is a structure variable and not a pointer to a structure... but it should be valid if one wants the address by using lea instead of mov (I've been getting the same error whether using lea or mov). I'm still looking at the assume macro, but I still can't get it to define ebx.Key2 to use as thus: Code: lea ebx,[ebx.Key2] I haven't looked inside of the struct macro since it defines TestStruct2.Key2, as well as TestStruct2.Key2.Key1, but my brain already fried earlier trying to figure out what changes needed to be made in assume in order for it to define ebx.Key2. BTW: I forgot to remove Struct and EndStruct in my original post, I use a fix definition to rename them! M |
|||
04 May 2009, 02:10 |
|
revolution 04 May 2009, 03:32
LocoDelAssembly wrote: revolution, could you start a thread in Compiler Internals about this bug? However since you think it is a bug I will make a new thread and see what Tomasz has to say about it. |
|||
04 May 2009, 03:32 |
|
LocoDelAssembly 04 May 2009, 03:53
Quote:
Aahh damn, I forgot about that fact. It is still odd the "mov ebx, [ebx.Key2]" error though (perhaps MASM doesn't support this neither?). |
|||
04 May 2009, 03:53 |
|
Mercury Knight 04 May 2009, 18:23
Quote:
Hmmmm why not have the struct macro simply mark the variable as a label (and fix the assume macro to account for it)? Then an instruction such as Code: mov eax,[eax+TestStruct2.Key2] shouldn't work without an override because Key2 is just label that points to an offset within its main structure (pointing to the start of the embedded structure) and doesnt have a size associated with it... while at the same time, using the assume macro... Code: lea eax,[eax.Key2] ; same as lea eax,[eax+TestStruct2.Key2] should work since Key2 is basically a label now and would load eax with the starting address of the embedded structure. Just a thought... |
|||
04 May 2009, 18:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.