flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [solved] fasm bug

Author
Thread Post new topic Reply to topic
Ali.Z



Joined: 08 Jan 2018
Posts: 726
Ali.Z 19 Apr 2020, 05:46
fasm1:

Code:
use32
mov     dword [edi],esi ; 2 bytes
mov     dword [ds:edi],esi ; 2 bytes

; the bug
mov     dword [es:edi],esi ; 3 bytes    


the default segment for EDI is es - extra segment, so fasm should not add es prefix while assembling [es:edi].

but it should add ds prefix for [ds:edi]



fasm also assemble [cs:esp] with no issues, but in reality this is invalid because there is no replacement for stack operations.
im not sure what other segment bugs fasm have.

there is no segment override for CS:EIP, SS:ESP, and ES:EDI, that is what i know Confused i love fasm

_________________
Asm For Wise Humans
Post 19 Apr 2020, 05:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20416
Location: In your JS exploiting you and your system
revolution 19 Apr 2020, 05:52
IIRC ES is only the default for EDI with the string instructions like MOVS and STOS. Question
Post 19 Apr 2020, 05:52
View user's profile Send private message Visit poster's website Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 726
Ali.Z 19 Apr 2020, 06:09
okay i checked the manuals, thats true the default destination segment for string operations is ES:EDI.
but normally is DS, last time i checked the manuals was very long time ago.

sorry for this, you can remove the thread if its so stupid.

_________________
Asm For Wise Humans
Post 19 Apr 2020, 06:09
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.