If initially the ColdFire registers contain d0 0xFFFEDCBF d
If, initially, the ColdFire registers contain: d0 = 0xFFFEDCBF d1 = 0x12348765 a0 = 0x8070A0B0 what will be the contents of these registers
(a) following the instructions,
move.b %d1,%d0
move.w %d0,%d1
(b) following the instructions (start fresh from the initial conditions. i.e. instructions in (a) are not executed before the following),
movea.w %d1,%a0 Could we use “move.w” instead? Why or why not?
move.b %a0,%d1 Is this a legitimate instruction?
Solution
a)
In this case the move Instruction works Directly on the data Regisrters.
move.b Copies a byte from source to destination.
move.w Copies a word from source to destination
So Initially data register contains: d0 = 0xFFFEDCBF d1 = 0x12348765.
b)
movea.w %d1,%a0 Could we use “move.w” instead? Why or why not?
Instead of movea.w %d1,%a0 move.w cannot be used.
Because for move.w the operation format is as below.
move.w <Source> <Destination>
and this Destination cannot be an A register, an immediate operand or a PC-relative address.Where as this must be a data alterable Node.
move.b %a0,%d1 Is this a legitimate instruction?
move.b %a0,%d1 --> This is a legitimate instruction. As for move souce can be a data register and/or an address register. There is no restriction on the source.
