Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

5. [8 points] If, initially, the ColdFire registers contain: d0-0x3456E8CA. dl-0

ID: 3877513 • Letter: 5

Question

5. [8 points] If, initially, the ColdFire registers contain: d0-0x3456E8CA. dl-0x88008ABB, a0 = 0x8FFB3CD I , what will be the contents of these registers following the instructions? (a) move.b%d0-%d1 move.I %dl,%d0 (b) (start fresh from the initial conditions. i.e. instructions in (a) are not executed!) movea.w %d0,%a0 Could we use “move.w” instead? Why or why not? move.w %a0,%dl Is this a legitimate instruction? Note: You may want to review description of move and movea instructions in the "ColdFire Family Programmer's Reference Manual" available for download on E-Class.

Explanation / Answer

Given,

d0 = 0x3456E8CA

d1 = 0x88008ABB

a0 = 0x8FFB3CD1

a.

move.b %d0, %d1

move.b instruction copies the lower byte of information from source to the destination register.

Syntax: move.b SOURCE DESTINATION

For the above instruction, the lower byte of Register %d0 will be copied to lower byte of Register %d1

So, the contents of the registers after this instruction will be,

d0 = 0x3456E8CA

d1 = 0x88008ACA

move.l %d1, %d0

move.l instruction copies entire 32-bit long word from source register to destination register

Syntax: move.l SOURCE DESTINATION

For the above instruction, the data in Register %d1 will be copied to lower byte of Register %d0

So, the contents of the registers after this instruction will be,

d0 = 0x88008ACA

d1 = 0x88008ACA

b.

movea.w %d0, %a0

movea.w sets the address register a0 to the lower 16-bits contents of source register

The data is sign-extended to 32-bits.

We cannot use move.w instruction because, move.w doesn't do sign-extension to 32-bits

move.w %a0, %d1

Yes. This instruction is legitimate. It copies the lower 16-bit word in Address register a0 to the lower 16-bits of Register d1

Hope this helps. Do upvote :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote