Source/Destination values In Assembly Instructions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Source/Destination values In Assembly Instructions

1,192件の閲覧回数
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 返信

725件の閲覧回数
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 件の賞賛
返信