PDP-10 / its

Incompatible Timesharing System
Other
858 stars 81 forks source link

PUB #841

Open larsbrinkhoff opened 6 years ago

larsbrinkhoff commented 6 years ago

.INFO.; PUB DOC
.INFO.; PUB RANDOM
.INFO.; PUB TIP
INFO; PUB TIPS
INFO; PUBXGP DOC
PUB; PUB2 LOADER
PUB; PUB DOC
PUB; PUB FILES
PUB; PUB FTP
PUB; PUB LOADER
PUB; PUB LOG
PUB; PUBMAC DFS
PUB; PUBMAC DOC
PUB; PUB PARC
PUB; PUB PUB
PUB; PUB SAILV
PUB; PUBSTD AIL
PUB; PUBSTD DFS
PUB; PUBSTD MAX
PUB; PUBSTD TES
PUB; PUBSUM 1
PUB; PUB TIPS
PUB; PUB UPD
PUB; PUB UPDATE
PUB; PUBXGP 49
PUB; PUBXGP DOC
PUB; PUBXGP XGP

Typesetting software.

larsbrinkhoff commented 6 years ago

Hello @nomodes,

PUB isn't forgotten! In this repository we have, or will have, documents prepared with PUB.

Thank you for providing this manual:
http://www.nomodes.com/pub_manual.html

larsbrinkhoff commented 6 years ago

Looks like these are the source files on Saildart:
https://www.saildart.org/[PUB,SYS]/

eswenson1 commented 6 years ago

I tried creating a TS PUB (and TS PUB2) from the PUB; PUB LOADER and PUB; PUB2 LOADER files (using STINK) as per the instructions in PUB; MAKE PUB, and produced the two executables.

However, attempting to run PUB on PUB; PUB PUB (documentation on PUB), gives me this:

:ejs;pub pub INVALID INDEX NO. 1 FOR ARRAY MONTH CALLED FROM 500134 LAST SAIL CALL AT 511104 ?

I seem to recall seeing email or an issue (authored by Lars?) that referenced this error, which presumably comes from one of the SAIL libraries or perhaps DECSYS; DECBOT BIN. Is this some Y2K issue.

I get the same error using a PUB; TS PUB that came off backup tapes and dated 1/9/1983, so it is not the result of attempting to link/load under the current ITS.

Any ideas on how to pursue this?

larsbrinkhoff commented 6 years ago

That rings a very faint bell. I think it was something with Fortran though, so probably Adventure.

larsbrinkhoff commented 6 years ago

I think maybe @atsampson was involved?

eswenson1 commented 6 years ago

Yes, we had a related issue with fortran/adventure (and I worked around it). But I thought we had it with dec/sail as well. Maybe misremembering.

atsampson commented 6 years ago

The months problem I looked at was #716. @eswenson1, any chance you could make the PUB; directory available on a branch or in its-vault?

eswenson1 commented 6 years ago

Done. I added a "pub" directory under "files".

atsampson commented 6 years ago

The only code in PUB that indexes MONTH looks reasonable, using the TOPS-10 date format:

K _ CALL(0, "DATE") ;
VARASSIGN("MONTH", (STR1 _ MONTH[K DIV 31 MOD 12 + 1])[1 TO ^N-1]) ;
VARASSIGN("DAY", STR2 _ CVS(K MOD 31 + 1)) ;
VARASSIGN("YEAR", STR3 _ CVS(K DIV 31 DIV 12 + 1964)) ;
VARASSIGN("DATE", STR1 & STR2 & ", " & STR3 );

But DECUUO's implementation of the DATE call looks dodgy:

        .RDATE B,
[...]
        MOVE C,[440600,,B]
        PUSHJ P,POOF    ;YEAR  [converts BCD to binary]
        SUBI D,64.      ;THIS PROGRAM WILL NOT WORK IN 28 YEARS

RDATE only returns two BCD digits' worth of year, so I guess DECUUO's DATE will produce nonsense after 2000 (and the comment above was presumably written circa 1972!).

larsbrinkhoff commented 5 years ago

@36bit wrote in https://github.com/PDP-10/its/issues/427#issuecomment-390060975:

The book about the Muddle programming language says:

This document was prepared using the PUB system (originally from the Stanford Artificial Intelligence Laboratory) and printed on the Xerox Graphics Printer of the M.I.T. Artificial Intelligence Laboratory.

larsbrinkhoff commented 5 years ago

The TOPS-10 DATE call returns a 15 bit value encoded as

(day of month -1) + 31 * [(month -1) + 12 * (year -1964)]

This is good until February 1st, 2052.

larsbrinkhoff commented 5 years ago

A fix for the DATE problem is in the works.

larsbrinkhoff commented 5 years ago

Seems to work:

:stink pub loader
STINK.201

..start/   JRST S.   120/   0   ,,$1q
$$1l decsys; decbot bin
*56/   JOBUUO   1200
:pdump lars; ts pub
*$j PUB$J
*$^X.
*:cwd pub
*:lars;pub pub; pub pub
*^C
*

The ^C I typed was to PUB's * prompt.

larsbrinkhoff commented 5 years ago

Sorry, I should have entered the document name to PUB. No progress:


:cwd pub
*:lars;pub
*pub
INVALID INDEX NO. 1 FOR ARRAY MONTH
CALLED FROM 500134  LAST SAIL CALL AT 511104
?
larsbrinkhoff commented 5 years ago

Examining the code at 500134. It looks very much like part of the statement @atsampson posted:
VARASSIGN("MONTH", (STR1 _ MONTH[K DIV 31 MOD 12 + 1])[1 TO ^N-1]) ;

Clearly the code checks for an index < 2. But why wouldn't 1 be a valid index?


500126/   IDIVI 1,37   
500127/   IDIVI 1,14   
500130/   ADDI 2,1   
500131/   MOVE 5,2776   
500132/   CAML 2,-5(5)   
500133/   CAMLE 2,-4(5)   
500134/   7040,,505323   
atsampson commented 5 years ago

Also, it isn't January. What value does K have after the UUO call? (I guess you could either add a line to the SAIL code to print it or look at it in DDT...)

larsbrinkhoff commented 5 years ago

Sorry, I was confused by the "2" indicating an accumulator.

-5(5) is 0 and -4(5) is 14 (octal). So this seems ok.

larsbrinkhoff commented 5 years ago

Good question.

I'm not at a point where I can run the SAIL compiler, though.

atsampson commented 5 years ago

I guess I'm assuming that "INDEX NO. 1" means the value of the index is 1, when it could just mean "the first index is invalid". So it'd be worth looking at the values of ACs 1 and 2 as you step through the code from 500126...

larsbrinkhoff commented 5 years ago

I wonder if the message means that the index is 1, or if the first array index is bad? The contents of AC2 is 100.

Well, I set a breakpoint on the first IDIVI, and apparently AC1 is 777777737432 at that point.

larsbrinkhoff commented 5 years ago

Silly me! After some debugging I saw an .RDATE call. Turns out I forgot to make the purified TS DEC which is what PUB maps in.


:lars;pub
*pub
PUB  1
Source!file PUBSTD DFS COMMON; not found.
Read file: 
larsbrinkhoff commented 5 years ago

I made a link for the file above.

*pub
PUB  1
Undefined Identifier EQUIVALENCE
Line/Page COMMON;PUBSTD DFS 48/1[]
^

The text in the PUBSTD DFS file is:


.MACRO BUGOFF ^P DEBUGFLAG _ 0 ; ^Q
.FONT EQUIVALENCE
."FIX",         "GACHAM",       "GACHA10",
."SER",         "METEORM",      "METEOR10",
larsbrinkhoff commented 5 years ago

Tessler writes:

Also the last part of my PUBSTD.DFS is a PARC font equivalence table which only applies here because we have so many fonted devices. Don't take it -- it slows down PUB measurably to read it.

So maybe we can get rid of that part. But it seems strange that it doesn't work. Maybe we have an old version of PUB, but a newer PUBSTD.DFS?

larsbrinkhoff commented 5 years ago

That gets us further:


PUB  1 2 3 4 5 6 7 8
Undefined Identifier COM
Line/Page 6/8[]