The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

HP-75 Docs
Message #1 Posted by Howard Owen on 3 Sept 2005, 10:54 a.m.

I'm trying to write a filter to convert HP-75 BASIC files directly into text. (Sort of an external TRANSFORM INTO TEXT command.) While a certain amount of reverse engineering of the file format and BASIC tokenisation is fun, a lot of it is pretty tedious. I was reading CHHU V1N2, and came across an article by Michael Markov entitled "Synthetic Programming on the HP-75". In it, he refers to documents I had seen other references to, the "HP-75 Description" or "HP-75 NOMAS". I already suspected that this could be helpful to me, and this CHHU article specifically mentioned "The HP-75 Byte Table (The Token Table)" on pp 24-30 of the NOMAS. The NOMAS documents aren't on the museum DVD. Does anyone have digital copies? If not, can someone lend me physical copies to scan and make available?

Thanks,

      
Re: HP-75 Docs
Message #2 Posted by Tony Duell on 3 Sept 2005, 2:12 p.m.,
in response to message #1 by Howard Owen

I have the NOMAS stuff, on paper. Alas I have no scanner...

Anyway, I sort-of looked into to doing what you want to do. Be warned that it's not that simple -- it's not just a simple tokenisation. From what I remember, it's almost reverse-polish in places.

The table has some examples, and working out how they translated them is not at all obvious!

            
Re: HP-75 Docs
Message #3 Posted by Howard Owen on 3 Sept 2005, 4:23 p.m.,
in response to message #2 by Tony Duell

Thanks for the response, Tony.

That's sort of what I figured, which was why I was hoping I could get the NOMAS stuff in digital form. Just looking at the bits, I've figured out a little. I have the following program:

0010 ! Just a bang comment
0020 REM This one is a rem
0030 I=1 ! i=1
0040 I$="1" ! i$="1"
0050 DIM A(20) ! dim a(20)
0060 DIM A$(20) ! dim a$(20)
0070 DIM B$[20] ! dim b$[20]
0080 J=1 @ I=2 @ K=J+I ! j=1@i=2@k=j+i
0090 DISP K ! disp k
0100 GOTO 10
0110 GOSUB 10
0120 IF A=1 THEN GOTO 10
0130 END

I've decoded part of the BASIC75 file like so:

?0000  05 86 c5 00  fe 42 a4 4a  a7 0a  header
 000a  77 6f 72 6b 66 69 6c 65          filename "workfile"
?0012  00 00 00 00 00 00  00 00 00 00   10d nulls. Padding?
 001c  10 00                            line number 10 (little endian 16 bit bcd )
 001e  17                               Distance to next instruction.
*001f  8b 06 13                         Token for bang comment
!0022  4a 75 73 74 20 61  20 62 61 6e   Comment text 'Just a bang comment'
!002c  67 20 63 6f 6d 6d 65 6e 74
 0035  0e                               End of line 10
 0036  20 00                            Line number 20
 0038  15                               Distance to next instruction.
*0039  83 06 11                         Token for rem comment
!003c  54 68 69 73 20 6f 6e 65  20 69   Comment text 'This one is a rem comment"
!0046  73 20  61 20 72 65  6d
 004d  0e                               End of line 20
 004f  30 00                            Line number 30
 0051  0f                               Distance to next instruction.
*0052  11 20 49 1a 01 00 00             Tokens for "I=1!"
*0059  08 8b 06 03
!005c  69 3d 31                         Comment text "i=1"
 005f  0e                               End of line 30
 0060  40 00                            Line number 40
 0062  11                               Distance to next instruction.
*0063  13 20 49 05 01 31                Tokens for 'I$="1"!'
*0069  07 8b 06 06
!006d  69 24 3d 22 31 22                Comment text 'i$="1"'
 0073  0e                               End of line 40
 0074  50 00                            Start of line 50
 0076  16                               Distance to next instruction.
*0077  88 02 20 41 1a 20 00 00 0b       tokens for "dim a(20)!"
*0080  8b 06 09
!0083  64 69 6d 20 61 28 32 30 29       Comment text 'dim a(20)'
 008c  0e                               End of line 50
 008d  60 00                            Start of line 60
 008f  1d                               Distance to next instruction.
*0090  88 b4 65 40 1f 20 41 1a          Tokens for 'dim a$(20)
*0098  20 00 00 b4 65 40 23 8b 88 03
!00a2  64 69  6d 20 61 24  28 32 30 29  Comment text 'dim a$(20)
 00ac  0e                               End of line 60
 00ad  70 00                            Start of line 70
 00af  17
*00b0  88 03 20 42 1a 20 00 00 1d 8b    Tokens for "dim b$[20]"
*00c4  06 0a
 00c6  0e
 00c7  80 00                            Start of line 80
 00c9  2e
*00ca  11 20 4a 1a 01 00 00 08 40       Tokens for 'J=1@'
*00d3  11 20 49 1a 02 00 00 08 40       Tokens for 'I=2@'
*00dc  11 20 4b 01 20 4a 01 20 49       Tokens for 'K=J+I'
*00e5  2b 08 8b 06 0d

First column is '*' for BASIC tokens, '!' for comment text and ? for stuff I'm not sure of. The next four columns are hex offset from the beginning of file. Next come an arbitrary number of hex digits representing the bytes at the indicated addresses, followed by a discussion of what I think they mean.

I could continue in this vein, modifying the source to illuminate particular points. I'd stand half a chance if I could stay awake! It just seems easier to ask the world if there isn't a shortcut. I like shortcuts. 8)

Edited: 3 Sept 2005, 4:24 p.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall