(42S) Why an AIP & no AFP? « Next Oldest | Next Newest »

 ▼ Sean McNamee Junior Member Posts: 38 Threads: 15 Joined: Jan 1970 11-10-2003, 03:39 PM The AIP cmd on the wonderful 42s puts the Integer Part into the Alpha reg, but there is no cooresponding Fractional Part cmd. I'm going to write it, if there's no built-in method. ▼ Raymond Del Tondo Posting Freak Posts: 1,841 Threads: 54 Joined: Jul 2005 11-10-2003, 05:52 PM Just do FP, then 1E2 * , then AIP ;-) Depending on the decimal places you want adjust the multiplicator. If the 42S had something like MANT, it would be even easier. Raymond Valentin Albillo Posting Freak Posts: 1,755 Threads: 112 Joined: Jan 2005 11-12-2003, 07:57 AM Sean posted: " 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. ▼ Sean Junior Member Posts: 24 Threads: 3 Joined: Jan 1970 11-12-2003, 05:18 PM OK, I wrote it: ```01 LBL "FP2A" 02 STO 01 03 RDN 04 STO 02 05 RDN 06 STO 03 07 RDN 08 STO 04 09 RDN 10 AIP 11 RCL 01 12 FP 13 X=0? 14 GT0 02 15 +"." 16 LBL 01 17 10 18 * 19 AIP 20 FP 21 X=0? 22 GTO 02 23 GTO 01 24 LBL 02 25 RCL 04 26 RCL 03 27 RCL 02 28 RCL 01 29 RTN ```

 Possibly Related Threads... Thread Author Replies Views Last Post 42s questions and 42s vs 35s snaggs 13 1,509 09-19-2011, 02:44 AM Last Post: snaggs Op-Amp Gain and Offset Design for the HP-67 Stefan Vorkoetter 6 588 12-05-2008, 10:57 AM Last Post: Tom Mathes AMP Rom for 71b PeterP 5 533 12-06-2007, 02:20 PM Last Post: PeterP HP-41 Advantage Pac AIP function, anyone? Arne Helme 5 546 09-07-2006, 04:19 PM Last Post: Namir

Forum Jump: