HP Forums
41 MCODE: PANAME ROM Bugs - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: 41 MCODE: PANAME ROM Bugs (/thread-177396.html)



41 MCODE: PANAME ROM Bugs - Ángel Martin - 01-22-2011

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 - J-F Garnier - 01-22-2011

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 - Ángel Martin - 01-22-2011

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 - Håkan Thörngren - 01-22-2011

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 - Ángel Martin - 01-22-2011

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 - Geir Isene - 01-22-2011

Go document :)


Re: 41 MCODE: PANAME ROM Bugs - J-F Garnier - 01-22-2011

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 - Ángel Martin - 01-23-2011

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 - Geir Isene - 01-23-2011

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