flat assembler
Message board for the users of flat assembler.
Index
> Main > [SOLVED|different segment regs] Why expression not resolved? |
Author |
|
revolution 19 Apr 2022, 05:37
The first register is taken as the base, and the second register as the index.
EBP can only be encoded as a base register with an offset. fasm doesn't reorder the registers, even when the offset is zero. |
|||
19 Apr 2022, 05:37 |
|
revolution 19 Apr 2022, 07:33
I forgot to add that the reason for not swapping the register order is because of the different segment register used. EBP uses SS, EAX uses DS.
For Win32 this makes no difference normally, but fasm isn't only for Win32. |
|||
19 Apr 2022, 07:33 |
|
macomics 19 Apr 2022, 16:08
ProMiNick wrote: not resolved into Code: mov eax,dword[eax+ebp] ; 4 bytes: $17,$8B,$04,$28 |
|||
19 Apr 2022, 16:08 |
|
revolution 20 Apr 2022, 03:45
If you define the segment register then you get this:
Code: use32 mov eax,[ds:ebp+eax] ; 0x8b, 0x04, 0x28 mov eax,[ds:eax+ebp] ; 0x8b, 0x04, 0x28 mov eax,[ss:ebp+eax] ; 0x8b, 0x44, 0x05, 0x00 mov eax,[ss:eax+ebp] ; 0x8b, 0x44, 0x05, 0x00 |
|||
20 Apr 2022, 03:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.