[A89] Re: assembly "translation"


[Prev][Next][Index][Thread]

[A89] Re: assembly "translation"




> >  > lea     (%sp,-3840),%sp
> >
> >lea 3840(sp),sp
>
> ok, so source and dest are kept in the same order?

Yes... both orders are "natural" (i.e. the reverse order, used by x86 etc, is
just as natural). It's just a matter of getting used to it.

> >  > move.l  (%a0,4*memcpy),%a2
> >
> >move.l 4*memcpy(a0),a2
> >(memcpy is a constant, right?)
> >
> >>  movem.l (%sp)+,%d3-%d7/%a2-%a6
> >
> >movem.l (sp)+,d3-d7/a2-a6
>
> this is what a68k tells me when trying to compile:
>
> lesson1.asm line 15
>     15       movem.l d3-d7/a2-a6,sp
>                              ^ Addressing mode not allowed here.
>
> and 15 more errors like that. any tips on how to fix this?
> thanks a lot,

You have to use indirect addressing with movem... like I wrote in my previous
answer:
 movem.l d3-d7/a2-a6,-(sp)
 movem.l d3-d7/a2-a6,(sp)
 movem.l (sp)+,d3-d7/a2-a6
 movem.l (sp),d3-d7/a2-a6

sp is the same as a7 (the stack pointer), but you can use any address register
with movem.

--
 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF v5.1 Quote follows:

There was a thoughtful pause in the conversation as the assembled Brethren
mentally divided the universe into the deserving and the undeserving, and
put themselves on the appropriate side.
        -- The Elucidated Brethren see the light
           (Terry Pratchett, Guards! Guards!)





Follow-Ups: References: