Post Reply 
HP-71 PLEX & LEXCAT
11-04-2020, 02:02 PM (This post was last modified: 11-04-2020 03:54 PM by KimH.)
Post: #1
HP-71 PLEX & LEXCAT
NEVER MIND - Sorry!

In the DATAFILE V8N4 P28 I found the answer - it was PEEKUTIL which had the XFN920##



in the amazing Online-LIF-Disk-Project archive I have searched for and found a function in the CHUU02, PLEX, which is a Basic program (By John Baker). I have "CALL"ed it.
It generates a long and interesting list for each LEX-File I have on my TITAN.

I tried MATHLEX and ULIB52, just to learn

I can see each "function" the lexfile has, couldn't do that before, so that is cool!

BUT

I struggle to understand the significance of the various messages it generates. I was hoping to be able to see what type of arguments a function would require.

Example in ULIB52 is CLOCK. It can be used with ON/OFF or simply toggles without an argument/modifier.

Other functions like SYSTEM I am not able to decipher

Is there anyone of y'all who has a description of what PLEX is used for and how to read it?

I have also tried LEXCAT, but it has XROMS 92004 (could be REV$), 90002 and 92006 (??) etc, even worse, one of the functions I have on my EMU71 is called CPUV (the one which tells m whether the TITAN unit has a newer CPU) is recognized in the BASIC code Smile

No obvious way for me to tell what they could be - maybe there is a hint or even a list which I can use as X-Ref. I did try the JPC rom, could have been that one, but no.

Any help is appreciated

Code:
>LIST LEXCAT
10 INPUT 'LEX File: ';F$ @ CALL LEXCAT(F$)
20 SUB LEXCAT(F$) @ ON ERROR GOTO 290 @ Y=NOT LEN(F$) @ IF Y THEN 60
30 IF XFN92004(HTD(ADDR$(F$))+16,2)#8 THEN DISP 'ERR:Not LEX file' @ END 
40 S=HTD(ADDR$(F$))+37 @ F$=(F$&RPT$(" ",7))[1,8]
50 C=S+25+NOT XFN92004(S+11)*79 @ T$=DTH$(C)&XFN92006(S,6) @ GOTO 90
60 A=HTD(XFN113001('BFC'))+7 @ ON ERROR GOTO 100
70 T$=XFN92006(A,11) @ C=HTD(T$[1,5]) @ F$=XFN92007(C-62-NOT XFN92004(C-14)*79,8)
80 P$=ADDR$(F$) @ PRINT 
90 PRINT F$;
100 PRINT TAB(11);"ID=";T$[10] @ M=HTD(T$[8,9]) @ B=XFN92002(C-13,4)
110 IF XFN92004(C-5,5) THEN PRINT "(";CPUV(C-5,5);")  Poll Handler"
120 IF XFN92004(B,2)=255 THEN 300
130 L=XFN92004(B-1)+1 @ W$=XFN92007(B,L/2) @ S$=XFN92006(B+L,2) @ D=C+(HTD(S$)-M)*9
140 PRINT "(";CPUV(D+3,5);") "; @ B=B+L+3
150 IF NOT HTD(S$) THEN PRINT " -- ";W$;" ffn" @ GOTO 120
160 PRINT " ";S$;" ";W$; @ E=XFN92004(D+8) @ IF NOT E THEN PRINT " postfix" @ GOTO 120
170 IF E#15 THEN 250
180 E=RMD(XFN92002(D+3,5,-2),1048576) @ P=XFN92004(E) @ Q=XFN92004(E+1)
190 IF Q THEN PRINT "("; ELSE PRINT " fn" @ GOTO 120
200 FOR I=1 TO Q @ IF I#1 THEN PRINT ",";
210 E=E-1 @ X=XFN92004(E) @ IF I>P THEN PRINT "?";
220 IF X>11 THEN PRINT "#/$"; ELSE IF X>7 THEN PRINT "#"; ELSE PRINT "$";
230 IF RMD(X,4) THEN PRINT "()";
240 NEXT I @ PRINT ")" @ GOTO 120
250 IF NOT BIT(E,3) THEN PRINT " ~P";
260 IF NOT BIT(E,2) THEN PRINT " ~I";
270 IF NOT BIT(E,0) THEN PRINT " ~K";
280 PRINT @ GOTO 120
290 DISP 'ERR:';ERRM$ @ BEEP @ END 
300 IF KEY$="#38" THEN END 
310 IF NOT HTD(T$[10]) THEN END 
320 IF Y THEN A=A+11 @ GOTO 70
330 IF XFN92004(S+6,5) THEN S=XFN92002(S+6,5) @ F$='' @ GOTO 50
Find all posts by this user
Quote this message in a reply
11-04-2020, 03:55 PM
Post: #2
RE: HP-71 PLEX & LEXCAT
PLEX prints the argument types and options for each statement added in the LEX, these are described in the IDS, Vols I & II.

It's too much to explain here, so I'll suggest you capture part of a printout and post it below with some specific questions.

I beta tested this when John was writing it, it was great fun (with only a few MEM LOST :-) ). For such a sophisticated program, John got it right in an impressively short amount of time, he was an amazing 71B guru. His articles in the PPC and CHHU Journals about the 71B internals and how to use the IDS are valuable if you're looking into this stuff.

The SYSTEM keyword was written by HP and they shared the source code and I somehow got a copy; I'm not sure why it wasn't more widely available but it seems it was not well known. I was in PPC and attended HHC meetings in the 80's etc., but otherwise had no specific inside connections; I siimply don't recall exactly when and where I got it. The source listing is available in a PDF on JFG's wesbite, here's a link:

