WORD type movement, and "movem" instruction

cancel
Showing results for 
Search instead for 
Did you mean: 

WORD type movement, and "movem" instruction

1,711 Views
Contributor I
Hi,
I just started to optimize some C code for a coldfire platform with EMAC. One problem I met when trying to write assembly is to move the contents of some integers to some registers. I know I can do this for type LONG. For example, I can use:
 
 movem.l (a1), a2-a5;
 
to move LONG type contents pointed by a1 to registers a2-a5. But how can I do the same thing for type WORD? movem doesn't support WORD.
 
Thanks a lot.
King
Labels (1)
0 Kudos
1 Reply

49 Views
Specialist III

Hello

The Coldfire instruction set does not support multiple move instruction on word (16-bit).

If you need to move the LSW of different registers on the stack you will have to either use separate MOVE.W instruction for each register or use MOVEM.L and ignore the High Word when you are reading the value back.

I hope this helps.

CrasyCat

0 Kudos