Section 01 Part 07 – Homework Results 01

 

“Sex education may be a good idea in the schools, but I don't believe the kids should be given homework.” ~Bill Cosby

 

 

 

Introduction

 

In the previous part, I gave you a list of instructions for you to test your knowledge.  In this part, we’ll go through each instruction to show you the answer to see if you got it right.

 

 

 

Results

 

          move.w    #$0123,d0

          move.b    d0,d1

          move.w    d1,d2

          move.l    #$FFFF0000,d3

          move.w    d0,d3

          move.l    d3,d0

          move.w    d2,d0

 

So, like I said; all of the data registers will start with 00000000.

 

          move.w    #$0123,d0

 

The word 0123 is moved into d0, d0 now contains 00000123.

 

          move.b    d0,d1

 

A byte from d0 is copied over to d1.  “23” is copied over, and d1 now contains 00000023.

 

          move.w    d1,d2

 

A word from d1 is copied over to d2.  “0023” is copied over, and d2 now contains 00000023.

 

          move.l    #$FFFF0000,d3

 

The long-word FFFF0000 is moved into d3, d3 now contains FFFF0000.

 

          move.w    d0,d3

 

A word from d0 is copied over to d3.  “0123” is copied over, and d3 now contains FFFF0123.

 

          move.l    d3,d0

 

A long-word from d3 is copied over to d0.  “FFFF0123” is copied over, and d0 now also contains FFFF0123.

 

          move.w    d2,d0

 

A word from d2 is copied over to d0.  “0023” is copied over, and d0 now contains FFFF0023.

 

And there you have it, after all of those instructions, d0 contains FFFF0023.  Did you get it right?  I sure hope so, if not, try going through the guide again.

 

 

 

Previous Part

Main Page

Next Part