Re: bit manips on WP 34S Message #5 Posted by Paul Dale on 6 Oct 2013, 2:50 a.m., in response to message #1 by Kiyoshi Akima
The arguments were added to the various bit manipulation commands because they were more powerful that way. We did consider 16C compatibility. We had all the 16C commands at one point then the argument versions were added and finally the now redundant 16C commands were removed. At the time, I came up with an alternative to support the 16C commands via library routines but it got lost somewhere along the way.
Using RLn as an example, define this function and save it to library flash space:
LBL'RLn'
x<-> Y
RL -> Y
x<-> Y
DROP
RTN
In your program, XEQ'RLn' and goodness will follow.
I intended DROPY instead of x<>y and DROP here but that command was removed. Subsequently, local registers were added so the fragment could also be:
LBL'RLn'
LocR 001
STO .00
DROP
RL -> .00
RTN
This is the same number of steps and uses more stack space although it extends more easily.
If you define all the required 16C functions that are missing similarly and save them into a library, porting your old programs will be a breeze. We should probably have included something like this in the 34S's standard library.
As for SDL and SDR, we never considered them for integer mode. In real mode, these commands are extremely fast -- they add their argument to the number's integer exponent and don't do any floating point arithmetic. In integer mode, they really should shift one digit as per the current base rather than being a multiply or divide by ten. Still, they could be added but it would consume valuable space.
Walter shot down storage register exponentiation. I suspect the same would have happened to storage register logical operations. At least we've got storage register minimum and maximum.
- Pauli
|