In a message dated 08/10/02 17:37:12 GMT Daylight Time, [EMAIL PROTECTED] writes:


> GWASS treats 0(a4) as (a4), so the shorter version is always used here.
>
> George

It takes some effort to force an assembler that "helps" like that, when
you really do want it to generate the zero offset. You have to define an
external that will supply a zero a link time. IIRC there is a bit of
code in the debugger that I wrote that needed to do it. It wanted to
generate a live sequence of code to push on the stack with an offset to
be filled in.

I'm not too sure about assemblers that "help" too much. E.g. when you
are writing I2C drivers and need to account for every cycle, it's no fun
if the assembler quietly replaces your instructions with ones it thinks
are "better".

A good solution is for an assembler to accept an override control saying
"don't mess with what I write".



The effective address 0(a4) which GWASS sets to (a4) is an exception to the normal GWASS rule, which is just what you state, namely that a programmer should be master of what he writes. For example, GWASS will shorten branches where possible if they are written BRA but will leave them as requested if written BRA.W, BRA.L or BRA.S.

I made GWASS use (a4) in place of k(a4) when k was zero because it seemed obvious at the time that this should be done. It has certainly caused me to use DC.W when I really did want 0(a4) and not a4.

If a change were to be made in GWASS over this instruction, I would simply delete the change from 0(a4) to (a4).

George

Reply via email to