Re: Windows Assembly



The processor doesn't really care how the operands are ordered, a
direction flag can be set to accept either approach.

I'm afraid that direction flag doesn't do what you think it does.

When you say "real assembler" I suppose you don't consider AS a real assembler as it's native AT&T style syntax is src, dest.

No, what I don't consider a real assembler is a thing like HLA which simply dumps out MASM source. That's a preprocessor, not an assembler.


It's a good thing you don't have to program assembly for other CPU's.
Some of them also use src/dst.

CPUs aren't either way. It's entirely the assembly language that decides that sort of thing.


It all boils down to what syntax you are used to using, which ultimately becomes your prefered syntax.

And that's what I'm talking about.

If someone gets a job programming in assembly language, it'll probably be with MASM, or maybe with TASM. What are the odds that it'll be with something that's "src, dest"? It's what, GAS and HLA vs. every single other x86 assembler?

So why not teach the students the "conventional" operand order and allow that to become their preferred syntax, rather than allow them to spend an entire course becoming used to the opposite simply because it was easier that way for them on their first day?

This shouldn't even be debatable.  One of two things are true here:

1.  learning "dest, src" is difficult
2.  learning "dest, src" is easy

If #1 is true, then you have to teach them "dest, src" otherwise you're not giving them a complete education.

If #2 is true, then there's no reason not to teach them "dest, src" and so all that teaching them "src, dest" could possibly do is confuse them when they go to use one of the more common assemblers.

There just isn't any room for a good reason not to teach "dest, src".
.



Relevant Pages

  • Re: Windows Assembly
    ... >> assembler as it's native AT&T style syntax is src, dest. ... HLA compiles an assembly language. ...
    (alt.lang.asm)
  • Re: order of operands in HLA
    ... Different assemblers use different syntax. ... HLA uses the "src, dest" ordering, as do other assemblers such as Gas, ...
    (alt.lang.asm)
  • Re: is strncpy useful at all?
    ... > You return a pointer to the terminating null byte of 'dest'. ... char* tstrncpy; ... void runTest(FP_STRNCPY fp, char* dest, char* src, size_t maxlen, ... runTest(tstrncpy, dest, src, sizeof src - 1, DEST_SIZE); ...
    (alt.comp.lang.learn.c-cpp)
  • Re: HLA History
    ... Well, I see that teaching people is in of itself, very dangerous. ... In C std libraries, everything is dest, src notation. ... My first programming language was actually TI-83 Calculator basic. ...
    (alt.lang.asm)
  • Re: quick and easy assembler?
    ... Acme Cross Assembler 0.91 ... move n chars from src to dst ... SRC equ R0+2 ...
    (comp.sys.apple2.programmer)

Loading