#: 16828 S3/Languages
31-Oct-92 22:01:04
Sb: #16785-A bedtime story
Fm: Carl Kreider 71076,76
To: Mark Griffith 76070,41 (X)
I changed the struct size from 4 shorts to 3 shorts, or from 8 bytes to 6
bytes. The difference is that walking an array with pointers can be done by
addition. ie ++p can be leau 6,u in the case above. But using for (i = 0;
....) causes code like ldd i,s; pshs d; ldd #6; lbsr ccmult; addd p,s; tfr d,u;
then access the structure member. For random access to an array, using an index
is the only way, and array[i].elt is the same as *(array + i)->elt. The saving
is when doing linear processing.
Oh, the problem with going from 8 bytes to 6 was that three shifts is mul by 8,
but the compiler calls multiply for 6 rather than doing ((i << 2) + (i << 1))
which is exactly the same as (i * 6).
|