WORD type movement, and "movem" instruction

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

WORD type movement, and "movem" instruction

2,382 Views
king
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

720 Views
CrasyCat
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