Re: from elsewhere, an assembler



Herbert Kleebauer <klee@xxxxxxxxx> écrivait news:46160622.95EA8A07
@unibwm.de:

Oh! I was talking about the wolf...

:))

Betov wrote:
"cr88192" <cr88192@xxxxxxxxxxxxxxxxxx> écrivait
news:eeee8$46158762$ca83a8d6$5807@xxxxxxxxxx:


I have to second Spook, here. ';' has been the traditional char
for comments, and there is no reason for modifying this. Also,
in order to resist to the natural babelism tendancies, it would
be a good thing to do the same choices, the other Author have
done, when this is without any importance.

The only way to get an improvement is to not make the same
choices as the other have done.

Generally speacking? This is sometimes true and sometimes
false, Herbert. There are even cases, like yours about the
Asm syntax, where one can be both fully right and fully
wrong.


The only Assembler
i know about, which enables with multi-Instructions-lines is
RosAsm, and it syntax is:

mov eax ebx | mov edx 0 | div ecx

Now, that surely is an example how a deviation from the
commonly accepted choices makes thing worse: to separate
the parameters by a "," makes the instruction much better
readable.

My own choices, in the whole syntax, has been that, on one hand,
_each_ char _must_ have a signification, and that, on the other
hand, the syntax must be a flexible as possible. On this very
point, i have choosen to make ',' the Line-Continuation Char,
what seems to me to have been a good choice. It makes it legal
to write, as well:

mov eax ebx | mov edx 0 | div ecx

mov,
eax,
ebx | mov edx,,,,,0
div,
,,, ecx

This is Flexibility, Herbert: Yes, flexibility includes utterly
unreadable horrors, if the user likes this. Flexibility is choice
and decisions of the user, instead of choice and decisions of the
Tool's author.


And the "|" as a separator for instructions is
much to dominant.

?


Compare the two lines and you will
see what's the better choice.

mov eax ebx | mov edx eax | mov ecx edx | div ecx

mov eax,ebx; mov edx,eax; mov ecx,edx; div ecx;

I don't know how problematic it is, to use the ; as an
instruction separator and as a start of a comment depending
on a preceding space, but I must say, I most probably
never used a ";" as a start of comment without at least
one space before it.

The problem is, to me, that i do not know of any x86 Assembler
which would encode anything but the first Instruction.


But much superior to both is the traditional way to only
write one instruction per line and use the src,dest
order:

move.l r3,r0
move.l r0,r1
move.l r1,r2
divu.l r2,r1|r0

On a brief glance you see what happens:

r3 -> r0 -> r1 -> r2

Same answer: I don't kown of any x86 Assembler (the ones used
by the Asmers), which would have a syntax like this one, and
i am unable to imagine any reason why we should modify this.


But with your format, you have to look even more than twice
to see what happens:

mov eax ebx | mov edx eax | mov ecx edx

eax <- ebx
+--------------------+
edx <- eax-+
+--------------------+
ecx <- edx-+

What are you talking about? Rejecting the Multi-Instructions
lines concept? If yes... well... write it the way you'd like...


Unless it would be a problem for your parser to make a difference
with an expression, why not doing the same choice?

No, if the old choices are good, keep them. If the old choices are
bad, change them. But you did exactly the opposite: change
the good and keep the bad.

Heuuu!...

1) I "changed" very few things in the traditional syntax.

2) RosAsm (if this is what you are talking about) accepts
a wide range of traditional forms.


But it really doesn't matter as
long as your product is only for your private use (like an
assembler for writing applications).

:))

Right.

:))

Betov.

< http://rosasm.org >




.



Relevant Pages

  • Re: Betovs crappy notation
    ... > mov D$eax 1 ... > Now I could pick on the syntax all day long, ... RosAsm Syntax is, like all Actual Assemblers Syntax, ...
    (alt.lang.asm)
  • Re: Linux X demo
    ... mov ecx, esp; ... test eax, eax; ERROR ... mov edx, send1l ... .10: mov eax, esi ...
    (alt.lang.asm)
  • Re: Linux X demo
    ... mov ecx, esp; ... test eax, eax; ERROR ... mov edx, send1l ... .10: mov eax, esi ...
    (alt.lang.asm)
  • Re: Linux X demo
    ... mov ecx, esp; ... test eax, eax; ERROR ... mov edx, send1l ... .10: mov eax, esi ...
    (alt.lang.asm)
  • Re: ADK/HLA v2.0 Update
    ... Sounds good - as long as it's only mov that has operand order ... > You won't see anywhere near this performance loss in HLA v2.0. ... This will allow you to create any syntax ... > Most people who've learned a different assembler don't. ...
    (alt.lang.asm)