Re: HP-41 Advantage Pac AIP function, anyone? Message #2 Posted by Valentin Albillo on 7 Sept 2006, 9:31 a.m., in response to message #1 by Arne Helme
Hi, Arne:
I don't recall the exact specifics of how AIP works with all kinds of values in the X register, but some modification of this simple code I wrote for your sake will probably be what you need:
Stack contents
----------------------
X Y Z T L
----------------------
X Y Z T L
RCL d d X Y Z L recall all flags
X<>Y X d Y Z L bring back the former value in X
FIX 0 X d Y Z L specify no decimals
CF 29 X d Y Z L supress decimal point showing
INT IX d Y Z X truncate X to its integer part
ARCL X IX d Y Z X append it to the alpha register
Rdown d Y Z IX X bring back the flags
STO d d Y Z IX X restore all flags
X<> L X Y Z IX d restore the initial value of X
This code preserves the values in stack registers X,Y,Z that are there upon entry and leaves the integer part of the X value appended to the ALPHA register, without decimal point. Only T and LastX are lost and the display mode and number of decimal places are fully restored upon exit.
Best regards from V.
Edited: 7 Sept 2006, 9:36 a.m.
|