|Re: another wp34s bug|
Message #4 Posted by Paul Dale on 12 June 2013, 6:32 a.m.,
in response to message #3 by Andrew Nikitin
What is rationale for not allowing A-L?
Think about it. The reasons are not that hard to figure out :-)
Start with X, Y, Z and T. Why not allow them to be part of a matrix?
L and I are also volatile. L is changed by some matrix operations which would be somewhat inconvenient. Thus, they can't be used.
A-D can be part of the stack and thus should also considered volatile. Even if they were allowed and the stack size were checked at runtime for their validity, they lie between registers T and L so wouldn't be useful for anything larger than a 4x1 vector or a 2x2 matrix. If you're dealing with matrices this small, you're unlikely to be pressed for register space.
For J & K, the best they could be used for is a two element vector. Allowing a matrix to cross from global registers to local ones is somewhat insane -- what happens when a new set of locals are allocated e.g.? However, there is also a technical reason for not allowing this unnatural merger: the matrix routines assume that each matrix is stored contiguously in memory and these aren't.
It can all be boiled down to the simple guideline: the lettered registers are all special. They shouldn't be considered part of the local or global registers. That you can indirectly address them in a contiguous manner is nice.