Post Reply 
HP BASIC (Series 200/300): Detokenizer
07-30-2019, 07:30 AM
Post: #10
RE: HP BASIC (Series 200/300): Detokenizer
Solved.

I create a hex dump of the original LIF floppy disk using LIF utilities for dos in a vintage computer, then convert the hex dump to a binary LIF image usinge the Olivier De Smet (Thanks Olivier) Python program. Then I load the diskette in Olivier simulator, use the BASIC SAVE command to store a ASCII program file, I save the LIF image and extract the file with LIF utilities.

The ASCII file must be converted in text format, i use the followin QB64/QB45 code

CLS
DIM h AS STRING * 1


INPUT "file lif: ", a$
INPUT "file txt: ", B$

OPEN a$ FOR RANDOM AS #1 LEN = 1

OPEN B$ FOR OUTPUT AS #2
flag = 0
n = 0
WHILE NOT EOF(1)
n = n + 1
GET #1, n, h
i = ASC(h)
IF flag = 1 AND i >= 48 AND i < 58 THEN
flag = 0
END IF

IF i > 31 AND i < 126 AND flag = 0 THEN
PRINT #2, h;
ELSE
IF i = 0 THEN
PRINT #2, CHR$(13)
flag = 1
n = n + 1
END IF
IF i = 255 THEN
PRINT #2, "<FF>";
END IF
END IF
WEND
CLOSE #1
CLOSE #2

The resulting file is nor perfect, ma the task is done.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP BASIC (Series 200/300): Detokenizer - gintilisano - 07-30-2019 07:30 AM



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