flat assembler
Message board for the users of flat assembler.

flat assembler > Main > Bug ? mov dl, byte es:[di] - invalid ..

Author
Thread Post new topic Reply to topic
Honk



Joined: 29 Aug 2007
Posts: 5
Hi folks,

i tried to assemble a bigger project, that contains the line "mov dl, byte es:[di]" - FASM puts out an "invalid operand size" error. I've no idea why; TASM doesn't complain and my old Assembly Language books don't mention that this isn't x86 compatible.


Any ideas ?

Btw. does FASM for DOS support something like "GROUP" and "ASSUME" ?

So long

Honk
Post 29 Aug 2007, 10:39
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
Welcome to FASM Smile

Code:
mov dl, byte es:[di] ; BUG Sad
    


Code:
mov dl,[es:di] ; Correct (byte is unnecessary and optional) Wink
    


Quote:
I've no idea why


FASM<>TASM (coming from C ? FASM !=TASM Laughing )

Quote:
TASM doesn't complain and my old Assembly Language books don't mention that this isn't x86 compatible.


OLD means crap when dealing with x86 ASM syntax Shocked

Quote:
does FASM for DOS support something like "GROUP" and "ASSUME"


NO. Useless. Sad

MUST read: http://flatassembler.net/docs.php?article=design

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 29 Aug 2007, 11:18
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2335
Location: Usono (aka, USA)
Yeah, old TASM code is a PITA (i.e. pain) to get working with other assemblers. Actually, even though I love FASM, you may have better luck with ArrowASM (MASM 3.0) or OpenWatcom's WASM (MASM subset, doubtful) or LazyASM (Ideal only, case sensitive). Good luck!
Post 30 Aug 2007, 03:22
View user's profile Send private message Visit poster's website Reply with quote
Honk



Joined: 29 Aug 2007
Posts: 5
Hi,

yeah, I am an oldschool TASM Coder Cool .. but my actual project aims the usage of FASM as OpenWatcom Backend for DOS (for 4k-Dos-Intro Szene coding).

And .. it worked ! 'Cause OpenWatcom links a lot of unnecessary stuff to it's executables and FASM creates such beautiful small EXEFiles, I gave it a try.

The OpenWatcom Compiler & Linker created a (UPX Packed) 9 kb EXE (no extern libraries, everything stripped) - with FASM as Backend I got a 2,3 kb (UPX) File of the same source .. of course I don't use the standard libraries for my projects.

So long

Honk
Post 30 Aug 2007, 09:00
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2335
Location: Usono (aka, USA)
Honk, in case you're using an older version (and would be willing to freely upgrade), OpenWatcom 1.7 has just been released recently. Smile
Post 31 Aug 2007, 04:31
View user's profile Send private message Visit poster's website Reply with quote
Honk



Joined: 29 Aug 2007
Posts: 5
Hi,

rugxulo wrote:
Honk, in case you're using an older version (and would be willing to freely upgrade), OpenWatcom 1.7 has just been released recently. Smile


I'm using Openwatcom 1.6 (after a lot of tests the best available C/C++ Compiler for DOS Develpment 'cause of its actuality) - I don't think that much changed in ver1.7. .. the size of created binaries is quite well, the smallest of all tested C Compilers for DOS, but not small enough for Intro Coding. If you watch the assembly file, you see a lot of functions like "__u4m", "__chp" etc. that are unnecassary or don't have any influence to the runtime (i replaced them with "retn"-instructions). And if using floats (even if not the math.lib) every C Compiler seems to link against a math runtime (_fltused) - which is discussed in different Kernel-developer threads ..
I have no idea why, but if stripped, everything works still fine and you got the small executables that can be used in 4kb Intros ...

So long

Honk
Post 31 Aug 2007, 13:31
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2335
Location: Usono (aka, USA)
Actually, no, there are (16-bit, at least) DOS C compilers that output smaller than OpenWatcom: Turbo C, Desmet C, Micro C, Dev86, Small C (depending on what you want to do, they are not all ANSI compatible). See here.
Post 07 Oct 2007, 03:14
View user's profile Send private message Visit poster's website 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-2019, Tomasz Grysztar.

Powered by rwasa.