> What i don't like about A86 is that allows you to do stuff that is
> actually "forbidden".
>
> For instance, from what i remember, A86 allows you to do something
> like:
>
> MOV ES, B800h
>
> This is absolutely not supported by the CPU, and you need to use a
> general purpose register to move a value onto a segment register. So
> the actual A86 assembled code looks like this:
>
> PUSH AX
> MOV AX, B800h
> MOV ES, AX
> POP AX
>
> I believe that it is very important for a begginer to understand how
> the ISA works otherwise this will just lead to confusion later.

All assemblers have "quirks" in them that you just need to learn.  The A86 
thing for putting a direct value into a segment register is basically just a 
built-in Macro, and you could do the same thing with any other assembler (at 
least if it supports macros) if you wanted to also.  That particular A86 thing 
is in the documentation, so if you read that you will see it.  You will also 
see it when you're debugging.

When I use A86 (which I still do sometimes), I know about this "quirk" and 
bypass it and use one of the general purpose registers (sometimes AX and 
sometimes another register) to set a segment register to a direct value.  But 
the A86 macro is handy for a beginner -- IMHO, putting a direct value into a 
segment register SHOULD be something the CPU supports.

The "weird" one I find in NASM is that you normally need to use $-$$ (instead 
of just $) for the current memory address.

> What i like about FASM is that it is very strict so you learn to do
> things properly from the get go. Its raw and gritty so it might be a
> little more frustrating at start but you'll really learn things.

When I found I was needing to "upgrade" from A86 I looked at both FASM and NASM 
and ended up choosing NASM, in part because it wasn't as "strict" and was a 
little more similar to the A86 I was used to.  I also have a set of macros I 
use to make NASM to work a little bit more like A86 and some of the built-in 
"special features" that are nice in A86, which makes it easier to port the code 
over to NASM.  I still need to make quite a few changes to the code, but not as 
many changes as I would need to make if I didn't have the macros.

It's really all personal preference.  But, when you start introducing macros 
and libraries (especially ones that others write) then "strictness" kind of 
goes out the window, anyway.


_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to