http://www.jeffcalc.hp41.eu/emu71/files/systemfn.pdf

Look on this page on his site for more LEX stuff, specifically in the ULIB52 section.

You'll see that this function was exhaustively documented in incredible detail, presumably in an attempt to richly illustrate how to write LEX files with sophisticated features; this function can be easily extended (if you write 71 assembler) to add your own parameters.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
11-04-2020, 04:11 PM
Post: #3
RE: HP-71 PLEX & LEXCAT
LEXCAT requires the PEEKUTIL lexfile. Although it outputs a lot of useful information about lexfiles and their commands, it only outputs information which is easily looked up inside the lexfile, such as the number and type of function arguments. However, command options (which are not in parentheses after the command, e.g. "EXTEND" in OPTION EXTEND) are not as easily discerned and therefore LEXCAT makes no attempt to figure them out.

What follows is my writeup about it from The Titan File, published in HPX Exchange, V1 N3, May/Jun 1987.

RUN LEXCAT (or CALL LEXCAT(F$) with a filename in F$), and see the hex address of the specified lexfile, the address of its poll handler(s), the address of the next file, and all the keywords in the lexfile with their execution code address (entry point), lex ID and token number, and function syntax. This is an invaluable program for those of us who use lexfiles a lot. It is based on a program by HP, with a few more bells and whistles, cleaner output, and much faster thanks to PEEKUTIL.

If LEXCAT is run on SPLEX, you’ll see (with varying addresses):
*** SPLEX ***
(80008) File Header
(80077) Poll Handler
(800D5) 52/24 LIST$(#,?$)
(80281) 52/23 MODIFY
(808C4) Poll Handler
(80900) 53/55 MAXRC fn
(809F1) Next File Header

which means SPLEX’s file header begins at hex address 80008; its first poll handler begins execution at hex 80077; the LIST$ function starts execution at hex address 800D5, it has lex ID 52 (hex), token 24 (hex), and takes one numeric argument, followed by an optional string argument; the MODIFY keyword is a statement (no clue to its syntax!); there’s another poll handler at 808C4; MAXRC is a function with no arguments; and the file ends at 809F0.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
11-04-2020, 04:37 PM
Post: #4
RE: HP-71 PLEX & LEXCAT
Thanks! I will dive into the PDF and learn...

(11-04-2020 03:55 PM)rprosperi Wrote:  PLEX prints the argument types and options for each statement added in the LEX, these are described in the IDS, Vols I & II.

It's too much to explain here, so I'll suggest you capture part of a printout and post it below with some specific questions.

I beta tested this when John was writing it, it was great fun (with only a few MEM LOST :-) ). For such a sophisticated program, John got it right in an impressively short amount of time, he was an amazing 71B guru. His articles in the PPC and CHHU Journals about the 71B internals and how to use the IDS are valuable if you're looking into this stuff.

The SYSTEM keyword was written by HP and they shared the source code and I somehow got a copy; I'm not sure why it wasn't more widely available but it seems it was not well known. I was in PPC and attended HHC meetings in the 80's etc., but otherwise had no specific inside connections; I siimply don't recall exactly when and where I got it. The source listing is available in a PDF on JFG's wesbite, here's a link:

http://www.jeffcalc.hp41.eu/emu71/files/systemfn.pdf

Look on this page on his site for more LEX stuff, specifically in the ULIB52 section.

You'll see that this function was exhaustively documented in incredible detail, presumably in an attempt to richly illustrate how to write LEX files with sophisticated features; this function can be easily extended (if you write 71 assembler) to add your own parameters.
Find all posts by this user
Quote this message in a reply
11-04-2020, 04:38 PM
Post: #5
RE: HP-71 PLEX & LEXCAT
One more step forward, thanks for the explanation!

(11-04-2020 04:11 PM)Joe Horn Wrote:  LEXCAT requires the PEEKUTIL lexfile. Although it outputs a lot of useful information about lexfiles and their commands, it only outputs information which is easily looked up inside the lexfile, such as the number and type of function arguments. However, command options (which are not in parentheses after the command, e.g. "EXTEND" in OPTION EXTEND) are not as easily discerned and therefore LEXCAT makes no attempt to figure them out.

What follows is my writeup about it from The Titan File, published in HPX Exchange, V1 N3, May/Jun 1987.

RUN LEXCAT (or CALL LEXCAT(F$) with a filename in F$), and see the hex address of the specified lexfile, the address of its poll handler(s), the address of the next file, and all the keywords in the lexfile with their execution code address (entry point), lex ID and token number, and function syntax. This is an invaluable program for those of us who use lexfiles a lot. It is based on a program by HP, with a few more bells and whistles, cleaner output, and much faster thanks to PEEKUTIL.

If LEXCAT is run on SPLEX, you’ll see (with varying addresses):
*** SPLEX ***
(80008) File Header
(80077) Poll Handler
(800D5) 52/24 LIST$(#,?$)
(80281) 52/23 MODIFY
(808C4) Poll Handler
(80900) 53/55 MAXRC fn
(809F1) Next File Header

which means SPLEX’s file header begins at hex address 80008; its first poll handler begins execution at hex 80077; the LIST$ function starts execution at hex address 800D5, it has lex ID 52 (hex), token 24 (hex), and takes one numeric argument, followed by an optional string argument; the MODIFY keyword is a statement (no clue to its syntax!); there’s another poll handler at 808C4; MAXRC is a function with no arguments; and the file ends at 809F0.
Find all posts by this user
Quote this message in a reply
Post Reply 




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