[comp.sys.m68k] ADDA.L

nw@palladium.UUCP (Neil Webber) (11/30/87)

Is the following instruction sequence an "undefined" operation?

        ADDA.L  (SP)+,SP

The intent is to add the value at the top of the stack, plus 4, to
the stack pointer.

I've tried it, and it works, but I'm wondering if Motorola prefers to
consider this "undefined" operation.

The closest thing I can find to a discussion of this is under MOVES,
where it says (p B-117, 68020 User's Manual, Second Edition):

        MOVES.x An,(An)+
            or
        MOVES.x An,-(An)

        where An is the same address register for both source and destination
        operand is an undefined operation.

Is this meant to be a generic warning or only for MOVES?  By the way, if
someone from Motorola is reading this article, you should note that the
actual wording in the book is quite mangled ... it needs correction.

Thanks in advance.

-- 
Neil Webber / Epoch Systems, Marlboro MA / (617) 481-3717
        {harvard!cfisun, linus!alliant}!palladium!nw

davet@oakhill.UUCP (Dave Trissel) (12/03/87)

In article <407@palladium.UUCP> nw@palladium.UUCP (Neil Webber) writes:
>Is the following instruction sequence an "undefined" operation?
>
>        ADDA.L  (SP)+,SP
>

No, this is well defined.  The stack register value is first incremented by
four and then totally replaced by the memory source data.

>        MOVES.x An,(An)+
>            or
>        MOVES.x An,-(An)
>
>        where An is the same address register for both source and destination
>        operand is an undefined operation.
>
>Is this meant to be a generic warning or only for MOVES?  ...

This warning only pertains to the MOVES instruction.

 -- Dave Trissel - Motorola Austin  - ihnp4!ut-sally!im4u!oakhill!davet