|
|
|
Important note:
|
int B[10] (We assumed array B have been defined)
B[4] = B[3] + B[7]; // Each array element is an int !!!
In assembler code:
movea.l #B,A0 * A0 = base address of array B
move.l 12(A0),D0 * Get the int type variable B[3] in D0
move.l 28(A0),D1 * Get the int type variable B[7] in D1
add.l D0,D1 * Add the two int type values together
* The sum is an int and is stored in D1
move.l D1,16(A0) * Store the int type value into B[4]
|
short B[10]; (We assumed array B have been defined)
B[4] = B[3] + B[7]; // Each array element is a short !!!
In assembler code:
movea.l #B,A0 * A0 = base address of array B
move.w 6(A0),D0 * Get the short type variable B[3] in D0
move.w 14(A0),D1 * Get the short type variable B[7] in D1
add.w D0,D1 * Add the two short type values together
* The sum is a short and is stored in D1
move.w D1,8(A0) * Store the short type value into B[4]
|
Notice that:
|