Source/Destination values In Assembly Instructions

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

Source/Destination values In Assembly Instructions

787 Views
kicchip
Contributor I

Hi,

 

Looking at different device families...

 

With AVR I'd use:

 

  <SomeInstruction> Destination , Source

  MOV r0,r1 ; move r1 into r0

 

With PIC I'd use:

 

 <SomeInstruction> Source , Destination

 MOV w0 , w1 ; move w0 into w1

 

For Freescale I'd use:

 

 <SomeInstruction> Source , Destination

 

I prefer "thinking" Source,Destination because it looks like stuff is moving from left to right so it's more intuitive (to me at least), and this is how I'd like to build my macros and explain to students.

 

But I'm not familiar with all freescale products, and products from other manufacturers, so would people agree that the Source,Destination is the most widely supported "way" at least for freescale products, do people know about other assembly languages that are popular that use the opposite way??

 

Any help, ideas thoughts welcome...Thanks

Labels (1)
0 Kudos
Reply
1 Reply

320 Views
bigmac
Specialist III

Hello,

 

I am not familiar with all the Freescale products either.

 

But perhaps the original "thinking" might have been somewhat connected to the endianness of each product.  The Freescale product is big endian, whereas the AVR product appears to be little endian, where the address byte sequence is "reversed".

 

I seem to recall that the Intel CPUs were similar to the AVR, but I am not entirely certain.

 

Regards,

Mac

 

0 Kudos
Reply