|Re: (42S) Why an AIP & no AFP?|
Message #3 Posted by Valentin Albillo on 12 Nov 2003, 7:57 a.m.,
in response to message #1 by Sean McNamee
" Why an AIP & no AFP?"
AIP is an utility function taken from the Advantage ROM,
included just for convenience. Its intended use is to
quickly and effortlessly append a subindex extracted from the first part of a control number in nnn.mmm format to some matrix element in the Alpha register, for displaying or printing, such as "A(2)= 27.1023". Sample fragment of code (HP-41C, Advantage ROM):
50 LBLC loop to retrieve and display each coefficient
51 MRIJ recalls the current value of the index
52 "A" begins to form the prompt to display each coefficient
53 AIP ... appends the index to the prompt
54 "|-=" ... completes the prompt
55 MRR+ retrieves the value of the current coefficient from the vector
56 ARCL X ... appends the value of the coefficient to the prompt
57 PROMPT shows the value to the user and waits for execution to resume
58 FC? 10 are we done showing all coefficients ?
59 GTO C not yet, go back to display the next coefficient
Without AIP you'd need to disturb the control number (23.037) to take its integer part, change the display to FIX 0 and no decimal point, alpha-recall the resulting contents of X to append the first part of the control number to the alpha register, and then probably restore the previous FIX-n display, and RDN, LASTX to restore the control number to its previous state. Instead, a single AIP removes all that drudgery, doesn't disturb LASTX, and makes constructing alpha prompts that much more simple.
As it is, AFP does not exist, but if it did, it would proably do the same with the *second* part of the control number, i.e.: with 23.037 in the X register, some hypothetic AFP would append 37 to the contents of the Alpha register. That probably isn't what you intended.
Best regards from V.