Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDL - MDL 56 interpreter #830

Merged
merged 29 commits into from
Apr 25, 2018
Merged

MDL - MDL 56 interpreter #830

merged 29 commits into from
Apr 25, 2018

Conversation

atsampson
Copy link
Contributor

This is a tidied-up version of what @larsbrinkhoff and I have been doing in branches of the Muddle repository.

Fixes #665. Related to #12, #826, #827.

larsbrinkhoff and others added 5 commits April 23, 2018 15:38
Two things to note: the compiled Muddle was called MDL106.EXE, and the
MIDAS binary was earlier than MIDAS 76.

I've left the TENEX build scripts and TENEX-specific files in place;
the TENEX/ITS code is conditional, so it should be possible to build the
code on TENEX/TOPS-20 in the future.
MIDAS and Muddle source get version numbers (as in the 1973 Muddle
source); the build files don't.
The string is padded with ^? characters, which are skipped when it's
printed.
@atsampson atsampson requested a review from larsbrinkhoff April 23, 2018 23:17
@@ -13076,6 +13076,8 @@ SQUOZE 10,CLEARB
CLEARB
SQUOZE 10,ADJBP
IBP
SQUOZE 10,XMOVEI
SETMI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI, XMOVE and XHLLI have other meanings in an extended addressing system.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are quite a few KL10 instructions in newer MIDAS's synonym table (search for XMOVEI). I could add them all here if we had a use for them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need, at least not now. I think it would be more useful to try getting MIDAS 458 in shape.

@@ -4,6 +4,9 @@ TITLE SECAGC MUDDLE GARBAGE COLLECTOR FOR MULTI SECTIONS
;SYSTEM WIDE DEFINITIONS GO HERE

RELOCATABLE

.SYMTAB 3337.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this change isn't neccesary for ITS, but I'm sure future TOPS-20 retrocomputing fans will be grateful. :-)

Copy link
Member

@larsbrinkhoff larsbrinkhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Muddle version in the commit comment has a typo.

Copy link
Member

@larsbrinkhoff larsbrinkhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the assignment to A rather than comment it out?

The cause of the failure deserves further investigation, but it can be a new issue.

@@ -104,6 +104,7 @@ Some major applications:
- Emacs, editor
- Mac Hack VI and Tech II, chess programs
- Maclisp, interpreter and compiler
- Muddle, interpreter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm torn between calling it MDL or Muddle. @36bit seems to prefer Muddle for presumably good reasons, but most manuals seem to say MDL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was sticking to the terminology in the 55/105 manual: "The MDL programming language began existence in late 1970 (under the name Muddle) as a successor to Lisp ...".

I guess if we resurrect the 1973 version in the future, that would be Muddle and this is MDL.

@@ -102,6 +102,7 @@
- MODEMS, modems gragon.
- MSPLIT, split a file into smaller parts.
- MTBOOT, make bootable tapes.
- MUDDLE, MDL interpreter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the executable is named TS MDL, I suppose this could be "MDL, Muddle interpreter." Or whatever the proper name is.

@eswenson1
Copy link
Member

As far as I remember, the language was MDL, but the interpreter was called MUDDLE. TS MDL seems wrongdoings me. The executable was called TS MUDDLE.

@larsbrinkhoff
Copy link
Member

I'll note that the 1973 version includes a TS MUDDLE. TOPS-20 executables are named MDL10n.EXE. Adam, you found a reference to TS MDL in some manual?

@atsampson
Copy link
Contributor Author

TS MDL came from Chapter 1 of the 55/105 manual:

Somehow get the interpreter running -- the program in the file SYS:TS MDL in the ITS version or SYS:MDL.SAV in the Tenex version or SYS:MDL.EXE in the Tops-20 version. [...] The program will be referred to as just "MDL" (or "the interpreter") from here on.

There's a comment in the source that suggest TS MUDDLE was a previous name, though:

; HACK FOR TS FOO linked to TS MUDDLE

We could install it under both names?

@atsampson
Copy link
Contributor Author

Why remove the assignment to A rather than comment it out?

Good catch - I'd first rewritten it to compute a better limit for A, which didn't work, and forgot to put the original line back. I'll fix that.

@larsbrinkhoff
Copy link
Member

Maybe MUDSAV; TS MDL56, and then link SYS3; TS MDL and SYS3; TS MUDDLE to that?

@atsampson
Copy link
Contributor Author

atsampson commented Apr 24, 2018

Sounds sensible - that'd also allow us to have multiple versions installed, if we ever needed (say) a MDL54 with different behaviour for some application.

Fixed MDL version in the MIDAS commit message too.

@@ -319,7 +319,7 @@ IFN ITS,[
]

; NOW CYCLE THROUGH CHANNELS
MOVE C,[-N.CHNS*2,,CHNL1] ; POINT TO REAL CHANNELS SLOTS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does multiplying a global work with the MIDAS "323" + STINK "2" combo? If so, maybe this can be dropped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it works:

002672:  000000000002  multiply next global reference by this                   
002673:  663013473135  reference minus global: 'N.CHNS', flags=15               
002674:  000000000000                           ;"      "                       

