#C and Assembler
I believe that the Manx assembler only substitutes bsr for jsr and short
branches for long branches where possible and removes unnecessary movem
instructions. Frankly, that's not much. I was hoping that the compiler
would be alittle smarter.
The compiler seems to treat each C statement as if it existed in a vacuum.
It never takes advantage of results obtained in previous statements unless
you explicitly write the C code to do it. This was the most important
lesson I learned. It is well worth storing difficult to calculate
intermediate results if they will be used more than once. Even the values
of multidimentional array elements fall into this category.
It was interesting to see the effects that using register variables had.
Here's a question for you, if you're using a register variable as an array
index, should it be a UBYTE, a USHORT or a ULONG? Assume, of course, that a
UBYTE can represent the range of the index.