Section 02 Part 03 – The SWAP Instruction

 

People say to me, Would you like to swap your life with me for 24 hours? Your life must be very strange. But of course I have not experienced any other life. It's not strange to me.” ~Prince Andrew

 

 

 

Introduction

 

SWAP – SWAP register halves

 

This instruction will swap the upper word with the lower word of a data register.

 

 

 

Examples

 

Say data register “d0” contains 2222EEEE, after this instruction

 

          swap      d0

 

Data register “d0” will contain EEEE2222.  And as you can probably tell, the upper word “2222” has been swapped over with the lower word “EEEE”.

 

Here are a few more examples:

 

 

It is pretty straight forward, nothing more.  This instruction will only work on data registers, it will not work for address registers, or memory, or anything else.

 

 

 

Previous Part

Main Page

Next Part