[A89] Re: movem


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

[A89] Re: movem




>I'm not totally sure but I would think they would be the same but just save
>you some hassle of saving the registers one by one in your code
>
>> Now I have a dilemma; it appears that when I just save and restore those
>two
>> registers (A2 & A5), that move and movem produce the same sized code. Is
>one
>> method faster than the other in this situation? I've looked at the
>Motorola
>> documentation, but am not sure how to decipher the timings for movem.

The MOVEM instruction is always 2 words long. The second word contains a
bit map of registers to save.

MOVE is one word long (usually -- I know it is in the case of move.l
An,-(An)). Obviously, 2 MOVE instructions equals 2 words :)

Once you start saving 3 registers and more, you'll see the benefit.

As for speed, 2 MOVE.L An,-(An) instructions take 24 cycles and a MOVEM.L
A2/A5,-(A7) would take 8+8*2 (24) cycles. So there shouldn't be a real
difference as to which you choose...


Bart




References: