|
Example of 2's complement code addtition:
11111111 (= -110)
+ 00000010 (= 210)
------------
00000001 (= 110)
|
|
1. ADD.B Src, Dn // Add the 8 bits 2's complement values in Dn + Src
// and store the 8 bits sum in Dn
2. ADD.W Src, Dn // Add the 16 bits 2's complement values in Dn + Src
// and store the 16 bits sum in Dn
3. ADD.L Src, Dn // Add the 32 bits 2's complement values in Dn + Src
// and store the 32 bits sum in Dn
|
Effect:
|
|
Important:
|
|
|
|
|
|
|
1. ADD.B Dn, Dst // Add the 8 bits 2's complement values in Dn + Dst
// and store the 8 bits sum in destination Dst
2. ADD.W Dn, Dst // Add the 16 bits 2's complement values in Dn + Dst
// and store the 16 bits sum in destination Dst
3. ADD.L Dn, Dst // Add the 32 bits 2's complement values in Dn + Dst
// and store the 32 bits sum in destination Dst
|
|
|
1. ADDA.W Src, An * Add the 16 bit value Src to the address reg An
* I.e.: An = An + Src(16 bits)
2. ADDA.L Sec, An * Add the 32 bit value Src to the address reg An
* I.e.: An = An + Src(32 bits)
|
|
In other words:
1. ADDA.W Src, An * Add the short (16 bit) Src to the address reg An
* I.e.: An = An + Src(16 bits)
is executed as follows:
Step 1: convert the short (16 bit) Src to an int (32 bits)
Step 2: add the (converted) result to address register An
|
|
Note:
|
|