Post Reply 
HP BASIC (Series 200/300): Detokenizer
09-16-2017, 11:22 PM
Post: #1
HP BASIC (Series 200/300): Detokenizer
I received a question from a person who has some floppy disks containing HP BASIC programs; He wonders wether it is possible to read these programs on a modern PC.
The first problem can easily be solved: A program like HPDir or the old LIF Utils can help to copy the files from LIF to FAT (DOS) formatted disks.
But then: The Basic programs normally were not saved in ASCII - Format, but in tokenized PROG format.
So the question is: Is there a de-tokenizer program available ( for free, preferably) that translates HP series 200/300 BASIC (version 5 or 6) programs into simple ASCII text? I faintly remember that I read about such a tool, but where?
Find all posts by this user
Quote this message in a reply
09-17-2017, 12:16 AM
Post: #2
RE: HP BASIC (Series 200/300): Detokenizer
If you have a 200/300 system available load the program then use the "SAVE" command to write it out to disk, this saves the program as ASCII text.

Paul.
Find all posts by this user
Quote this message in a reply
09-17-2017, 12:45 AM
Post: #3
RE: HP BASIC (Series 200/300): Detokenizer
I tried to do a de-tokenizer for HP-71 BASIC, alas it is unfinished and will probably stay unfinished, more than 400 lines of code, untouched since 3/20/17. It is part of my LIFDIR (running on mainframes) to have a look to the content of LIF disks dumps. I do not have enough documentation or do not understand enough of the papers I have at hand. What I try to tell you, such a de-tokenizer of HP BASIC is quite some work, more work than I expected.

When I told a friend what I am about he laughed at me. His suggestion was - put that file in question to an HP71 (emulated of cause) and print that BASIC to a file. No need to re-invent the wheel.

Ciao.....Mike
Find all posts by this user
Quote this message in a reply
09-17-2017, 10:52 AM
Post: #4
RE: HP BASIC (Series 200/300): Detokenizer
@ Paul:
Yes, of course, I could do that as I have got working HP 300 series systems; but I am looking for a solution for people who have no (more) access to vintage hardware ( only some old floppy disks).

@ Mike:
Using an emulator is a good idea. I just have read that the emulator for series 200 machines by Olivier De Smet supports (boots) BASIC up to version 5.0. The floppy disks that should be translated probably were used on a (much) more modern 9000/375; I am afraid at least BASIC 6.2 was in use at that time.
Does anyone know of a series 300 emulator, or whether Olivier plans to develop further his emulator? On the real 9836 machine you can use BASIC 6.2 as well.
Maybe BASIC 6.x just hasn't been tested yet on Olivier's emulator. Did anyone try this out meanwhile? The latest information I found about the emulator dates from beginning of 2011. Maybe BASIC 6.2 wasn't easily available for download at that time.
Find all posts by this user
Quote this message in a reply
09-17-2017, 06:25 PM
Post: #5
RE: HP BASIC (Series 200/300): Detokenizer
Olivier De Smet claims series 200 are working, 9816, 9836, 9836C and 9837 are ok, actually (no date given) also series 300, but 310 only. Alas no way to test it as Olivier offers no download. Did you get an answer from him yet? Some time ago he was so kind to give me a 'font' (vectorized character set) he uses in his HP7470A simulation.

Ciao.....Mike
Find all posts by this user
Quote this message in a reply
09-18-2017, 03:24 PM (This post was last modified: 09-18-2017 03:25 PM by Martin Hepperle.)
Post: #6
RE: HP BASIC (Series 200/300): Detokenizer
There is a detokenizer for the Integral Technical Basic at
http://insar.stanford.edu/~lharcke/programming/
which could be useful for starting. But one would also need a means to read the LIF formatted floppy disk.

The best way is probably, as already mentioned, to go through a SAVE statement using the real thing or printing to a laptop via a serial interface.

Martin
Find all posts by this user
Quote this message in a reply
09-21-2017, 12:06 AM
Post: #7
RE: HP BASIC (Series 200/300): Detokenizer
@ Mike:
I found a download source for Olivier's emulator; just google "Smet 9836 emulator". But I didn't test it yet.
@ Martin: Thanks for the link. I am not sure whether HP-UX Technical BASiC uses the same file formats and BASIC tokens as Workstation BASIC?
The guy who wants his old BASIC programs transformed into ASCII text didn't get back to me. So it seems it's not that important for him. Since I could use SAVE on vintage hardware for that purpose, I won't investigate that any further.
Thank you guys for your hints!
Find all posts by this user
Quote this message in a reply
11-02-2017, 02:13 PM
Post: #8
RE: HP BASIC (Series 200/300): Detokenizer
(09-18-2017 03:24 PM)Martin Hepperle Wrote:  There is a detokenizer for the Integral Technical Basic at
http://insar.stanford.edu/~lharcke/programming/
which could be useful for starting. But one would also need a means to read the LIF formatted floppy disk.

I am not sure about the integral detokenizer, but the HP-85 and HP-87 are more works in progress. They can identify the tokens, but the arguments are left as an exercise to the reader.

So you'll get something out of the program, but it will not be a listing that you can feed to another BASIC system.

I too tried to fix this, but its a lot of work, and as Martin pointed put, you just feed it to an (emulated) computer and get the listing.

**vp
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)