|
SUB.B Src, Dn * Subtract the 8 bits values: Dn = Dn - Src
SUB.W Src, Dn * Subtract the 16 bits values: Dn = Dn - Src
SUB.L Src, Dn * Subtract the 32 bits values: Dn = Dn - Src
|
|
SUBA.W Src, An * Subtract the 16 bits values: An = An - Src
SUBA.L Src, An * Subtract the 32 bits values: An = An - Src
|
|
|
Example:
short B[10]; (We assumed array B have been defined)
===> Get the value of B[3] into register D0
In assembler code:
/* =========================================================
We want to access B[3]:
==> put base address in address register
========================================================= */
movea.l #B,A0 * A0 = base address of array B
* An address is 32 bits, so we use .l !!!
/* =========================================================
We put the values B[3] in data register D0
========================================================= */
move.w 6(A0),D0 * Get short (16 bits) variable B[3] into register D0
* We use an address register A0 because the
* indirect addressing mode 6(A0) NEEDS to use
* an address register
* We put the value into a data register D0
* because we want use the value in B[3] in computations !!!
|