Re: from elsewhere, an assembler



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.


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. 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.

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

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-+


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. But it really doesn't matter as
long as your product is only for your private use (like an
assembler for writing applications).
.



Relevant Pages