-
Notifications
You must be signed in to change notification settings - Fork 86
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
Conversation
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.
src/mudsys/midas.324
Outdated
@@ -13076,6 +13076,8 @@ SQUOZE 10,CLEARB | |||
CLEARB | |||
SQUOZE 10,ADJBP | |||
IBP | |||
SQUOZE 10,XMOVEI | |||
SETMI |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
src/mudsys/secagc.82
Outdated
@@ -4,6 +4,9 @@ TITLE SECAGC MUDDLE GARBAGE COLLECTOR FOR MULTI SECTIONS | |||
;SYSTEM WIDE DEFINITIONS GO HERE | |||
|
|||
RELOCATABLE | |||
|
|||
.SYMTAB 3337. |
There was a problem hiding this comment.
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. :-)
There was a problem hiding this 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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
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. |
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? |
TS MDL came from Chapter 1 of the 55/105 manual:
There's a comment in the source that suggest TS MUDDLE was a previous name, though:
We could install it under both names? |
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. |
Maybe MUDSAV; TS MDL56, and then link SYS3; TS MDL and SYS3; TS MUDDLE to that? |
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. |
src/mudsys/save.177
Outdated
@@ -319,7 +319,7 @@ IFN ITS,[ | |||
] | |||
|
|||
; NOW CYCLE THROUGH CHANNELS | |||
MOVE C,[-N.CHNS*2,,CHNL1] ; POINT TO REAL CHANNELS SLOTS |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
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.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Push when ready!
@atsampson, will you write something to its-hackers? |
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.