I'll drop that commit.

Copy link
Member

@larsbrinkhoff larsbrinkhoff Apr 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the code that checks this is very similar in 323 and 458. See MULTP1. Better check that the generated code actually works. If so, maybe it would be a fix to copy that code from 323 to 459!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed. The left halfword becomes -40 whether N.CHNS is multiplied by two or added to itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a testcase for this to my collection. At some point I'd like to try all of those tests on the various versions of MIDAS/STINK we have...

atsampson and others added 8 commits April 24, 2018 12:10
It looks like Muddle was historically built with an early MIDAS: the
1973 Muddle source included a copy of MIDAS 73, and the MDL 106
source included a TENEX MIDAS binary of similar vintage.

Later versions of MIDAS have differences in their REL output which break
Muddle's low/high-segment linking. We don't have source for MIDAS 73.
MIDAS 323 is the latest version we have that supports this scheme
correctly, at least with Muddle's version of STINK.
MIDAS 323 doesn't know this opcode by default, but the Muddle source
uses it in ATOMHK and MAIN. Add it to the synonym table.
When:

- MIDAS is writing a "standard data" block to a REL file;
- it wants to write a 76 (local-to-global/rename/expunge) directive,
  which needs two words of data;
- and there's only one word of space left in the block;

it wrote the first one to the current block, and the second word to the
start of the next block. STINK 1/201 doesn't understand this, and treats
the second word as codebits for the next block, misinterpreting the
directives for that block; this results in missing symbols or junk being
loaded into memory.

For other two-word directives, MIDAS sets the IRCONT flag for all words
except the last one, to prevent the block from being flushed until the
directive is complete. Do the same for 76 directives.

Also fix CNSTA, which unset IRCONT *after* its last word; this was
probably harmless because it will be the first directive in a block so
can't be split.
Linking Muddle showed various unresolved symbols of the form
"$   42". These are used by MIDAS when it wants to refer to something in
a CONSTANTS area, but doesn't know the location at assembly time (for
example, because it's the other side of a LOC X where X is a global).
At the start of a CONSTANTS area, MIDAS defines this symbol as .;
however, it was defining it with the wrong name.

There's a special case in RPWRD1 to output references to these symbols
as squoze rather than symbol table numbers, but the code in CNST2 that
defines the symbol was using PDEFPT, which always outputs the number.
Make it output the squoze instead.
Most versions of MIDAS emit a 76 directive for each EXPUNGE, even if the
symbol being EXPUNGEd didn't exist. However, STINK treated a 76
directive for a symbol it didn't know about as an error.

Make it ignore the directive instead, skipping the next word to stay in
sync.
larsbrinkhoff and others added 16 commits April 24, 2018 12:10
There were two extra TERMINs, one of which was misspelled. Newer MIDAS
checks these more strictly.
MCALL tries to make its second arg global, which doesn't work when it's
an expression.
Newer MIDAS defines all of these itself; Muddle wants its own
definitions.
Recent MIDAS complains about the DOTCAL macro adding SETZ to the name
pointer (which is effectively a global as it's in a distant CONSTANTS
section).
DOTYPS doesn't exist anywhere. NUMSTA is a typo for NUMSAT.
These are analogous to TENEX's ASSEM ALL and MUD105 STINK.

This is version 56 for ITS, because the TENEX binary claimed to be
version 106, and the 54/104 and 55/105 manuals suggest that the ITS
version number tracked the TENEX one. Zork tests whether ,MUDDLE is less
than 100 to see if it's on ITS.
This is checking whether the transfer vector has overflowed the
compile-time space allocated for it -- but the test is backwards, so the
.LOP .VALUE always fires.
On ITS, ILOOP in INITM fails because it runs out of address space;
it overruns by about 2000 words. There's a comment in MUDDLE suggesting
that BOT was originally 600000, so move it back to there (although we
could get away with a higher value if necessary in the future).

On TENEX, TXPURE would be used instead.
This is trying to make pages from BOT to the end of memory pure, but it
fails on current ITS, even if you adjust the end of the range to match
RHITOP.
The MDL 54/104 and 55/105 manuals give the name SYS:TS MDL for the
interpreter, and a comment in MAIN says it was TS MUDDLE, so install
links for both.
@@ -0,0 +1,36 @@
MPUREL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default FN2 for STINK scripts passed on the command line is LOADER. But since STINK "2" doesn't take a JCL, it doesn't matter much now.

Copy link
Member

@larsbrinkhoff larsbrinkhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Push when ready!

@larsbrinkhoff larsbrinkhoff removed the request for review from 36bit April 25, 2018 06:05
@larsbrinkhoff
Copy link
Member

@atsampson, will you write something to its-hackers?

@atsampson atsampson merged commit 3cc1c13 into master Apr 25, 2018
@larsbrinkhoff larsbrinkhoff added the muddle Muddle/MDL label Apr 26, 2018
@larsbrinkhoff larsbrinkhoff deleted the ats/muddle branch April 26, 2018 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
muddle Muddle/MDL todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants