Post Reply 
Power-of-two fraction handling for the 41C
02-01-2016, 11:24 PM
Post: #13
RE: Power-of-two fraction handling for the 41C
(02-01-2016 09:10 PM)Dieter Wrote:  
(02-01-2016 06:47 PM)quantalume Wrote:  Well, it would be easy enough to put a RCL d, STO 01 at the start of the program. However, by doing a RCL 01, STO d after the last ARCL, I lose one of the results off the top of the stack that Dieter is returning. It could be done, but it messes up his elegant program.

The problem is not the messed up stack – this can be avoided by using X<> commands. The problem is that both RCL and X<> normalize numbers, so that the original content of register d that was saved here, is altered before it can be stored back in d. This does not happen on the stack or in status registers, but the complete stack is used by the program.

Ok, I was operating under the assumption that the register only becomes normalized when you try to use it in an arithmetic operation. The PPC ROM has a couple of functions for saving and restoring display mode, but unfortunately they utilize the alpha register. Seems like the best bet is to keep the flags on the stack.

David Brunell
Houston, Texas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Power-of-two fraction handling for the 41C - quantalume - 02-01-2016 11:24 PM



User(s) browsing this thread: 1 Guest(s)