![]() |
need help with FCAT program for HP 42S - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: need help with FCAT program for HP 42S (/thread-21773.html) |
need help with FCAT program for HP 42S - ELye - 05-21-2024 06:11 AM In the HP-42S RPN Scientific Programming Examples and Techniques manual, Edition 1 July 1988, page 54, program FCAT line : 50 LBL 14 what is the purpose of this line? I spent 4 hours keying in this program - GTO A is hardly intuitive. My first and previous calculator was the 32S and the 42S (actually Free42) is several levels more complex. So I am relearning with a view to writing a superior circle-triangle-circle program with all the bells and whistles. FCAT seemed a good program to learn from but this step has me stumped. Was there an erratum about this? Thanks. RE: need help with FCAT program for HP 42S - ThirdPoliceMan - 05-21-2024 04:21 PM After a cursory glance at page 54 of ‘Programming Examples and Techniques’, it can be assumed that in the case of this programme (and only for this programme) it will be a kind of placeholder for ‘Do nothing’. RE: need help with FCAT program for HP 42S - Thomas Klemm - 05-21-2024 05:56 PM For those who want to try the program: Code: 00 { 234-Byte Prgm } RE: need help with FCAT program for HP 42S - Allen - 05-22-2024 01:26 AM Appears to be a NO-OP. Curiously, there is also a >LBL 14 at line 53 of FL (see p. 168) of the PPC ROM manual. RE: need help with FCAT program for HP 42S - Thomas Klemm - 05-22-2024 07:17 AM If you wonder why LBL 14 is used and not LBL 99 to indicate a NO-OP: it is the highest one-byte label. From LBL 15 on they consume two bytes. And then they give the precious byte away with a useless use of a RTN statement: Code: 89 RTN RE: need help with FCAT program for HP 42S - Joe Horn - 05-23-2024 12:17 AM (05-22-2024 07:17 AM)Thomas Klemm Wrote: If you wonder why LBL 14 is used and not LBL 99 to indicate a NO-OP: it is highest one-byte label. Although END returns from a subroutine the same way as RTN, RTN is a tad faster, which is especially noticeable when the subroutine is called many times in a loop. So RTN END is not a useless waste of one byte, but rather slightly improves execution time. RE: need help with FCAT program for HP 42S - Thomas Klemm - 05-23-2024 12:51 AM (05-23-2024 12:17 AM)Joe Horn Wrote: So RTN END is not a useless waste of one byte, but rather slightly improves execution time. To make up for this, a pause was added beforehand: Code: 88 PSE RE: need help with FCAT program for HP 42S - rprosperi - 05-23-2024 02:55 AM (05-23-2024 12:51 AM)Thomas Klemm Wrote:(05-23-2024 12:17 AM)Joe Horn Wrote: So RTN END is not a useless waste of one byte, but rather slightly improves execution time. This made me laugh out loud. ![]() I'm only glad my wife didn't hear, can you imagine trying to explain why this is funny to a non-calculator nerd... RE: need help with FCAT program for HP 42S - ELye - 05-23-2024 04:35 AM Thanks for the answers. Pg 131 of the owner's manual states: "Without the PSE instructions (lines 03 and 06) the program would run too fast to see the first two messages. A PSE is not needed after the last AVIEW because the viewed information remains in the display after the program stops. " So in the case of FCAT, the PSE is unnecessary. According to my deconstruction of FCAT, LBL 12 is a subroutine so it may be entered elsewhere thus RTN is required there. Regardless, I have enough OCD to require that. Wow, we now have a working FCAT that is 231 bytes in size. I wonder how the exalted HP engineers/editor missed these? Or is this a test ? Should I expect an invite into a secret society? RE: need help with FCAT program for HP 42S - ELye - 05-23-2024 06:56 AM Erratum: 88 PSE turns out to be necessary. If you attempted to set/clear a system flag, the 87 AVIEW would be rapidly replaced by 20 "FLAG CATALOG" I saved one byte. I don't think there is anything else to add to this thread. PS I worked for IBM, 30 years. RE: need help with FCAT program for HP 42S - ELye - 05-28-2024 06:04 AM (05-22-2024 01:26 AM)Allen Wrote: Appears to be a NO-OP. You are absolutely right. See attached jpg. |