Source/Destination values In Assembly Instructions

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Source/Destination values In Assembly Instructions

812 次查看
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

标签 (1)
0 项奖励
回复
1 回复

345 次查看
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 项奖励
回复