Strange behavior from a multipass assembler...

It needs prototypes to be able to do parameter/type checking.


IMHO if it does more than one pass then it's got design flaws.

You need multi-pass if you want to do jump size optimization.


LOL no, I meant that if it's multipass (or multiphase if you wish ;) ) and still needs procedures to be declared before called, and data to be defined before used, then it's got design flaws.
Posted on 2005-06-13 14:41:48 by QvasiModo
Yes, if you do multiple passes you should be able to use data defined AFTER the use and you could construct the prototype from the function declaration itself... this has always amuzed me ;)


Posted on 2005-06-13 19:10:45 by BogdanOntanu
In Win32, even a single pass assembler like GoAsm can handle data and code labels (data declarations and code procedures) which are situated later in the source or even in other source scripts or modules.? This is because the space required for the address of the label is known each time such labels are referenced (it's always a dword).? All the assembler needs to do is to make the space, record the fact that it needs to be filled, and fill the space when the true address is known.? If the true address is not provided by the source after all, then the address is to be regarded as outside the module, and should be dealt with by the linker.
Single pass assemblers do not know the size of a structure or union, however, and these need to be declared earlier in the source or in an include file declared earlier in the source.
As for jump size optimisation, GoAsm makes use of local code labels and locally scoped labels which will always be regarded as short, and will show an error if they are not.? However, they can be marked as long by the user.? Any backward jumps can be properly sized.

Here is an excerpt from the GoAsm help file about this:-

GoAsm always tries to make the smallest possible code, consistent with being a one-pass assembler. Here are the rules which are followed:-
For backward jumps to unique labels, GoAsm will automatically code a short jump if possible, if not a long jump.
For forward jumps to unique labels, GoAsm will code a long jump.
For backward jumps to locally scoped and also to unscoped labels, GoAsm will code a short jump if possible even if told to code a long jump.
For forward jumps to locally scoped and also to unscoped labels, GoAsm will code a short jump unless told to code a long jump.
GoAsm will show an error if a short jump to a locally scoped or unscoped label is specified but cannot be achieved. This is to ensure that you have not made an error in your source script. For example you might intend to jump only a short distance but have forgotten to add the destination of the jump to your source script.
Posted on 2005-06-20 09:06:50 by jorgon
I used TASM for a few years. It was very good; I'd say it's probably the best option for anyone starting out in assembly, whether writing DOS or Windows applications. I eventually switched to FASM and since then there's been no turning back. It assembles large projects in a snap, even on my old P200 laptop. I programmed a little in MASM and enjoyed the vast array of examples, but it never could replace the efficiency or versatility of FASM. And that's my life story.
Posted on 2005-06-22 09:07:51 by Big Red