The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

41 MCODE: PANAME ROM Bugs
Message #1 Posted by 聲gel Martin on 22 Jan 2011, 6:49 a.m.

While looking at the PANAME source code (in search of exportable functions, I confess it) I noticed a few weird-looking code lines that may well be plain bugs.

They're on Port_Dependent calls within the same quad, which in theory should read like:

379
03C
addr

but they read like:

375
03C
addr

Did they have something else in mind or it's just an error? (if so, it's quite repetitive!)

This occurs in the following addresses:

Lower ROM: E16, E20
Upper ROM: 0A6, 0AF, 768, 783, 980, B53, B5E.

Edited: 22 Jan 2011, 6:49 a.m.

      
Re: 41 MCODE: PANAME ROM Bugs
Message #2 Posted by J-F Garnier on 22 Jan 2011, 12:37 p.m.,
in response to message #1 by 聲gel Martin

My Emu41 shows the code as :

8E16  375 03C      GSUBNC =GOSUBH

GOSUBH is a variant of the GOSUB entry point:

=GOSUBH
0FDD  260          SETHEX
=GOSUB
0FDE  1B0          C=STK
0FDF  330          CXISA
etc...

J-F

            
Re: 41 MCODE: PANAME ROM Bugs
Message #3 Posted by 聲gel Martin on 22 Jan 2011, 2:51 p.m.,
in response to message #2 by J-F Garnier

Thanks J-F. Pointing to the SETHEX line may not be of any help, as the address won't be properly calculated with the CPU in DEC mode!

So perhaps a superfluous step, or at worst an error (if SETHEX is not done prior to the call).

                  
Re: 41 MCODE: PANAME ROM Bugs
Message #4 Posted by H嶡an Th顤ngren on 22 Jan 2011, 3:43 p.m.,
in response to message #3 by 聲gel Martin

The two word GOSUB instruction (not label) does not care if the mode is in hex or dec, it works fine. The GOSUB routine (which picks up the third word) needs to be in hex mode so the alternative entry point ensures hex mode in case it was in dec.

Quote:
Thanks J-F. Pointing to the SETHEX line may not be of any help, as the address won't be properly calculated with the CPU in DEC mode!

So perhaps a superfluous step, or at worst an error (if SETHEX is not done prior to the call).


                        
Re: 41 MCODE: PANAME ROM Bugs
Message #5 Posted by 聲gel Martin on 22 Jan 2011, 4:19 p.m.,
in response to message #4 by H嶡an Th顤ngren

So effectively calling GOSUBH saves one code line, as there's no need to call SETHEX before it (as it happens with GOSUB). Nice trick...

                              
Re: 41 MCODE: PANAME ROM Bugs
Message #6 Posted by Geir Isene on 22 Jan 2011, 5:06 p.m.,
in response to message #5 by 聲gel Martin

Go document :)

      
Re: 41 MCODE: PANAME ROM Bugs
Message #7 Posted by J-F Garnier on 22 Jan 2011, 5:28 p.m.,
in response to message #1 by 聲gel Martin

Just wondering, do you have the *original* Paname source files, possibly with symbols and comments? It could be very interesting.

And BTW, there are bugs in the Paname module, related to the RGXTR and RGORD functions...

J-F

            
Re: 41 MCODE: PANAME ROM Bugs
Message #8 Posted by 聲gel Martin on 23 Jan 2011, 7:50 a.m.,
in response to message #7 by J-F Garnier

No, I don't have any original source code for any module, or the OS either - I wish! Imagine, all the dark corners documented and explained in plain light... mmm.

What I have is "blueprints", result of disassembling plus uncountable hours of code-smithing going over the listing. Some are posted at TOS (basically my own modules), and others are still being worked on. I did the CCD and the AECROM, the PANAME is next.

These are EXCEL documents, with hyperlinks to navigate between calls and subroutines. It's quite friendly in my opinion, albeit not everybody's cup of tea.

If you're interested I'll send you a copy once it's "done".

Cheers, 'AM

                  
Re: 41 MCODE: PANAME ROM Bugs
Message #9 Posted by Geir Isene on 23 Jan 2011, 12:32 p.m.,
in response to message #8 by 聲gel Martin

Me too. It will go up on the MCODE wiki :)


[ Return to Index | Top of Index ]

Go back to the main exhibit hall