-> I'm an infrequent user of A86. I only use it occasionally for short
-> test programs. So I'm not well-acquainted with it. I ran across the
-> following problem. At least I think it's a problem. Perhaps I'm
-> just making a mistake:
The problem is just your lack of knowledge of how your assemblers work.
Just out of curiosity, why do you switch back and forth between Tasm and
A86? Surely it's just as easy to write "short test programs" with Tasm
as it is with any other assembler so why do you use two different
assemblers? In your opinion, what feature does A86 provide, in this
regard, that Tasm doesn't?
-> This code aseembles correctly with TASM into an .EXE file, and runs
-> as expected. A86 incorrectly assembles it into a .COM file which
-> does not execute properly because the first two lines of code cause
-> A86 to place 0 in DS.
Heh heh heh... oh, man...
Tasm links programs directly into relocatable native-mode executables in
one-shot? Cool.
Don't blame A86 -- you're the one who's incorrectly telling it to
assemble the program to a .Com file. A86's shortcoming in this regard is
that it's >letting< you assemble the program without warning you of your
mistake. If you tell A86 to assemble the program as an Omf, then link
it, I pretty sure you'll find that it runs properly in its unmodified
form. Your problem is that:
This is not assembly language -> cseg segment
This is not assembly language -> assume cs:cseg
This is not assembly language -> cseg ends
This is not assembly language -> dseg segment
This is not assembly language -> dseg ends
This is not assembly language -> end begin
All these declarations are >assembler< "directives", not assembly
language, and their syntax and usage varies from assembler to assembler
and platform to platform. Read your documentation and learn how to use
your assembler; that is, whatever assembler you wish to use, whether it
be Masm, Tasm, Spasm, Trashem, or whatever.
-> It
-> simply places the data in the code segment following the last line of
-> code.
That's because you told it to assemble the file as a .Com file. Since
A86 knows that the segment registers will all be initialized to the same
value in a .Com file, it >correctly< placed your data in the one segment
where it could be correctly addressed. Unfortunately A86 simply ignores
the extraneous directives because it also recognizes that some compilers
>require< all these declarations, even when there is only a single
segment being used. So while it places the data in the correct segment,
it erroneously allows you to address it incorrectly. If you were to
instruct A86 to assemble the file into an Omf then I think you would
probably find that it not only runs correctly, but that it has also been
properly segmented. (In fact, I would be somewhat surprised to discover
that A86 output code that was much different from whatever Masmatasm
would produce under nominal conditions.) Assembly language is assembly
language.
Just out of curiosity, what happens when you tell Tasm to assemble that
program as a .Com file? What? You didn't try it? You mean you coded a
multi-segment program, correctly told Tasm to assemble an Omf but
erroneously told A86 to assemble a .Com, then you slag A86 for producing
erroneous code?
What a surprise...
I know it's popular around here for the Tasm programmer(s) to blame all
the ills of the world on A86, AS86, Arrow, Nasm, ad nauseum, but the
fact of the matter is that people simply have to learn how to use their
tools.
Take care.
Ian (RTFM) Moote.
** Bite this tagline.
--- PCBoard (R) v15.3/M 5
---------------
* Origin: The GameBoard-905.689.3982/9409-Burlington-ON-CA (1:244/506)
|