1
0
mirror of https://github.com/DoctorWkt/pdp7-unix.git synced 2026-02-10 10:20:07 +00:00

Merge pull request #22 from teverett/master

updated grammar and added more working examples to the test cases
This commit is contained in:
Warren
2016-03-03 13:15:40 +10:00
21 changed files with 5314 additions and 227 deletions

View File

@@ -33,13 +33,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
grammar pdp7;
prog
: line +
: lineeol+ line? EOF
;
line
: declarations? comment? eol
: declarations? comment?
;
lineeol
: line eol
;
declarations
: declaration (';' declaration)*
;
@@ -58,7 +62,7 @@ argument
;
assignment
: (variable | LOC | RELOC) '=' expression
: (opcode | variable | LOC | RELOC) '=' expression
;
expression
@@ -77,7 +81,8 @@ atom
| DECIMAL
| DECIMAL_MINUS
| OCTAL
| signednumber
| NUMERIC_LITERAL
| '-' atom
;
// string chars, then potentially more than 1 octal constant, then potentially '>'
@@ -85,10 +90,6 @@ string
: STRING NUMERIC_LITERAL* '>'?
;
signednumber
: '-'? NUMERIC_LITERAL
;
eol
: EOL
;
@@ -262,7 +263,7 @@ DECIMAL_MINUS
STRING
: '<' [a-zA-Z0-9$*,%/]*
: '<' [a-zA-Z0-9$*,%/:?]*
;

View File

@@ -36,6 +36,18 @@ public class pdp7BaseListener implements pdp7Listener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitLine(pdp7Parser.LineContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterLineeol(pdp7Parser.LineeolContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitLineeol(pdp7Parser.LineeolContext ctx) { }
/**
* {@inheritDoc}
*
@@ -144,18 +156,6 @@ public class pdp7BaseListener implements pdp7Listener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitString(pdp7Parser.StringContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSignednumber(pdp7Parser.SignednumberContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSignednumber(pdp7Parser.SignednumberContext ctx) { }
/**
* {@inheritDoc}
*

View File

@@ -183,19 +183,19 @@ public class pdp7Lexer extends Lexer {
"V\u00abW\u00adX\u00afY\u00b1Z\u00b3[\u00b5\\\u00b7]\u00b9^\u00bb_\u00bd"+
"`\u00bfa\u00c1b\u00c3c\u00c5d\u00c7e\u00c9f\u00cbg\u00cdh\u00cfi\u00d1"+
"j\u00d3k\u00d5l\u00d7m\u00d9n\u00dbo\u00ddp\3\2\n\6\2\60\60\62;C\\c|\4"+
"\2C\\c|\3\2\62;\4\2\62;ch\3\2\629\b\2&\',,..\61;C\\c|\4\2\f\f\17\17\4"+
"\2\13\13\"\"\u02bf\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13"+
"\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2"+
"\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2"+
"!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3"+
"\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2"+
"\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E"+
"\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2"+
"\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2"+
"\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2k"+
"\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2\2q\3\2\2\2\2s\3\2\2\2\2u\3\2\2\2\2w\3\2"+
"\2\2\2y\3\2\2\2\2{\3\2\2\2\2}\3\2\2\2\2\177\3\2\2\2\2\u0081\3\2\2\2\2"+
"\u0083\3\2\2\2\2\u0085\3\2\2\2\2\u0087\3\2\2\2\2\u0089\3\2\2\2\2\u008b"+
"\2C\\c|\3\2\62;\4\2\62;ch\3\2\629\t\2&\',,..\61<AAC\\c|\4\2\f\f\17\17"+
"\4\2\13\13\"\"\u02bf\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2"+
"\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3"+
"\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2"+
"\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2"+
"\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2"+
"\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2"+
"\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q"+
"\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2"+
"\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2"+
"\2k\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2\2q\3\2\2\2\2s\3\2\2\2\2u\3\2\2\2\2w"+
"\3\2\2\2\2y\3\2\2\2\2{\3\2\2\2\2}\3\2\2\2\2\177\3\2\2\2\2\u0081\3\2\2"+
"\2\2\u0083\3\2\2\2\2\u0085\3\2\2\2\2\u0087\3\2\2\2\2\u0089\3\2\2\2\2\u008b"+
"\3\2\2\2\2\u008d\3\2\2\2\2\u008f\3\2\2\2\2\u0091\3\2\2\2\2\u0093\3\2\2"+
"\2\2\u0095\3\2\2\2\2\u0097\3\2\2\2\2\u0099\3\2\2\2\2\u009b\3\2\2\2\2\u009d"+
"\3\2\2\2\2\u009f\3\2\2\2\2\u00a1\3\2\2\2\2\u00a3\3\2\2\2\2\u00a5\3\2\2"+

View File

@@ -28,6 +28,16 @@ public interface pdp7Listener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitLine(pdp7Parser.LineContext ctx);
/**
* Enter a parse tree produced by {@link pdp7Parser#lineeol}.
* @param ctx the parse tree
*/
void enterLineeol(pdp7Parser.LineeolContext ctx);
/**
* Exit a parse tree produced by {@link pdp7Parser#lineeol}.
* @param ctx the parse tree
*/
void exitLineeol(pdp7Parser.LineeolContext ctx);
/**
* Enter a parse tree produced by {@link pdp7Parser#declarations}.
* @param ctx the parse tree
@@ -118,16 +128,6 @@ public interface pdp7Listener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitString(pdp7Parser.StringContext ctx);
/**
* Enter a parse tree produced by {@link pdp7Parser#signednumber}.
* @param ctx the parse tree
*/
void enterSignednumber(pdp7Parser.SignednumberContext ctx);
/**
* Exit a parse tree produced by {@link pdp7Parser#signednumber}.
* @param ctx the parse tree
*/
void exitSignednumber(pdp7Parser.SignednumberContext ctx);
/**
* Enter a parse tree produced by {@link pdp7Parser#eol}.
* @param ctx the parse tree

View File

@@ -34,15 +34,15 @@ public class pdp7Parser extends Parser {
NUMERIC_LITERAL=103, DECIMAL=104, OCTAL=105, DECIMAL_MINUS=106, STRING=107,
COMMENT=108, EOL=109, WS=110;
public static final int
RULE_prog = 0, RULE_line = 1, RULE_declarations = 2, RULE_declaration = 3,
RULE_instruction = 4, RULE_argument = 5, RULE_assignment = 6, RULE_expression = 7,
RULE_multiplyingExpression = 8, RULE_atom = 9, RULE_string = 10, RULE_signednumber = 11,
RULE_prog = 0, RULE_line = 1, RULE_lineeol = 2, RULE_declarations = 3,
RULE_declaration = 4, RULE_instruction = 5, RULE_argument = 6, RULE_assignment = 7,
RULE_expression = 8, RULE_multiplyingExpression = 9, RULE_atom = 10, RULE_string = 11,
RULE_eol = 12, RULE_comment = 13, RULE_label = 14, RULE_variable = 15,
RULE_opcode = 16;
public static final String[] ruleNames = {
"prog", "line", "declarations", "declaration", "instruction", "argument",
"assignment", "expression", "multiplyingExpression", "atom", "string",
"signednumber", "eol", "comment", "label", "variable", "opcode"
"prog", "line", "lineeol", "declarations", "declaration", "instruction",
"argument", "assignment", "expression", "multiplyingExpression", "atom",
"string", "eol", "comment", "label", "variable", "opcode"
};
private static final String[] _LITERAL_NAMES = {
@@ -122,11 +122,15 @@ public class pdp7Parser extends Parser {
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class ProgContext extends ParserRuleContext {
public List<LineContext> line() {
return getRuleContexts(LineContext.class);
public TerminalNode EOF() { return getToken(pdp7Parser.EOF, 0); }
public List<LineeolContext> lineeol() {
return getRuleContexts(LineeolContext.class);
}
public LineContext line(int i) {
return getRuleContext(LineContext.class,i);
public LineeolContext lineeol(int i) {
return getRuleContext(LineeolContext.class,i);
}
public LineContext line() {
return getRuleContext(LineContext.class,0);
}
public ProgContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
@@ -145,24 +149,41 @@ public class pdp7Parser extends Parser {
public final ProgContext prog() throws RecognitionException {
ProgContext _localctx = new ProgContext(_ctx, getState());
enterRule(_localctx, 0, RULE_prog);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(35);
_errHandler.sync(this);
_la = _input.LA(1);
_alt = 1;
do {
{
{
setState(34);
line();
}
switch (_alt) {
case 1:
{
{
setState(34);
lineeol();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(37);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41) | (1L << T__42) | (1L << T__43) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48) | (1L << T__49) | (1L << T__50) | (1L << T__51) | (1L << T__52) | (1L << T__53) | (1L << T__54) | (1L << T__55) | (1L << T__56) | (1L << T__57) | (1L << T__58) | (1L << T__59) | (1L << T__60) | (1L << T__61) | (1L << T__62))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__64 - 64)) | (1L << (T__65 - 64)) | (1L << (T__66 - 64)) | (1L << (T__67 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__71 - 64)) | (1L << (T__72 - 64)) | (1L << (T__73 - 64)) | (1L << (T__74 - 64)) | (1L << (T__75 - 64)) | (1L << (T__76 - 64)) | (1L << (T__77 - 64)) | (1L << (T__78 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (T__81 - 64)) | (1L << (T__82 - 64)) | (1L << (T__83 - 64)) | (1L << (T__84 - 64)) | (1L << (T__85 - 64)) | (1L << (T__86 - 64)) | (1L << (T__87 - 64)) | (1L << (T__88 - 64)) | (1L << (T__89 - 64)) | (1L << (T__90 - 64)) | (1L << (T__91 - 64)) | (1L << (T__92 - 64)) | (1L << (T__93 - 64)) | (1L << (LOC - 64)) | (1L << (RELOC - 64)) | (1L << (MINUS - 64)) | (1L << (LABEL - 64)) | (1L << (IDENTIFIER - 64)) | (1L << (NUMERIC_LITERAL - 64)) | (1L << (DECIMAL - 64)) | (1L << (OCTAL - 64)) | (1L << (DECIMAL_MINUS - 64)) | (1L << (STRING - 64)) | (1L << (COMMENT - 64)) | (1L << (EOL - 64)))) != 0) );
_alt = getInterpreter().adaptivePredict(_input,0,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
setState(40);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
{
setState(39);
line();
}
break;
}
setState(42);
match(EOF);
}
}
catch (RecognitionException re) {
@@ -177,9 +198,6 @@ public class pdp7Parser extends Parser {
}
public static class LineContext extends ParserRuleContext {
public EolContext eol() {
return getRuleContext(EolContext.class,0);
}
public DeclarationsContext declarations() {
return getRuleContext(DeclarationsContext.class,0);
}
@@ -207,25 +225,67 @@ public class pdp7Parser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
setState(40);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
setState(45);
switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
case 1:
{
setState(39);
setState(44);
declarations();
}
break;
}
setState(43);
setState(48);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(42);
setState(47);
comment();
}
}
setState(45);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LineeolContext extends ParserRuleContext {
public LineContext line() {
return getRuleContext(LineContext.class,0);
}
public EolContext eol() {
return getRuleContext(EolContext.class,0);
}
public LineeolContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_lineeol; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterLineeol(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitLineeol(this);
}
}
public final LineeolContext lineeol() throws RecognitionException {
LineeolContext _localctx = new LineeolContext(_ctx, getState());
enterRule(_localctx, 4, RULE_lineeol);
try {
enterOuterAlt(_localctx, 1);
{
setState(50);
line();
setState(51);
eol();
}
}
@@ -263,26 +323,26 @@ public class pdp7Parser extends Parser {
public final DeclarationsContext declarations() throws RecognitionException {
DeclarationsContext _localctx = new DeclarationsContext(_ctx, getState());
enterRule(_localctx, 4, RULE_declarations);
enterRule(_localctx, 6, RULE_declarations);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(47);
setState(53);
declaration();
setState(52);
setState(58);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__0) {
{
{
setState(48);
setState(54);
match(T__0);
setState(49);
setState(55);
declaration();
}
}
setState(54);
setState(60);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -340,53 +400,53 @@ public class pdp7Parser extends Parser {
public final DeclarationContext declaration() throws RecognitionException {
DeclarationContext _localctx = new DeclarationContext(_ctx, getState());
enterRule(_localctx, 6, RULE_declaration);
enterRule(_localctx, 8, RULE_declaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(58);
setState(64);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==LABEL) {
{
{
setState(55);
setState(61);
label();
}
}
setState(60);
setState(66);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(66);
setState(72);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41) | (1L << T__42) | (1L << T__43) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48) | (1L << T__49) | (1L << T__50) | (1L << T__51) | (1L << T__52) | (1L << T__53) | (1L << T__54) | (1L << T__55) | (1L << T__56) | (1L << T__57) | (1L << T__58) | (1L << T__59) | (1L << T__60) | (1L << T__61) | (1L << T__62))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__64 - 64)) | (1L << (T__65 - 64)) | (1L << (T__66 - 64)) | (1L << (T__67 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__71 - 64)) | (1L << (T__72 - 64)) | (1L << (T__73 - 64)) | (1L << (T__74 - 64)) | (1L << (T__75 - 64)) | (1L << (T__76 - 64)) | (1L << (T__77 - 64)) | (1L << (T__78 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (T__81 - 64)) | (1L << (T__82 - 64)) | (1L << (T__83 - 64)) | (1L << (T__84 - 64)) | (1L << (T__85 - 64)) | (1L << (T__86 - 64)) | (1L << (T__87 - 64)) | (1L << (T__88 - 64)) | (1L << (T__89 - 64)) | (1L << (T__90 - 64)) | (1L << (T__91 - 64)) | (1L << (T__92 - 64)) | (1L << (T__93 - 64)) | (1L << (LOC - 64)) | (1L << (RELOC - 64)) | (1L << (MINUS - 64)) | (1L << (IDENTIFIER - 64)) | (1L << (NUMERIC_LITERAL - 64)) | (1L << (DECIMAL - 64)) | (1L << (OCTAL - 64)) | (1L << (DECIMAL_MINUS - 64)) | (1L << (STRING - 64)))) != 0)) {
{
setState(64);
switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) {
setState(70);
switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) {
case 1:
{
setState(61);
setState(67);
instruction();
}
break;
case 2:
{
setState(62);
setState(68);
assignment();
}
break;
case 3:
{
setState(63);
setState(69);
expression();
}
break;
}
}
setState(68);
setState(74);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -429,28 +489,28 @@ public class pdp7Parser extends Parser {
public final InstructionContext instruction() throws RecognitionException {
InstructionContext _localctx = new InstructionContext(_ctx, getState());
enterRule(_localctx, 8, RULE_instruction);
enterRule(_localctx, 10, RULE_instruction);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(69);
setState(75);
opcode();
setState(73);
setState(79);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,7,_ctx);
_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(70);
setState(76);
argument();
}
}
}
setState(75);
setState(81);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,7,_ctx);
_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
}
}
}
@@ -485,11 +545,11 @@ public class pdp7Parser extends Parser {
public final ArgumentContext argument() throws RecognitionException {
ArgumentContext _localctx = new ArgumentContext(_ctx, getState());
enterRule(_localctx, 10, RULE_argument);
enterRule(_localctx, 12, RULE_argument);
try {
enterOuterAlt(_localctx, 1);
{
setState(76);
setState(82);
expression();
}
}
@@ -508,6 +568,9 @@ public class pdp7Parser extends Parser {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public OpcodeContext opcode() {
return getRuleContext(OpcodeContext.class,0);
}
public VariableContext variable() {
return getRuleContext(VariableContext.class,0);
}
@@ -529,36 +592,132 @@ public class pdp7Parser extends Parser {
public final AssignmentContext assignment() throws RecognitionException {
AssignmentContext _localctx = new AssignmentContext(_ctx, getState());
enterRule(_localctx, 12, RULE_assignment);
enterRule(_localctx, 14, RULE_assignment);
try {
enterOuterAlt(_localctx, 1);
{
setState(81);
setState(88);
switch (_input.LA(1)) {
case T__3:
case T__4:
case T__5:
case T__6:
case T__7:
case T__8:
case T__9:
case T__10:
case T__11:
case T__12:
case T__13:
case T__14:
case T__15:
case T__16:
case T__17:
case T__18:
case T__19:
case T__20:
case T__21:
case T__22:
case T__23:
case T__24:
case T__25:
case T__26:
case T__27:
case T__28:
case T__29:
case T__30:
case T__31:
case T__32:
case T__33:
case T__34:
case T__35:
case T__36:
case T__37:
case T__38:
case T__39:
case T__40:
case T__41:
case T__42:
case T__43:
case T__44:
case T__45:
case T__46:
case T__47:
case T__48:
case T__49:
case T__50:
case T__51:
case T__52:
case T__53:
case T__54:
case T__55:
case T__56:
case T__57:
case T__58:
case T__59:
case T__60:
case T__61:
case T__62:
case T__63:
case T__64:
case T__65:
case T__66:
case T__67:
case T__68:
case T__69:
case T__70:
case T__71:
case T__72:
case T__73:
case T__74:
case T__75:
case T__76:
case T__77:
case T__78:
case T__79:
case T__80:
case T__81:
case T__82:
case T__83:
case T__84:
case T__85:
case T__86:
case T__87:
case T__88:
case T__89:
case T__90:
case T__91:
case T__92:
case T__93:
{
setState(84);
opcode();
}
break;
case IDENTIFIER:
{
setState(78);
setState(85);
variable();
}
break;
case LOC:
{
setState(79);
setState(86);
match(LOC);
}
break;
case RELOC:
{
setState(80);
setState(87);
match(RELOC);
}
break;
default:
throw new NoViableAltException(this);
}
setState(83);
setState(90);
match(T__1);
setState(84);
setState(91);
expression();
}
}
@@ -604,36 +763,36 @@ public class pdp7Parser extends Parser {
public final ExpressionContext expression() throws RecognitionException {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
enterRule(_localctx, 14, RULE_expression);
enterRule(_localctx, 16, RULE_expression);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(86);
setState(93);
multiplyingExpression();
setState(91);
setState(98);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,9,_ctx);
_alt = getInterpreter().adaptivePredict(_input,10,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(87);
setState(94);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
_errHandler.recoverInline(this);
} else {
consume();
}
setState(88);
setState(95);
multiplyingExpression();
}
}
}
setState(93);
setState(100);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,9,_ctx);
_alt = getInterpreter().adaptivePredict(_input,10,_ctx);
}
}
}
@@ -679,31 +838,31 @@ public class pdp7Parser extends Parser {
public final MultiplyingExpressionContext multiplyingExpression() throws RecognitionException {
MultiplyingExpressionContext _localctx = new MultiplyingExpressionContext(_ctx, getState());
enterRule(_localctx, 16, RULE_multiplyingExpression);
enterRule(_localctx, 18, RULE_multiplyingExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(94);
setState(101);
atom();
setState(99);
setState(106);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==TIMES || _la==DIV) {
{
{
setState(95);
setState(102);
_la = _input.LA(1);
if ( !(_la==TIMES || _la==DIV) ) {
_errHandler.recoverInline(this);
} else {
consume();
}
setState(96);
setState(103);
atom();
}
}
setState(101);
setState(108);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -732,8 +891,9 @@ public class pdp7Parser extends Parser {
public TerminalNode DECIMAL() { return getToken(pdp7Parser.DECIMAL, 0); }
public TerminalNode DECIMAL_MINUS() { return getToken(pdp7Parser.DECIMAL_MINUS, 0); }
public TerminalNode OCTAL() { return getToken(pdp7Parser.OCTAL, 0); }
public SignednumberContext signednumber() {
return getRuleContext(SignednumberContext.class,0);
public TerminalNode NUMERIC_LITERAL() { return getToken(pdp7Parser.NUMERIC_LITERAL, 0); }
public AtomContext atom() {
return getRuleContext(AtomContext.class,0);
}
public AtomContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
@@ -751,65 +911,73 @@ public class pdp7Parser extends Parser {
public final AtomContext atom() throws RecognitionException {
AtomContext _localctx = new AtomContext(_ctx, getState());
enterRule(_localctx, 18, RULE_atom);
enterRule(_localctx, 20, RULE_atom);
try {
setState(110);
setState(119);
switch (_input.LA(1)) {
case IDENTIFIER:
enterOuterAlt(_localctx, 1);
{
setState(102);
setState(109);
variable();
}
break;
case LOC:
enterOuterAlt(_localctx, 2);
{
setState(103);
setState(110);
match(LOC);
}
break;
case RELOC:
enterOuterAlt(_localctx, 3);
{
setState(104);
setState(111);
match(RELOC);
}
break;
case STRING:
enterOuterAlt(_localctx, 4);
{
setState(105);
setState(112);
string();
}
break;
case DECIMAL:
enterOuterAlt(_localctx, 5);
{
setState(106);
setState(113);
match(DECIMAL);
}
break;
case DECIMAL_MINUS:
enterOuterAlt(_localctx, 6);
{
setState(107);
setState(114);
match(DECIMAL_MINUS);
}
break;
case OCTAL:
enterOuterAlt(_localctx, 7);
{
setState(108);
setState(115);
match(OCTAL);
}
break;
case MINUS:
case NUMERIC_LITERAL:
enterOuterAlt(_localctx, 8);
{
setState(109);
signednumber();
setState(116);
match(NUMERIC_LITERAL);
}
break;
case MINUS:
enterOuterAlt(_localctx, 9);
{
setState(117);
match(MINUS);
setState(118);
atom();
}
break;
default:
@@ -849,35 +1017,35 @@ public class pdp7Parser extends Parser {
public final StringContext string() throws RecognitionException {
StringContext _localctx = new StringContext(_ctx, getState());
enterRule(_localctx, 20, RULE_string);
enterRule(_localctx, 22, RULE_string);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(112);
setState(121);
match(STRING);
setState(116);
setState(125);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,12,_ctx);
_alt = getInterpreter().adaptivePredict(_input,13,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(113);
setState(122);
match(NUMERIC_LITERAL);
}
}
}
setState(118);
setState(127);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,12,_ctx);
_alt = getInterpreter().adaptivePredict(_input,13,_ctx);
}
setState(120);
setState(129);
_la = _input.LA(1);
if (_la==T__2) {
{
setState(119);
setState(128);
match(T__2);
}
}
@@ -895,53 +1063,6 @@ public class pdp7Parser extends Parser {
return _localctx;
}
public static class SignednumberContext extends ParserRuleContext {
public TerminalNode NUMERIC_LITERAL() { return getToken(pdp7Parser.NUMERIC_LITERAL, 0); }
public SignednumberContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_signednumber; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterSignednumber(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitSignednumber(this);
}
}
public final SignednumberContext signednumber() throws RecognitionException {
SignednumberContext _localctx = new SignednumberContext(_ctx, getState());
enterRule(_localctx, 22, RULE_signednumber);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(123);
_la = _input.LA(1);
if (_la==MINUS) {
{
setState(122);
match(MINUS);
}
}
setState(125);
match(NUMERIC_LITERAL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class EolContext extends ParserRuleContext {
public TerminalNode EOL() { return getToken(pdp7Parser.EOL, 0); }
public EolContext(ParserRuleContext parent, int invokingState) {
@@ -964,7 +1085,7 @@ public class pdp7Parser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
setState(127);
setState(131);
match(EOL);
}
}
@@ -1001,7 +1122,7 @@ public class pdp7Parser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
setState(129);
setState(133);
match(COMMENT);
}
}
@@ -1038,7 +1159,7 @@ public class pdp7Parser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
setState(131);
setState(135);
match(LABEL);
}
}
@@ -1075,7 +1196,7 @@ public class pdp7Parser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
setState(133);
setState(137);
match(IDENTIFIER);
}
}
@@ -1112,7 +1233,7 @@ public class pdp7Parser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
setState(135);
setState(139);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41) | (1L << T__42) | (1L << T__43) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48) | (1L << T__49) | (1L << T__50) | (1L << T__51) | (1L << T__52) | (1L << T__53) | (1L << T__54) | (1L << T__55) | (1L << T__56) | (1L << T__57) | (1L << T__58) | (1L << T__59) | (1L << T__60) | (1L << T__61) | (1L << T__62))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__64 - 64)) | (1L << (T__65 - 64)) | (1L << (T__66 - 64)) | (1L << (T__67 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__71 - 64)) | (1L << (T__72 - 64)) | (1L << (T__73 - 64)) | (1L << (T__74 - 64)) | (1L << (T__75 - 64)) | (1L << (T__76 - 64)) | (1L << (T__77 - 64)) | (1L << (T__78 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (T__81 - 64)) | (1L << (T__82 - 64)) | (1L << (T__83 - 64)) | (1L << (T__84 - 64)) | (1L << (T__85 - 64)) | (1L << (T__86 - 64)) | (1L << (T__87 - 64)) | (1L << (T__88 - 64)) | (1L << (T__89 - 64)) | (1L << (T__90 - 64)) | (1L << (T__91 - 64)) | (1L << (T__92 - 64)) | (1L << (T__93 - 64)))) != 0)) ) {
_errHandler.recoverInline(this);
@@ -1133,41 +1254,43 @@ public class pdp7Parser extends Parser {
}
public static final String _serializedATN =
"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3p\u008c\4\2\t\2\4"+
"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3p\u0090\4\2\t\2\4"+
"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
"\3\2\6\2&\n\2\r\2\16\2\'\3\3\5\3+\n\3\3\3\5\3.\n\3\3\3\3\3\3\4\3\4\3\4"+
"\7\4\65\n\4\f\4\16\48\13\4\3\5\7\5;\n\5\f\5\16\5>\13\5\3\5\3\5\3\5\7\5"+
"C\n\5\f\5\16\5F\13\5\3\6\3\6\7\6J\n\6\f\6\16\6M\13\6\3\7\3\7\3\b\3\b\3"+
"\b\5\bT\n\b\3\b\3\b\3\b\3\t\3\t\3\t\7\t\\\n\t\f\t\16\t_\13\t\3\n\3\n\3"+
"\n\7\nd\n\n\f\n\16\ng\13\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\5\13"+
"q\n\13\3\f\3\f\7\fu\n\f\f\f\16\fx\13\f\3\f\5\f{\n\f\3\r\5\r~\n\r\3\r\3"+
"\r\3\16\3\16\3\17\3\17\3\20\3\20\3\21\3\21\3\22\3\22\3\22\2\2\23\2\4\6"+
"\b\n\f\16\20\22\24\26\30\32\34\36 \"\2\5\3\2cd\3\2ef\3\2\6`\u0091\2%\3"+
"\2\2\2\4*\3\2\2\2\6\61\3\2\2\2\b<\3\2\2\2\nG\3\2\2\2\fN\3\2\2\2\16S\3"+
"\2\2\2\20X\3\2\2\2\22`\3\2\2\2\24p\3\2\2\2\26r\3\2\2\2\30}\3\2\2\2\32"+
"\u0081\3\2\2\2\34\u0083\3\2\2\2\36\u0085\3\2\2\2 \u0087\3\2\2\2\"\u0089"+
"\3\2\2\2$&\5\4\3\2%$\3\2\2\2&\'\3\2\2\2\'%\3\2\2\2\'(\3\2\2\2(\3\3\2\2"+
"\2)+\5\6\4\2*)\3\2\2\2*+\3\2\2\2+-\3\2\2\2,.\5\34\17\2-,\3\2\2\2-.\3\2"+
"\2\2./\3\2\2\2/\60\5\32\16\2\60\5\3\2\2\2\61\66\5\b\5\2\62\63\7\3\2\2"+
"\63\65\5\b\5\2\64\62\3\2\2\2\658\3\2\2\2\66\64\3\2\2\2\66\67\3\2\2\2\67"+
"\7\3\2\2\28\66\3\2\2\29;\5\36\20\2:9\3\2\2\2;>\3\2\2\2<:\3\2\2\2<=\3\2"+
"\2\2=D\3\2\2\2><\3\2\2\2?C\5\n\6\2@C\5\16\b\2AC\5\20\t\2B?\3\2\2\2B@\3"+
"\2\2\2BA\3\2\2\2CF\3\2\2\2DB\3\2\2\2DE\3\2\2\2E\t\3\2\2\2FD\3\2\2\2GK"+
"\5\"\22\2HJ\5\f\7\2IH\3\2\2\2JM\3\2\2\2KI\3\2\2\2KL\3\2\2\2L\13\3\2\2"+
"\2MK\3\2\2\2NO\5\20\t\2O\r\3\2\2\2PT\5 \21\2QT\7a\2\2RT\7b\2\2SP\3\2\2"+
"\2SQ\3\2\2\2SR\3\2\2\2TU\3\2\2\2UV\7\4\2\2VW\5\20\t\2W\17\3\2\2\2X]\5"+
"\22\n\2YZ\t\2\2\2Z\\\5\22\n\2[Y\3\2\2\2\\_\3\2\2\2][\3\2\2\2]^\3\2\2\2"+
"^\21\3\2\2\2_]\3\2\2\2`e\5\24\13\2ab\t\3\2\2bd\5\24\13\2ca\3\2\2\2dg\3"+
"\2\2\2ec\3\2\2\2ef\3\2\2\2f\23\3\2\2\2ge\3\2\2\2hq\5 \21\2iq\7a\2\2jq"+
"\7b\2\2kq\5\26\f\2lq\7j\2\2mq\7l\2\2nq\7k\2\2oq\5\30\r\2ph\3\2\2\2pi\3"+
"\2\2\2pj\3\2\2\2pk\3\2\2\2pl\3\2\2\2pm\3\2\2\2pn\3\2\2\2po\3\2\2\2q\25"+
"\3\2\2\2rv\7m\2\2su\7i\2\2ts\3\2\2\2ux\3\2\2\2vt\3\2\2\2vw\3\2\2\2wz\3"+
"\2\2\2xv\3\2\2\2y{\7\5\2\2zy\3\2\2\2z{\3\2\2\2{\27\3\2\2\2|~\7d\2\2}|"+
"\3\2\2\2}~\3\2\2\2~\177\3\2\2\2\177\u0080\7i\2\2\u0080\31\3\2\2\2\u0081"+
"\u0082\7o\2\2\u0082\33\3\2\2\2\u0083\u0084\7n\2\2\u0084\35\3\2\2\2\u0085"+
"\u0086\7g\2\2\u0086\37\3\2\2\2\u0087\u0088\7h\2\2\u0088!\3\2\2\2\u0089"+
"\u008a\t\4\2\2\u008a#\3\2\2\2\21\'*-\66<BDKS]epvz}";
"\3\2\6\2&\n\2\r\2\16\2\'\3\2\5\2+\n\2\3\2\3\2\3\3\5\3\60\n\3\3\3\5\3\63"+
"\n\3\3\4\3\4\3\4\3\5\3\5\3\5\7\5;\n\5\f\5\16\5>\13\5\3\6\7\6A\n\6\f\6"+
"\16\6D\13\6\3\6\3\6\3\6\7\6I\n\6\f\6\16\6L\13\6\3\7\3\7\7\7P\n\7\f\7\16"+
"\7S\13\7\3\b\3\b\3\t\3\t\3\t\3\t\5\t[\n\t\3\t\3\t\3\t\3\n\3\n\3\n\7\n"+
"c\n\n\f\n\16\nf\13\n\3\13\3\13\3\13\7\13k\n\13\f\13\16\13n\13\13\3\f\3"+
"\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\5\fz\n\f\3\r\3\r\7\r~\n\r\f\r\16\r"+
"\u0081\13\r\3\r\5\r\u0084\n\r\3\16\3\16\3\17\3\17\3\20\3\20\3\21\3\21"+
"\3\22\3\22\3\22\2\2\23\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"\2\5\3"+
"\2cd\3\2ef\3\2\6`\u0097\2%\3\2\2\2\4/\3\2\2\2\6\64\3\2\2\2\b\67\3\2\2"+
"\2\nB\3\2\2\2\fM\3\2\2\2\16T\3\2\2\2\20Z\3\2\2\2\22_\3\2\2\2\24g\3\2\2"+
"\2\26y\3\2\2\2\30{\3\2\2\2\32\u0085\3\2\2\2\34\u0087\3\2\2\2\36\u0089"+
"\3\2\2\2 \u008b\3\2\2\2\"\u008d\3\2\2\2$&\5\6\4\2%$\3\2\2\2&\'\3\2\2\2"+
"\'%\3\2\2\2\'(\3\2\2\2(*\3\2\2\2)+\5\4\3\2*)\3\2\2\2*+\3\2\2\2+,\3\2\2"+
"\2,-\7\2\2\3-\3\3\2\2\2.\60\5\b\5\2/.\3\2\2\2/\60\3\2\2\2\60\62\3\2\2"+
"\2\61\63\5\34\17\2\62\61\3\2\2\2\62\63\3\2\2\2\63\5\3\2\2\2\64\65\5\4"+
"\3\2\65\66\5\32\16\2\66\7\3\2\2\2\67<\5\n\6\289\7\3\2\29;\5\n\6\2:8\3"+
"\2\2\2;>\3\2\2\2<:\3\2\2\2<=\3\2\2\2=\t\3\2\2\2><\3\2\2\2?A\5\36\20\2"+
"@?\3\2\2\2AD\3\2\2\2B@\3\2\2\2BC\3\2\2\2CJ\3\2\2\2DB\3\2\2\2EI\5\f\7\2"+
"FI\5\20\t\2GI\5\22\n\2HE\3\2\2\2HF\3\2\2\2HG\3\2\2\2IL\3\2\2\2JH\3\2\2"+
"\2JK\3\2\2\2K\13\3\2\2\2LJ\3\2\2\2MQ\5\"\22\2NP\5\16\b\2ON\3\2\2\2PS\3"+
"\2\2\2QO\3\2\2\2QR\3\2\2\2R\r\3\2\2\2SQ\3\2\2\2TU\5\22\n\2U\17\3\2\2\2"+
"V[\5\"\22\2W[\5 \21\2X[\7a\2\2Y[\7b\2\2ZV\3\2\2\2ZW\3\2\2\2ZX\3\2\2\2"+
"ZY\3\2\2\2[\\\3\2\2\2\\]\7\4\2\2]^\5\22\n\2^\21\3\2\2\2_d\5\24\13\2`a"+
"\t\2\2\2ac\5\24\13\2b`\3\2\2\2cf\3\2\2\2db\3\2\2\2de\3\2\2\2e\23\3\2\2"+
"\2fd\3\2\2\2gl\5\26\f\2hi\t\3\2\2ik\5\26\f\2jh\3\2\2\2kn\3\2\2\2lj\3\2"+
"\2\2lm\3\2\2\2m\25\3\2\2\2nl\3\2\2\2oz\5 \21\2pz\7a\2\2qz\7b\2\2rz\5\30"+
"\r\2sz\7j\2\2tz\7l\2\2uz\7k\2\2vz\7i\2\2wx\7d\2\2xz\5\26\f\2yo\3\2\2\2"+
"yp\3\2\2\2yq\3\2\2\2yr\3\2\2\2ys\3\2\2\2yt\3\2\2\2yu\3\2\2\2yv\3\2\2\2"+
"yw\3\2\2\2z\27\3\2\2\2{\177\7m\2\2|~\7i\2\2}|\3\2\2\2~\u0081\3\2\2\2\177"+
"}\3\2\2\2\177\u0080\3\2\2\2\u0080\u0083\3\2\2\2\u0081\177\3\2\2\2\u0082"+
"\u0084\7\5\2\2\u0083\u0082\3\2\2\2\u0083\u0084\3\2\2\2\u0084\31\3\2\2"+
"\2\u0085\u0086\7o\2\2\u0086\33\3\2\2\2\u0087\u0088\7n\2\2\u0088\35\3\2"+
"\2\2\u0089\u008a\7g\2\2\u008a\37\3\2\2\2\u008b\u008c\7h\2\2\u008c!\3\2"+
"\2\2\u008d\u008e\t\4\2\2\u008e#\3\2\2\2\21\'*/\62<BHJQZdly\177\u0083";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {

View File

@@ -0,0 +1,586 @@
" adm
lac 017777 i
sad d4
jmp nofiles
lac 017777
tad d1
dac name
jms connect
sys time
llss 9
ecla lls 3
tad o60
alss 9
dac snumb
ecla llss 3
tad o60
alss 9
dac snumb+1
ecla llss 3
tad o60
alss 9
dac snumb+2
lac d1
sys write; snumb; 3
lac d1
sys write; o12; 1
jms gcard; <$;<*;<$;<7;<c;0
jms gcard; <$;<*;<$;<r;<c;<d;0
jms gcard; <$;<%;6;<s;<n;<u;<m;<b;<%;3;<7;<c
snumb:
<x;<x;<x;<,;<3;<1;0
jms gcard; <$;<%;6;<i;<d;<e;<n;<t;<%;3;<m;<0;<1;<3;<0;<,
<m;<3;<2;<2;<,;<k;<e;<n;0
jms gcard; <$;<%;6;<s;<e;<l;<e;<c;<t;<%;2;<k;<e;<n
</;<d;<m;<p;<o;<f;<f;0
jms gcard; <$;<%;6;<l;<i;<m;<i;<t;<s;<%;2;<3;<,;<,;<,
<9;<0;<0;<0;<0
jms gcard; <$;<%;6;<d;<a;<t;<a;<%;4;<i;<*;<,
<n;<c;<k;<s;<u;<m;<,
<c;<o;<p;<y;0
jmp floop1
floop:
lac fi
sys close
floop1:
lac 017777 i
sad d4
jmp done
tad dm4
dac 017777 i
lac name
tad d4
dac name
sys open; name; ..; 0
spa
jmp ferror
dac fi
-1
tad name
dac 8
r4
dac c1
1:
lac 8 i
jms putw
isz c1
jmp 1b
jms gcard; 0
jms flush
lac o200500 " first card, 7/9
dac buf
dzm buf+1 " seq
cloop:
dzm buf+2 " word count
dzm buf+3 " checksum
law buf+3
dac 10
-44
dac c1
wloop:
jms getword
jmp eof
dac 10 i
add buf+3
dac buf+3 " check sum
isz buf+2 " word count
isz c1
jmp wloop
lac buf+3
add buf
add buf+1
add buf+2
dac buf+3 " ffinal check sum
jms putcard
lac buf
and o577777 " not first card
dac buf
isz buf+1 " sequence
jmp cloop
eof:
dzm 10 i
isz c1
jmp eof
lac buf
xor o400000
dac buf " last card
lac buf+3
add buf
add buf+1
add buf+2
dac buf+3 " final check sum
jms putcard
jmp floop
getword: 0
lac ipt
sad eipt
jmp 1f
lac ipt i
isz ipt
isz getword
jmp getword i
1:
lac fi
sys read; ibuf; 64
sna
jmp getword i
tad iipt
dac eipt
lac iipt
dac ipt
jmp getword+1
ipt: 0
eipt: 0
iipt: ibuf
putcard: 0
-48
dac c1
law buf-1
dac 10
1:
lac 10 i
lmq
-3
dac c2
2:
ecla llss 6
tad lactab
dac .+1
lac ..
dac opt i
isz opt
isz c2
jmp 2b
isz c1
jmp 1b
-16
dac c1
cla
1:
dac opt i
isz opt
isz c1
jmp 1b
law 0144
jms message; tbuf
law tbuf
dac opt
jmp putcard i
jmp floop
ferror:
lac name
dac 1f
lac d1
sys write; 1:..; 4
lac d1
sys write; 1f; 1
fmp floop1
1: 077012
hangup:
lac d1
sys write; m1; m1s
jmp stop
abort:
lac d1
sys write; m2; m2s
jmp stop
nofiles:
lac d1
sys write; m3; m3s
sys exit
discon:
lac d1
sys write; m4; m4s
jmp stop
m1:
<ha>;<ng>;<up>;012
m2s = .-m1
m2:
<ab>;<or>;<te>;<d 012
m2s = .-m2
m3:
<us>;<ag>;<e;<:;040;<ad>;<m 040; <fi>;<le>;<s 012
<di>;<al>;040;<x;<5;<3;<8;<0 040; <on>;040;<th>;<e 040
<da>;<ta>;<ph>;<on>;<e 012
m3s = .-m3
m4:
<di>;<sc>;<on>;<ne>;<ct>;<ed>;012
m4s = .-m4
stop:
dpof
las
and o400000
sna
sys save
sys exit
carrier: 0100000
ilock: 040000
totime: 300
disflg: 0
flush: 0
lac noc
sna
jmp flush i
law 0104
jms message; tbuf
law tbuf
dac opt
dzm noc
jmp flush i
gcard: 0
lac gcard i
isz gcard
sna
jmp 3f
lrss 9
sad o45
jmp 1f
jms putc
jmp gcard+1
1:
-1
tad gcard i
cma
dac 2f
isz gcard
1:
law 040
jms putc
isz 2f
jmp 1b
jmp gcard+1
2: 0
3:
lac noc
sna
jmp gcard i
sad d80
jmp gcard i
law 040
jms putc
jmp 3b
done:
jms gcard; <$;<%;6;<e;<n;<d;<c;<o;<p;<y;0
jms gcard; <$;<%;6;<s;<y;<s;<o;<u;<t;<%;2;<p;<*;0
jms gcard; <$;<%;6;<e;<n;<d;<j;<o;<b;0
-1
dac disflg
1:
jms gcard; <$;<*;<$;<d;<i;<s;0
jmp 1b
putw: 0
dac 1f
lrss 9
jms putc
lac 1f
jms putc
jmp putw i
1: 0
putc: 0
and o177
dac opt i
-0141
tad opt i
spa
jmp 1f
-0173
tad opt i
sma
jmp 1f
-040
tad opt i
dac opt i
1:
isz opt
isz noc
lac noc
sad d160
skp
jmp putc i
dzm noc
law tbuf
dac opt
law 0110
jms message; tbuf
jmp putc i
noc: 0
opt: tbuf
connect: 0
dpon
dpop
law 4
sys sysloc
tad d14
dac systime
law 11
sys sysloc
dac dpstat
tad d1
dac dpread
tad d1
dac dpwrite
tad d1
dac dpchar
dzm dpstat i
las
dac opch
1:
las
sad opch
skp
jmp abort
sys time
lac dpstat i
and ilock
sna
jmp 1b
law 041
dac echoch
law 0102
jms message; 0
jmp i connect
message: 0
dac stsch
retry:
lac dpstat i
and carrier
sza
jmp retry
dprs
and ilock
sna
jmp hangup
lac d1
dac dpwrite i
sys time
lacq
tad totime
dac rctim
" put out 6 sync characters
-6
dac c2
1:
law 026
jms transch
isz c2
jmp 1b
" put out stx character
law 002
jms transch
dzm sum
" put out the status character
lac stsch
jms transch
" echo the sequence character
lac echoch
jms transch
" if there is a buffer pointer
" put out 160 words of data
-1
tad i message
spa
jmp 2f
dac 10
-160
dac c2
1:
lac 10 i
jms transch
isz c2
jmp 1b
" put out etx character
2:
law 003
jms transch
" put out lateral parity
lac sum
jms transch
" put out a sync
law 026
jms transch
" loop looking for stx
1:
jms recvch
sad o2
skp
jmp 1b
dzm sum
" pick up op code
jms recvch
spa
jmp error
dac opch
" pick up sequence character
jms recvch
spa
jmp error
dac seqch
sad echoch
jmp error
" skip over data block to etx character
1:
jms recvch
spa
jmp error
sad o3
skp
jmp 1b
" pick up the lateral parity character
jms recvch
lac sum
and o177
sza
jmp error
" and exit
lac seqch
dac echoch
-1
dac 7
isz message
lac opch
sad o122
jmp i message
lac distlg
sna
jmp discon
jmp stop
transch: 0
lmq
xor sum
dac sum
1:
jms checktim
lac dpwrite i
sna
jmp 1b
dzm dpwrite i
lacq
dpwc
jmp i transch
recvch: 0
1:
jms checktim
lac dpread i
sna
jmp 1b
dzm dpread i
lac dpchar i
xor sum
dac sum
lac dpchar i
jmp i recvch
checktim: 0
lac systime i
cma
tad rctim
spa
jmp error
jmp i checktim
error:
lac stsch
lmq
lac o2
omq
dac stsch
jmp retry
d1: 1
d4: 4
o60: 060
o12: 012
dm4: -4
o45: 045
o177: 0177
d160: 160
d80: 80
d14: 14
o400000: 0400000
o577777: 0577777
o200500: 0200500
o122: 0122
o3: 3
o2: 2
lactab: lac .+1
0060;0061;0062;0063;0064;0065;0066;0067
0070;0071;0133;0043;0100;0072;0076;0077
0040;0101;0102;0103;0104;0105;0106;0107
0110;0111;0046;0056;0135;0050;0074;0134
0136;0112;0113;0114;0115;0116;0117;0120
0121;0122;0055;0044;0052;0051;0073;0047
0053;0057;0123;0124;0125;0126;0127;0130
0131;0132;0137;0054;0045;0075;0042;0041
dpstat: .=.+1
dpread: .=.+1
dpwrite: .=.+1
dpchar: .=.+1
systime: .=.+1
opch: .=.+1
stsch: .=.+1
echoch: .=.+1
seqch: .=.+1
tbuf: .=.+160
buf: .=.+48
ibuf: .=.+64
rctim: .=.+1
fi: .=.+1
c1: .=.+1
c2: .=.+1
sum: .=.+1
dpon = 0704701
dpof = 0704704
dpwc = 0704722
dpop = 0704764
dprs = 0704752

View File

@@ -0,0 +1,683 @@
" apr
lac 017777 i
sad d4
jmp nofiles
lac 017777
tad d1
dac name
jms connect
sys time
llss 9
ecla llss 3
tad o60
alss 9
dac snumb
ecla llss 3
tad o60
alss 9
dac snumb+1
ecla llss 3
tad o60
alss 9
dac snumb+2
lac d1
sys write; snumb; 3
lac d1
sys write; o12; 1
jms gcard; <$;<*;<$;<7;<c;<%;67;0
jms gcard; <$;<*;<$;<r;<c;<d;<%;66;0
jms gcard; <$;<%;6;<s;<n;<u;<m;<b;<%;3;<7;<c
snumb:
<x;<x;<x;<,;<3;<1;<%;49;0
jms gcard; <$;<%;6;<i;<d;<e;<n;<t;<%;3;<m;<0;<1;<3;<0;<,
<m;<3;<2;<2;<,;<k;<e;<n;<%;48;0
jms gcard; <$;<%;6;<s;<e;<l;<e;<c;<t;<%;2;<k;<e;<n
</;<p;<r;<n;<o;<f;<f;<%;47;0
jms gcard; <$;<%;6;<l;<i;<m;<i;<t;<s;<%;2;<2;<,;<,;<,
<9;<0;<0;<0;<%;49;0
jms gcard; <$;<%;6;<d;<a;<t;<a;<%;4;<i;<*;<,;<,;<c;<o;<p;<y;<%;49;0
jmp 1f
floop:
lac fi
sys close
1:
law 041
jms putc
law 040
jms putc
law 044
jms putc
law040
jms putc
floop1:
lac 017777 i
sad d4
jmp done
tad dm4
dac 017777 i
lac name
tad d4
dac name
sys open; name; ..; 0
spa
jmp ferror
dac fi
jmp loop
ferror:
lac name
dac 1f
lac d1
sys write; 1;..; 4
lac d1
sys write; 1f; 1
jmp floop1
1: 077012
loop:
dzm crflg
dzm col
law cbuf1-1
dac 8
-200
dac c
1:
dzm 8 i
isz c
jmp 1b
cloop:
jms getc
dac ch
sad o4
jmp pass2
sad o12
jmp pass2
sad o10
jmp bksp
sad o15
jmp cret
sad o40
jmp 1f
law cbuf1
tad col
dac t
lac t i
sza
jmp inb2
lac ch
dac t i
1:
isz col
jmp cloop
inb2:
law cbuf2
tad col
dac t
dac crflg
lac ch
dac t i
isz col
jmp cloop
bksp:
-1
tad col
spa
cla
dac col
jmp cloop
cret:
czm col
jmp cloop
pass2:
law cbuf1
p21:
dac t
dzm case
-100
dac c
dzm nblank
p2loop:
lac t i
sna
jmp blk
-1
tad nblank
spa
jmp 2f
cma
dac c1
1:
law 040
jms putc
isz c1
jmp 1b
dzm nblank
2:
law casetab
tad t i
dac t1
lac t1 i
sad case
jmp 1f
sad d2
jmp 1f
dac case
law 041
jms putc
law 041
jms putc
1:
lac t i
sad o44
jmp dol
sad o41
law 045
sad o77
law 0100
sad o134
law 0137 " ??
sad o137
law 055
sad o140
law 0134
sad o173
law 0133
sad o174
law 046
sad o175
law 0135
sad o176
law 0137 " ??
jms putc
jmp p2test
dol:
law 044
jms putc
law 044
jms putc
jmp p2test
blk:
isz nblank
p2test:
isz t
isz c
jmp p2loop
lac crflg
sna
jmp 1f
law 041
jms putc
law 060
jms putc
law 044
jms putc
law 040
jms putc
dzm crflg
law cbuf2
jmp p21
1:
law 044
jms putc
law 040
jms putc
lac ch
sad o4
jmp floop
jmp loop
getc: 0
lac ipt
sad eipt
jmp 1f
dac 2f
add o400000
dac ipt
ral
lac 2f i
szl
lrss 9
and o177
sna
jmp getc+1
jmp getc i
1:
lac fi
sys read; rbuf; 64
sna
jmp 1f
tad iipt
dac eipt
lac iipt
dac ipt
jmp getc+1
1:
lac o4
jmp getc i
hangup:
lac d1
sys write; m1; m1s
jmp stop
abort:
lac d1
sys write; m2; m2s
nofiles:
lac d1
sys write; m3; m3s
sys exit
discon:
lac d1
sys write; m4; m4s
jmp stop
m1:
<ha>;<ng>;<up>;012
m1s = .-m1
m2:
<ab>;<or>;<te>;<d 012
m2s = .-m2
m3:
<us>;<ag>;<e;<;;040;<ap>;<r 040; <fi>;<le>;<s 012
<di>;<al>;040;<x;<5;<3;<8;<0 040; <on>;040;<th>;<e 040
<da>;<ta>;<ph>;<on>;<e 012
m3s = .-m3
m4:
<di>;<sc>;<on>;<ne>;<ct>;<ed>;012
m4s = .-m4
stop:
dpof
sys exit
ipt: 0
eipt: 0
iipt: rbuf
fi: 0
opt: tbuf
noc: 0
carrier: 0100000
ilock: 040000
totime: 300
disflg: 0
casetab:
2;2;2;2;2;2;2;2
2;2;2;2;2;2;2;2
2;2;2;2;2;2;2;2
2;2;2;2;2;2;2;2
2;1;2;2;2;0;0;2
2;2;2;2;2;0;2;2
2;2;2;2;2;2;2;2
2;2;2;2;2;2;2;1
0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;0
0;0;0;0;0;0;0;0
0;0;0;0;0;0;2;1
2;1;1;1;1;1;1;1
1;1;1;1;1;1;1;1
1;1;1;1;1;1;1;1
1;1;1;1;1;1;1;1
gcard: 0
lac gcard i
isz gcard
sna
jmp gcard i
irss 9
sad o45
jmp 1f
jms putc
jmp gcard+1
1:
-1
tad gcard i
cma
dac 2f
isz gcard
1:
law 040
jms putc
isz 2f
jmp 1b
jmp gcard+1
2: 0
done:
lac noc
sna
jmp 1f
sad d72
jmp 1f
law 040
jms putc
jmp done
1:
jms gcard; <$;<%;6;<e;<n;<d;<c;<o;<p;<y;<%;58;0
jms gcard; <$;<%;6;<s;<y;<s;<o;<u;<t;<%;2;<p;<*;<%;55;0
jms gcard; <$;<%;6;<e;<n;<d;<j;<o;<b;<%;59;0
-1
dac disflg
1:
jms gcard; <$;<*;<$;<d;<i;<s;<%;66;0
jmp 1b
putc: 0
and o177
dac opt i
-0141
tad opt i
spa
jmp 1f
-0173
tad opt i
sma
jmp 1f
-040
tad opt i
dac opt i
1:
isz opt
isz noc
lac noc
sad d144
skp
jmp putc i
dzm noc
law tbuf
dac opt
law 0110
jms message; tbuf
jmp putc i
connect: 0
dpon
dpop
law 4
sys sysloc
tad d14
dac systime
law 11
sys sysloc
dac dpstat
tad d1
dac dpread
tad d1
dac dpwrite
tad d1
dac dpchar
dzm dpstat i
las
dac opch
1:
las
sad opch
skp
jmp abort
sys time
lac dpstat i
and ilock
sna
jmp 1b
law 041
dac echoch
law 0102
jms message; 0
jmp i connect
message: 0
dac stsch
retry:
lac dpstat i
and carrier
sza
jmp retry
dprs
and ilock
sna
jmp hangup
lac d1
dac dpwrite i
sys time
lacq
tad totime
dac rctim
" put out 6 sync characters
-6
dac c2
1:
law 026
jms transch
isz c2
jmp 1b
" put out stx character
law 002
jms transch
dzm sum
" put out the status character
lac stsch
jms transch
" echo the sequence character
lac echoch
jms transch
" if there is a buffer pointer
" put out 160 words of data
-1
tad i message
spa
jmp 2f
dac 10
jms transcd
jms transcd
" put out etx character
2:
law 003
jms transch
" put out lateral parity
lac sum
jms transch
" put out a sync
law 026
jms transch
" loop looking for stx
1:
jms recvch
sad o2
skp
jmp 1b
dzm sum
" pick up op code
jms recvch
spa
jmp error
dac opch
" pick up sequence character
jms recvch
spa
jmp error
dac seqch
sad echoch
jmp error
" skip over data block to etx character
1:
jms recvch
spa
jmp error
sad o3
skp
jmp 1b
" pick up the lateral parity character
jms recvch
lac sum
and o177
sza
jmp error
" and exit
lac seqch
dac echoch
-1
dac 7
isz message
lac opch
sad o122
jmp i message
lac disflg
sna
jmp discon
jmp stop
transcd: 0
-72
dac c2
1:
lac 10 i
jms transch
isz c2
jmp 1b
-8
dac c2
1:
law 040
jms transch
isz c2
jmp 1b
jmp transch i
transch: 0
lmq
xor sum
dac sum
1:
jms checktim
lac dpwrite i
sna
jmp 1b
dzm dpwrite i
lacq
dpwc
jmp i transch
recvch: 0
1:
jms checktim
lac dpread i
sna
jmp 1b
dzm dpread i
lac dpchar i
xor sum
dac sum
lac dpchar i
jmp i recvch
checktim: 0
lac systime i
cma
tad rctim
spa
jmp error
jmp i checktim
error:
lac stsch
lmq
lac o2
omq
dac stsch
jmp retry
d1: 1
o60: 060
o122: 0122
d72: 72
o45: 045
o134: 0134
o140: 0140
o41: 041
o44: 044
o77: 077
o137: 0137
o173: 0173
o174: 0174
o175: 0175
o176: 0176
d128: 128
o400000: 0400000
o177: 0177
o2:d2: 2
o3: 3
d14: 14
d144: 144
o12: 012
d4:o4: 04
dm4: -4
o10: 010
o15: 015
o40: 040
crflg: .=.+1
col: .=.+1
t: .=.+1
t1: .=.+1
c: .=.+1
c1: .=.+1
c2: .=.+1
dpstat: .=.+1
dpread: .=.+1
dpwrite: .=.+1
dpchar: .=.+1
systime: .=.+1
opch: .=.+1
stsch: .=.+1
echoch: .=.+1
seqch: .=.+1
tbuf: .=.+144
rbuf: .=.+64
rctim: .=.+1
sum: .=.+1
ch: .=.+1
nblank: .=.+1
case: .=.+1
cbuf1: .=.+100
cbuf2: .=.+100
dpon = 0704701
dpof = 0704704
dpwc = 0704722
dpop = 0704764
dprs = 0704752

View File

@@ -0,0 +1,77 @@
" chmode
lac 017777 i
sad d4
jmp error
lac 017777
tad d4
dac 8
tad d1
dac name
dzm octal
dzm nchar
-8
dac c1
1:
lac nchar
dzm nchar
sza
jmp 2f
lac 8 i
lmq
and o177
dac nchar
lacq
lrss 9
2:
sad o40
jmp 3f
tad om60
lmq
lac octal
cll; als 3
omq
dac octal
3:
isz c1
jmp 1b
loop:
lac 017777 i
sad d8
sys exit
tad dm4
dac 017777 i
lac name
tad d4
dac name
lac octal
sys chmode; name:0
sma
jmp loop
lac name
dac 1f
lac d1
sys write; 1:0; 4
lac d1
sys write; 1f; 2
jmp loop
1:
040;077012
error:
lac d1
sys write; 1b+1; 1
sys exit
om60: -060
o40: 040
d1: 1
d8: 8
dm4: -4
d4: 4
o177: 0177
nchar: .=.+1
c1: .=.+1
octal: .=.+1

View File

@@ -0,0 +1,97 @@
" cp
lac 017777
tad d1
dac name2
loop:
lac 017777 i
sad d4
sys exit
sad d8
jmp unbal
tad dm8
dac 017777 i
lac name2
tad d4
dac name1
tad d4
dac name2
sys open; name1: 0; 0
spa
jmp error
lac o17
sys creat; name2: 0
spa
jmp error
dzm nin
1:
lac bufp
tad nin
dac 0f
-1
tad nin
cma
tad d1024
dac 0f+1
lac d2
sys read; 0:..;..
sna
jmp 2f
tad nin
dac nin
sad d1024
jmp 2f
jmp 1b
2:
lac nin
dac 2f
lac d3
sys write; buf; 2: 0
dzm nin
lac 2b
sad d1024
jmp 1b
lac d2
sys close
lac d3
sys close
jmp loop
error:
lac name1
dac 1f
lac d1
sys write; 1: 0; 4
lac d1
sys write; mes; 1
lac name2
dac 1f
lac d1
sys write; 1: 0; 4
lac d1
sys write; mes; 2
jmp loop
mes:
040000;077012
unbal:
lac name2
tad d4
dac 1f
lac d1
sys write; 1: 0; 4
lac d1
sys write; mes; 2
sys exit
d1: 1
d4: 4
d8: 8
o17: 017
dm8: -8
d3: 3
d1024: 1024
nin: 0
bufp: buf
d2: 2
buf:

View File

@@ -0,0 +1,256 @@
" dmabs
lac o17
sys creat; punout
spa
sys save
dac fo
lac 017777
tad d1
dac name
jms space
100
loop:
dzm oldsum
lac initcmd
dac comand
lac i 017777
sad d4
jmp stop
tad dm4
dac i 017777
lac name
tad d4
dac name
dump1:
lac comand
xor dactra
dac tracmd
dump2:
sys open; name: 0; 0
spa
jmp opnerr
dac fi
-bootsiz
dac c1
law boot-1
dac 8
1:
lac i 8
jms put
isz c1
jmp 1b
lac bootcmd
lrs 12
jms put1
lac bootcmd
lrs 6
jms put1
lac bootcmd
and o77
xor o300
jms put2
jms space
3
dump3:
-1
tad bufp
dac 8
-64
dac c1
1:
dzm i 8
isz c1
jmp 1b
lac fi
sys read; bufp: buf; 64
sna
jmp done
dac count
-1
tad bufp
dac 8
-64
dac c1
cla
1:
add i 8
isz c1
jmp 1b
sna
jmp dump4
dac newsum
lac comand
jms put
lac count
jms put
lac oldsum
add comand
add count
jms put
lac newsum
dac oldsum
jms space
3
-1
tad bufp
dac 8
-1
tad count
cma
dac c1
1:
lac i 8
jms put
isz c1
jmp 1b
jms space
10
dump4:
lac comand
tad count
dac comand
jmp dump3
done:
lac tracmd
jms put
cla
jms put
lac oldsum
add tracmd
jms put
jms space
20
lac fi
sys close
jmp loop
stop:
cla
jms put
jms space
100
sys exit
space: 0
-1
tad i space
cma
dac c1
isz space
1:
lac o400
jms put2
isz c1
jmp 1b
jmp i space
put: 0
dac 1f
lrs 12
jms put1
lac 1f
lrs 6
jms put1
lac 1f
jms put1
jmp i put
1:0
put1:0
and o77
xor o200
jms put2
jmp i put1
put2: 0
dac 1f
lac fo
sys write; 1f; 1
jmp i put2
1: 0
boot:
org = 017740
2:
jms get1-boot+org
dac cmd-boot+org
jms get1-boot+org
cma
dac cnt-boot+org
jms get2-boot+org
xor sum-boot+org
dzm sum-boot+org
cla cll sza
hlt
isz cnt-boot+org
1:
jms get1-boot+org
cmd: 0
isz cmd-boot+org
isz cnt-boot+org
jmp 1b-boot+org
jmp 2b-boot+org
get1: 0
jms get2-boot+org
dac get2-boot+org
add sum-boot+org
dac sum-boot+org
lac get2-boot+org
jmp i get1-boot+org
get2: 0
iot 0144
1:
iot 0101
jmp 1b-boot+org
iot 0112
jmp i get2-boot+org
sum: 0
cnt = sum+1
bootsiz = .-boot
bootcmd: jmp org
opnerr:
lac name
dac 1f
lac d1
sys write; 1: 0; 4
lac d1
sys write; mes; 2
jmp loop
mes:
040;077012
comand: 0
tracmd: 0
d1: 1
.17777: 017777
o77: 077
o200: 0200
o300: 0300
d4: 4
d64: 64
dm4: -4
o400: 0400
punout: <pp>;<to>;<ut>;040040
o17: 017
fi: 0
fo: 0
count: 0
oldsum: 0
newsum: 0
daccmd: dac
dactra: dac jmp
initcmd: dac 0
c1: 0
buf:
iot = 0700000

View File

@@ -0,0 +1,771 @@
"** 08-rest.pdf page 8
"[handwritten page number top right of scan - 1]
" ed1
lac d1
sys write; 1f; 3
lac o17
sys creat; tname
spa
sys save
dac sfo
sys open; tname; 0
spa
sys save
dac sfi
-1
tad lnodp
dac zermp
tad d1
dac zerop
dac dot
tad d1
dac eofp
dzm i eofp
dzm i zerop
dzm lastre
dzm fbuf
lac d1
dac dskadr
dac wrlfg
dzm diskin
"o------------> [scan markup]
jmp advanc
1:
<ed>; <it>; 012
advanc:
jms rline
lac linep
dac tal
dzm adrflg
jms addres
jmp comand
-1
dac adrflg
lac addr
dac addr1
dac addr2
1:
lac char
sad o54
jmp 2f
sad o73
skp
jmp chkwrp
lac addr
dac dot
2:
jms addres
jmp error
lac addr2
dac addr1
lac addr
dac addr2
jmp 1b
"** 08-rest.pdf page 9
"[handwritten page number top right of scan - 2]
chkwrp:
-1
tad addr1
jms betwen; d1; addr2
jmp error
comand:
lac char
sad o141
jmp ca
sad o143
jmp cc
sad o144
jmp cd
sad o160
jmp cp
sad o161
jmp cq
sad o162
jmp cr
sad o163
jmp cs
sad o167
jmp cw
sad o12
jmp cnl
sad o75
jmp ceq
jmp error
ca:
jms newline
jms setfl
lac addr2
dac dot
ca1:
jms rline
lac line
sad o56012
jmp advanc
jms append
jmp ca1
cc: cd:
jms newline
jms setdd
lac addr1
sad zerop
jmp error
dac dot
tad dm1
dac 9
lac addr2
dac 8
2:
lac i 8
dac i 9
sza
jmp 2b
"??? illegible line cut off - dac 0, lac 0, something else???
"** 08-rest.pdf page 10
"[handwritten page number top right of scan - 3]
dac eofp
lac char
sad o144
jmp advanc
-1
tad dot
dac dot
jmp ca1
cp:
jms newline
cp1:
jms setdd
lac addr1
sad zerop
jmp error
1:
lac addr1
dac dot
lac i addr1
jms gline
dac 2f
lac d1
sys write; line; 2: 0
lac addr1
sad addr1
jmp advanc
tad d1
dac addr1
jmp 1b
cq:
jms newline
lac adrflg
sza
jmp error
sys exit
cr:
jms setfl
lac addr2
dac dot
jms rname
"------------> [scan markup]
sys open; fbuf; 0
spa
jmp error
dac tfi
lac linep
dac tal
dzm num
1:
lac tfi
sys read; tbuf; 64
sza
jmp 2f
lac tfi
sys close
jms number
jmp advanc
2:
"??? illegible line cut off - cma, sma, something else?
"** 08-rest.pdf page 11
"[handwritten page number top right of scan - 4]
tad d1
rcl
dac c1
lac tbufp
dac tal1
2:
jms getsc; tal1
sna
jmp 3f
jms putsc; tal
isz num
sad o12
skp
jmp 3f
lac tal
add o400000
and o17777
cma
tad linep
cma
dac linsiz
jms append
lac linep
dac tal
3:
isz c1
jmp 2b
jmp 1b
cw:
jms setfl
lac i addr1
sna
jmp error
jms rname
lac o17
sys creat; fbuf
spa
jmp error
dac tfi
-128
dac c2
lac tbufp
dac tal1
dzm num
1:
lac i addr1
jms gline
rcl
cma
tad d1
dac c1
lac linep
dac tal
2:
jms getsc; tal
sna
jmp 3f
isz num
jmp putsc; tal1
isz c2 "???
"** 08-rest.pdf page 12
"[handwritten page number top right of scan - 5]
jmp 3f
lac tfi
sys write; tbuf; 64
-128
dac c2
lac tbufp
dac tal1
3:
isz c1
jmp 2b
lac addr1
sad addr2
jmp 1f
isz addr1
jmp 1b
1:
lac tal1
sma cla
jmp 1f
jms putsc; tal1
1:
-1
tad tufp
cma
tad tal1
dac 1f
lac tfi
sys write; tbuf; 1: 0
lac tfi
sys close
jms number
jmp advanc
cn1:
lac adrflg
sna
jmp 1f
lac addr2
dac addr1
jmp cp1
1:
lac dot
tad d1
sad eofp
jmp error
dac dot
jmp cp1
ceq:
jms newline
jms setfl
lac addr2
dac dot
cma
tad zerop
cma
dac num
jms number
jmp advanc
setdd: 0
"** 08-rest.pdf page 13
"[handwritten page number top right of scan - 6]
lac adrflg
sza
jmp i setdd
lac dot
dac addr1
dac addr2
jmp i setdd
setfl: 0
lac adrflg
sza
jmp i setfl
lac zerop
tad d1
dac addr1
-1
tad eofp
dac addr2
jmp i setfl
newline: 0
jms getsc; tal
sad o12
jmp i newline
jmp error
addres: 0
dzm minflg "..) [stray scan mark?]
-1
dac addr
ad1:
jms getsc; tal
ad2:
jms betwen; d47; d56
skp
jmp numb
sad o40 "[o40 circled in scan]
jmp ad1 "[hand drawn check mark follows operand in scan]
sad o11
jmp ad1 "[hand drawn check mark follows operand in scan]
"[check mark underlined in scan]
sad o55
jmp amin "[hand drawn check mark follows operand in scan]
sad o56
jmp adot "[hand drawn check mark follows operand in scan]
sad o53
jmp ad1 "[hand drawn check mark follows operand in scan]
sad o44
jmp adol "[hand drawn check mark follows operand in scan]
sad o57
jmp fsrch "[hand drawn check mark follows operand in scan]
sad o77
jmp bsrch "[hand drawn check mark follows operand in scan]
dac char
lac minflg
sza
jmp error
lac addr
sma
isz addres
jmp i addres
"** 08-rest.pdf page 14
"[handwritten page number top right of scan - 7]
adot:
lac minflg
sza
jmp error
lac addr
sma
jmp error
lac dot
dac addr
jmp ad1
adol:
lac minflg
sza
jmp error
lac addr
sma
jmp error
-1
tad eofp
dac addr
jmp ad1
amin:
-1
dac minflg
jmp ad1
numb:
dac char
sad o60
jmp 1f
lac d10
jmp 2f
1:
lac d8
2:
dac 2f
dzm num
1:
lac num
cll; mul; 2: 0
lacq
tad char
tad dm48
dac num
jms getsc; tal
dac char
jms betwen; d47; d58
skp
jmp 1b
lac minflg
sna
jmp 1f
-1
tad num
cma
dac num
dzm minflg
1:
lac addr
"** 08-rest.pdf page 15
"[handwritten page number top right of scan - 8]
spa
lac zerop
tad num
dac addr
jms betwen; zermp; eofp
jmp error
lac char
jmp ad2
number: 0
lac d100000
dac n1
law tbuf-1
dac 8
n0:
lac num
cll; idiv; n1: 0
dac num
lacq
tad d48
dac i 8
lac n1
cll; idiv; 10
lacq
dac n1
sza
jmp n0
lac o12
dac i 8
law tbuf-1
dac 8
dac 9
-5
dac n1
n2:
lac i 8
sad d48
skp
jmp n3
dzm i 9
isz n1
jmp n2
n3:
lac d1
sys write; tbuf; 7
jmp i number
rname: 0
lac fbufp
dac tal1
-8
dac c1
1:
jms getsc; tal
sad o40
jmp 1b
sad o12
jmp 1f
jms putsc; tal1
isz c1
jmp 1b
"** 08-rest.pdf page 16
"[handwritten page number top right of scan - 9]
jmp i rname
1:
lac tal1
sad fbufp
skp
jmp 1f
lac fbuf
sna
jmp error
jmp i rname
1:
lac o40
jms putsc; tal1
isz c1
jmp 1b
jmp i rname
gline: 0
dac glint1
jms getdsk
lac glint1 " [these 6 lines were surrounded by a box
adn o17777 " that was Xed out with an arrow pointing to it]:
tad dskbfp " --
dac ital "|\/|
lac linep "|/\|<---
dac otal " --
1:
lac ital
sad edskbfp
skp
jmp 2f
lac diskin
tad d1024
jms getdsk
lac dskbfp
dac ital
2:
jms getsc; ital
jms putsc; otal
sad o12
skp
jmp 1b
lac otal
sma
jmp 1f
cla
jms putsc; otal
1:
lac linpm1
cma
tad otal
jmp i gline
rline: 0
lac linep
dac tal
1:
cla
sys read; char; 1
lac char
"** 08-rest.pdf page 17
"[handwritten page number top right of scan - 10]
lrss 9
jms esc
lac char
and o777
jms esc
jmp 1b
esc: 0
sna
jmp i esc
jms putsc; tal
sad o12
jmp 2f
sad o100
jmp 1f
sad o43
skp
jmp i esc
-1
tad tal
dac tal
and o17777
sad linpm1
jmp 1f
jmp i esc
1:
lac linep
dac tal
jmp i esc
2:
lac tal
sma cla
jmp 1f
jms putsc; tal
1:
-1
tad linep
cma
tad tal
dac linsiz
jmp i rline
getsc: 0
lac i getsc
dac sctalp
isz getsc
lac i sctalp
dac sctal
add o400000
dac i sctal
ral
lac i sctal
szl
lrss 9
and o777
jmp i getsc
putsc: 0
and o777
"** 08-rest.pdf page 18
"[handwritten page number top right of scan - 11]
lmq
lac i putsc
dac sctalp
isz putsc
lac i sctalp
dac sctal
add o400000
dac i sctalp
sma cla
jmp 1f
llss 27
dac i sctal
lrss 9
jmp i putsc
1:
lac i sctal
and o777000
omq
dac i sctal
lacq
jmp i putsc
append: 0
-1
tad eofp
dac 8
cma
tad dot
dac apt1
1:
lac i 8
dac i 8
-3
tad 8
dac 8
isz apt1
jmp 1b
isz eofp
dzm i eofp
isz dot
jms addline
jmp i append
addline: 0
lac dskadr
dac i dot
jms getdsk "[line crossed out - scan markup]
-1
tad linsiz
cma
dac apt1
law line-1
dac 8
lac dskadr "[line crossed out - scan markup]
and o1777 "[line crossed out - scan markup]
tad dskbfp "[line crossed out - scan markup]
dac otal "[line crossed out - scan markup]
lac dskadr "[line crossed out - scan markup]
tad linsiz "[line crossed out - scan markup]
dac dskadr "[line crossed out - scan markup]
"** 08-rest.pdf page 19
"[handwritten page number top right of scan - 12]
1:
lac otal " [these 9 lines were surrounded by a box
sad edskbfp " that was Xed out]:
skp " --
jmp 2f "|\/|
lac diskin "|/\|
tad d1024 " --
jms getdsk "
lac dskbfp "
dac otal "
2: "[line crossed out - scan markup]
lac i 8
dac i otal "[line crossed out and a note that looks like *jms prtwrd*]
isz otal
dzm wrflg "[line crossed out - scan markup]
isz apt1
jmp 1b
jmp i addline
getdsk: 0 "[the entire getdsk procedure was surrounded
and o776000 " by a box that was Xed out]:
sad diskin " --
jmp i getdsk "|\/|
dac 2f "|/\|
lac wrflg " --
sza "
jmp 3f "
lac diskin "
dac 1f "
lac sfo "
sys seek; 1: 0; 0 "
lac sfo "
sys write; dskbuf; 1024 "
lac d1 "
dac wrflg "
3: "
lac 2f "
dac diskin "
lac sfi "
sys seek; 2: 0; 0 "
spa "
jmp i getdsk "
lac sfi "
sys read; dskbuf; 1024 "
jmp i getdsk "
betwen: 0
dac bett1
lac i betwen
dac bett2
isz betwen
lac i bett2
cma
tad bett1
spa
jmp 1f
lac i betwen
dac bett2
isz betwen
-1
tad i bett2
"** 08-rest.pdf page 20
"[handwritten page number top right of scan - 13]
cma
tad bett1
spa
1:
isz betwen
lac bett1
jmp i betwen
error:
lac d1
sys write; 1f; 1
jmp advanc
1:
077012

View File

@@ -0,0 +1,291 @@
" init
-1
sys intrp
jms init1
jms init2
1:
sys rmes
sad pid1
jmp 1f
sad pid2
jms init2
jmp 1
1:
jms init1
jmp 1
init1: 0
sys fork
jmp 1f
sys open; ttyin; 0
sys open; ttyout; 1
jmp login
1:
dac pid1
jmp init1 i
init2: 0
sys fork
jmp 1f
sys open; keybd; 0
sys open; displ; 1
jmp login
1:
dac pid2
jmp init2 i
login:
-1
sys intrp
sys open; password; 0
lac d1
sys write; m1; m1s
jms rline
lac ebufp
dac tal
1:
jms gline
law ibuf-1
dac 8
law obuf-1
dac 9
2:
lac 8 i
sac o12
lac o72
sad 9 i
skp
jmp 1b
sad o72
skp
jmp 2b
lac 9 i
sad o72
jmp 1f
-1
tad 9
dac 9
lac d1
sys write; m3; m3s
jms rline
law ibuf-1
dac 8
2:
lac 8 i
sad o12
lac o72
sad 9 i
skp
jmp error
sad o72
skp
jmp 2b
1:
dzm nchar
law dir-1
dac 8
1:
lac 9 i
sad o72
jmp 1f
dac char
lac nchar
sza
jmp 2f
lac char
alss 9
xor o40
dac 8 i
dac nchar
jmp 1b
2:
lac 8
dac nchar
lac nchar i
and o777000
xor char
dac nchar i
dzm nchar
jmp 1b
1:
dzm nchar
1:
lac 9 i
sad o12
jmp 2f
tad om60
lmq
lac nchar
cll; als 3
omq
dac nchar
jmp 1b
2:
lac nchar
sys setuid
sys chdir; dd
sys chdir; dir
lac d2
sys close
sys open; sh; 0
sma
jmp 1f
sys link; system; sh; sh
spa
jmp error
sys open; sh; 0
spa
jmp error
sys unlink; sh
1:
law 017700
dac 9
law boot-1
dac 8
1:
lac 8 i
dac 9 i
sza
jmp 1b
jmp 017701
boot:
lac d2
lmq
sys read; 4096; 07700
lacq
sys close
jmp 4096
0
rline: 0
law ibuf-1
dac 8
1:
cla
sys read; char; 1
lac char
lrss 9
sad o100
jmp rline+1
sad o43
jmp 2f
dac 8 i
sad o12
jmp rline i
jmp 1b
2:
law ibuf-1
sad 8
jmp 1b
-1
tad 8
dac 8
jmp 1b
gline: 0
law obuf-1
dac 8
1:
jms gchar
dac 8 i
sad o12
jmp gline i
jmp 1b
gchar: 0
lac tal
sad ebufp
jmp 1f
ral
lac tal i
snl
lrss 9
and o777
lmq
lac tal
add o400000
dac tal
lacq
sna
jmp gchar+1
jmp gchar i
1:
lac bufp
dac tal
1:
dzm tal i
isz tal
lac tal
sad ebufp
skp
jmp 1b
lac bufp
dac tal
lac d2
sys tead; buf; 64
sna
jmp error
jmp gchar+1
error:
lac d1
sys write; m2; m2s
lac d1
sys smes
sys exit
m1:
012; <lo>;<gi>;<n;<:;<
m1s = .-m1
m2:
<?; 012
m2s = .-m2
m3:
<pa>;<ss>;<wo>;<rd>;<: 040
m3s = .-m3
dd:
<dd>;040040;040040;040040
dir:
040040;040040;040040;040040
ttyin:
<tt>;<yi>;<n 040;040040
ttyout:
<tt>;<yo>;<ut>; 040040
keybd:
<ke>;<yb>;<oa>;<rd>
displ:
<di>;<sp>;<la>;<y 040
sh:
<sh>; 040040;040040;040040
system:
<sy>;<st>;<em>; 040040
password:
<pa>;<ss>;<wo>;<rd>
d1: 1
o43: 043
o100: 0100
o400000; 0400000
d2: 2
o12: 012
om60: -060
d3: 3
ebufp: buf+64
bufp: buf
o777: 0777
o777000: 0777000
o40: 040
o72: 072
ibuf: .=.+100
obuf: .=.+100
tal: .=.+1
buf: .=.+64
char: .=.+1
nchar: .=.+1
pid1: .=.+1
pid2: .=.+1

View File

@@ -0,0 +1,195 @@
" S1
.. = 0
t = 0
orig:
hlt
jmp pibreak
. = orig+7
-1
. = orig+020
1f
iof
dac u.ac
lac 020
dac 1f
lac 1f-1
dac 020
lac u.ac
jmp 1f+1
1f
1: 0
iof " interrupts off
dac u.ac " save user AC
lacq
dac u.mq " save user MQ
lac 8
dac u.rq " save user auto-index location 8
lac 9
dac u.rq+1 " save user auto-index location 9
jms copy; 10; u.rq+2; 6 " save user auto-index locations 10-15
lac 1b " load user PC after system call
dac u.rq+8 " save user PC
-1 " load -1
dac .savblk " set "save" flag (cleared by disk I/O?)
dac .insys " set "in system" flag
lac uquant " load user quantum count
jms betwen; d0; maxquant " check if between 0 & maxquant??
jms swap " no: swap processes
ion " interrupts on
-1
tad u.rq+8 " get address of system call
jms laci " load AC indirect??
jms betwen; o20001; swn " range check
jmp badcal " bad system call
tad swp " add system call table base
dac .+1 " save as next instruction
jmp .. i " dispatch system call
. = orig+0100
jmp coldentry
jms halt
okexit:
dzm u.ac " 'OK' system call exit: clear user AC
sysexit: " common system call exit code
ion " enable interrupts
lac .savblk " load "save" flag
sza " is zero (cleared by disk I/O)?
jmp 1f " no: no disk I/O done?
jms copy; sysdata; dskbuf; 64 " copy system data to disk buffer
cla
jms dskio; 07000 " save to disk?
1:
dzm .insys " clear "in system call" flag
jms chkint
skp
jmp .save " dump core??
jms copy; u.rq+2; 10; 6 " restore auto-index locations 10-15
lac u.rq+1 " restore auto-index location 9
dac 9
lac u.rq " restore auto-index location 8
dac 8
lac u.mq " restore MQ register
lmq
lac u.ac " restore AC register
jmp u.rq+8 i " return to user
swap: 0
ion
1:
jms lookfor; 3 " out/ready
jmp 1f
jms lookfor; 1 " in/ready
skp
jmp 1b
dzm maxquant
jmp 3f
1:
dac 9f+t
jms lookfor; 2 " in/notready
jmp 1f
jms lookfor; 1 " in/ready
jmp 1f
jmp 2f
1:
lac swap
dac u.swapret
iof
lac o200000
tad u.ulistp i
dac u.ulistp i
ion
jms dskswap; 07000
lac u.dspbuf
sna
jmp 2f
law dspbuf
jms movdsp
2:
iof
lac o600000
tad 9f+t i
dac 9f+t i
ion
jms dskswap; 06000
lac u.swapret
dac swap
lac o20
dac maxquant
lac u.dspbuf
sza
"** 01-s1.pdf page 4
jms movdsp
3:
dzm uquant
iof
jmp swap i
t = t+1
swp: " system call dispatch table
jmp . " base instruction
.save; .getuid; .open; .read; .write; .creat; .seek; .tell
.close; .link; .unlink; .setuid; .rename; .exit; .time; .intrp
.chdir; .chmod; .chown; badcal; .sysloc; badcal; .capt; .rele
.status; badcal; .smes; .rmes; .fork
swn:
.-swp-1 i " count of system calls, plus indirect!
.intrp:
lac u.ac
dac u.intflg
jmp okexit
.sysloc: " "sysloc": syscall to return system addresses
lac u.ac
and o17777
jms betwen; d1; locn
jms error
tad locsw
dac .+1
lac ..
dac u.ac
jmp sysexit
locsw: " table of system data structures for "sysloc" call
lac .
iget; inode; userdata; sysdata; copy; copyz; betwen; dskrd
dskwr; dskbuf; dpdata; namei; pbsflgs; alloc; free; dspdata
crdata
locn:
.-locsw-1
chkint: 0
lac .insys
sza
jmp chkint i
lac .int1
sna
jmp 1f
sad u.ofiles+2
jmp 2f
1:
lac .int2
sna
jmp chkint i
sad u.ofiles+2
skp
jmp chkint i
dzm .int2
jmp 1f
2:
dzm .int1
1:
"** 01-s1.pdf page 5
lac u.intflg
sza
jmp chkint i
-1
dac .insys
ion
isz chkint
jmp chkint i

View File

@@ -0,0 +1,337 @@
"** 01-s1.pdf page 7
" s2
.status:
jms arg
dac .+5
jms arg
dac .+6
lac u.cdir
jms namei; ..
jms error
jms namei; ..
jms error
jms iget
lac u.ac
and o17777
jms betwen; o10000; o17762
jms error
dac .+3
jms copy; inode; ..; 12
lac d.i
dac 9 i
jmp okexit
.capt:
lac u.ac
dac u.dspbuf
jms movdsp
jmp sysexit
.rele:
dzm u.dspbuf
law dspbuf
jms movdsp
jmp sysexit
.chmod:
jms isown
lac u.ac
and o17
lmq
lac i.flags
and o777760
omq
dac i.flags
jms iput
jmp okexit
.chown:
jms isown
lac u.ac
dac i.uid
jms iput
jmp okexit
.getuid: " getuid system call
lac u.uid
dac u.ac " return u.uid in user AC
jmp sysexit
.seek:
jms seektell
tad u.base
"** 01-s1.pdf page 8
spa
jms error
lmq
lac f.flags
and d1
sna
jms 1f
lacq
jms betwen; d0; i.size
jms dacisize
jmp 2f
1:
lacq
jms betwen; d0; i.size
lac i.size
2:
dac f.badd
dac u.ac
jms fput
jmp sysexit
.tell:
jms seektell
cma
tad d1
tad u.base
dac u.ac
jmp sysexit
.link:
jms arg
dac 0f
jms arg
dac 1f
jms arg
dac 2f
lac d4
jms namei; 0:0
jms error
jms namei; 1:0
jms error
dac u.base
jms copy; 2:0; name; 4
lac u.cdir
jms namei; name
skp
jms error
lac d1
dac mode
jms access
jms dslot
lac u.base
jms iget
lac ii
dzm d.i
jms copy; name; d.name; 4
lac i.uniq
dac d.uniq
-1
tad i.nlks
dac i.nlks
"** 01-s1.pdf page 9
jms iput
jms dput
jmp okexit
.unlink:
jms argname
dac u.base
lac d1
dac mode
jms access
dac d.i
jms dput
lac u.base
jms iget
isz i.nlks
jmp 1f
jms itrunc
dzm i.flags
1:
jms iput
jmp sysexit
.setuid: " setuid system call
lac u.uid " load current user id
sma " negative?
jms error " no: error!!
lac u.ac " load user AC
dac u.uid " save as new uid
jmp sysexit
.rename:
jms arg
dac 0f
jms arg
dac 1f
lac u.cdir
jms namei; 0:0
jms error
lac d1
dac mode
jms access
jms copy; 1:0; d.name; 4
jmp okexit
" time system call returns line (mains) frequency ticks since boot?
" note: returns uptime!?
" at 60Hz, 36 bits would last 36+ years!
.time:
lac s.tim " load high order bits
dac u.ac " return in AC
lac s.tim+1 " load low order bits
dac u.mq " return in MQ
jmp sysexit
.chdir:
jms argname
jms iget
lac i.flags
and o20
sna
jms error
lac ii
dac u.cdir
"** 01-s1.pdf page 10
jmp okexit
.open:
jms arg
dac 0f
jms arg
sza
lac d1
sna
lac d2
dac mode
lac u.cdir
jms namei; 0:0
jms error
jms iget
jms access
lac i.flags
and o20
sna
jmp open1
lac mode
and d1
sna
jmp open1
lac u.uid
sma
jms error
jmp open1
.creat:
lac d1
dac mode
jms arg
dac .+2
jms copy; ..; name; 4
lac u.cdir
jms namei; name
jmp 1f
jms iget
jms access
lac i.flags
and o20
sna
jmp .+4
lac u.uid
sma
jms error
jms itrunc
cla
jms dacisize
jmp open1
1:
jms access
lac u.ac
and o17
jms icreat
open1:
jms fassign
jms error
jmp sysexit
"** 01-s1.pdf page 11
.close:
jms finac
dzm f.flags
jms fput
jmp sysexit
.read:
jms arg
and o17777
dac u.base
jms arg
dac u.count
lac u.base
jms betwen; o10000; o17777
jms error
tad u.count
jms betwen; u.base; o17777
jms error
dac u.limit
1:
jms finac
lac f.flags
and d1
sza
jms error
lac i.flags
and o40
sna
jmp 1f
iof
lac ii
tad swr
dac .+1
jmp .. i
1:
lac u.base
dac 1f+1
lac u.count
dac 1f+2
lac f.badd
1:
jms iread; ..; ..
jmp exitrw
.write:
jms arg
and o17777
dac u.base
jms arg
dac u.count
tad u.base
jms betwen; u.base; o17777
jms error
dac u.limit
jms finac
lac f.flags
and d1
sna
jms error
lac i.flags
and o40
"** 01-s1.pdf page 12
sna
jmp 1f
iof
lac ii
tad sww
dac .+1
jmp .. i
1:
lac u.base
dac 1f+1
lac u.count
dac 1f+2
lac f.badd
1:
jms iwrite; ..; ..
exitrw:
dac u.ac
tad f.badd
dac f.badd
jms iput
jms fput
jmp sysexit

View File

@@ -0,0 +1,354 @@
"** 01-s1.pdf page 14
" s3
searchu: 0
lac searchu i
dac 9f+t+1
-mnproc
dac 9f+t
law ulist-1
dac 8
1:
lac 8 i
dac lu
lac 8 i
dac lu+1
lac 8 i
dac lu+2
lac 8 i
dac lu+3
jms 9f+t+1 i
isz 9f+t
jmp 1b
isz searchu
jmp searchu i
t = t+2
lookfor: 0
jms searchu; 1f
isz lookfor
isz lookfor
jmp lookfor i
1: 0
lac lu
rtl; rtl; and o7
sad lookfor i
skp
jmp 1b i
-3
tad 8
and o17777
isz lookfor
jmp lookfor i
.fork:
jms lookfor; 0 " not-used
skp
jms error
dac 9f+t
isz uniqpid
lac uniqpid
dac u.ac
law sysexit
dac u.swapret
lac o200000
tad u.ulistp i
dac u.ulistp i
jms dskswap; 07000
lac 9f+t
dac u.ulistp
lac o100000
xor u.ulistp i
dac u.ulistp i
lac u.pid
"** 01-s1.pdf page 15
dac u.ac
lac uniqpid
dac u.pid
isz 9f+t
dac 9f+t i
isz u.rq+8
dzm u.intflg
jmp sysexit
t= t+1
badcal:
clon
-1
dac 7
.save:
lac d1
jms iget
cla
jms iwrite; 4096; 4096
jms iwrite; userdata; 64
jms iput
.exit:
lac u.dspbuf
sna
jmp .+3
law dspbuf
jms movdsp
jms awake
lac u.ulistp i
and o77777
dac u.ulistp i
isz u.ulistp
dzm u.ulistp i
jms swap
.rmes:
jms awake
lac o100000
tad u.ulistp i
dac u.ulistp i
law 2
tad u.ulistp
dac 9f+t
-1
dac 9f+t i
jms swap
law 2
tad u.ulistp
dac 9f+t
lac 9f+t i
cma
dac u.ac
dzm 9f+t i
isz 9f+t
lac 9f+t i
dac u.mq
dzm 9f+t i
jmp sysexit
t = t+1
"** 01-s1.pdf page 16
.smes:
lac u.ac
sna spa
jms error
jms searchu; 1f
law 2
tad u.ulistp
dac 9f+t
dzm 9f+t i
jms error
1: 0
lac lu+1
sad u.ac
skp
jmp 1b i
lac lu+2
sad dm1
jmp 1f
lac o100000
tad u.ulistp i
dac u.ulistp i
law 2
tad u.ulistp
dac 9f+t
lac u.ac
dac 9f+t i
jms swap
law 2
tad u.ulistp
dac 9f+t
dzm 9f+t i
jmp .smes
1:
-3
tad 8
dac 9f+t
lac o700000
tad 9f+t i
dac 9f+t i
isz 9f+t
isz 9f+t
lac u.pid
cma
dac 9f+t i
isz 9f+t
lac u.mq
dac 9f+t i
jmp okexit
t = t+1
awake: 0
jms searchu; 1f
jmp awake i
1: 0
lac u.pid
sad lu+2
skp
jmp 1b i
-3
tad 8
dac 9f+t
"** 01-s1.pdf page 17
lac o700000
tad 9f+t i
dac 9f+t i
jmp 1b i
t = t+1
swr:
sww:
jmp .-4 i
.halt; rttyi; rkbdi; rppti; .halt
.halt; wttyo; wdspo; wppto
.halt: jms halt
rttyi:
jms chkint1
lac d1
jms getchar
jmp 1f
and o177
jms betwen; o101; o132
skp
tad o40
alss 9
jmp passone
1:
jms sleep; sfiles+0
jms swap
jmp rttyi
wttyo:
jms chkint1
jms forall
sna
jmp fallr
lmq
lac sfiles+1
spa
jmp 1f
xor o400000
dac sfiles+1
lacq
tls
sad o12
jms putcr
jmp fallr
1:
lacq
dac char
lac d2 "** written: d6 ttyout
jms putchar
skp
jmp fallr
jms sleep; sfiles+1
jms swap
jmp wttyo
rkbdi:
jms chkint1
lac d3
jms getchar
"** 01-s1.pdf page 18
jmp 3f
lmq
and o155
sad o55
jmp 1f
lacq
and o137
sad o134
skp
jmp 2f
1:
lacq
xor o20
lmq
2:
lacq
dac u.limit
1:
jms chkint1
lac u.limit
jms dspput
jmp 1f
jms sleep; sfiles+6
jms swap
jmp 1b
1:
lac u.limit
alss 9
jmp passone
3:
jms sleep; sfiles+2
jms swap
jmp rkbdi
wdspo:
jms chkint1
jms forall
jms dspput
jmp fallr
jms sleep; sfiles+6
jms swap
jmp wdspo
rppti:
lac d4
jms getchar
jmp .+3
alss 9
jmp passone
lac sfiles+3
sma
rsa
1:
jms sleep; sfiles+3
jms swap
jmp rppti
"** 01-s1.pdf page 19
wppto:
jms forall
sna
jmp fallr
lmq
lac sfiles+4
spa
jmp 1f
xor o400000
dac sfiles+4
lacq
psa
jmp fallr
1:
lacq
dac char
lac d5
jms putchar
skp
jmp fallr
jms sleep; sfiles+4
jms swap
jmp wppto
passone:
sad o4000
jmp okexit
dac u.base i
lac d1
dac u.ac
jmp sysexit
error: 0
-1
dac u.ac
jmp sysexit
chkint1: 0
dzm .insys
jms chkint
skp
jmp .save
-1
dac .insys
jmp chkint1 i

View File

@@ -0,0 +1,278 @@
"** 01-s1.pdf page 28
" s5
dskswap: 0
cll; als 3
dac 9f+t
jms dsktrans; -64; userdata; 9f+t; dskswap
lac 9f+t
tad o20
dac 9f+t
jms dsktrans; -4096; 4096; 9f+t; dskswap
isz dskswap
jmp dskswap i
t = t+1
access: 0
lac i.flags
lmq
lac u.uid
spa
jmp access i
sad i.uid
lrs 2
lacq
and mode
sza
jmp access i
jms error
fassign: 0
-10
dac 9f+t
1:
lac 9f+t
tad d10
jms fget
jms halt " will not happen
lac f.flags
sma
jmp 1f
isz 9f+t
jmp 1b
jmp fassign i
1:
lac mode
xor o400000
dac f.flags
lac ii
dac f.i
lac 9f+t
tad d10
dac u.ac
dzm f.badd
jms fput
isz fassign
jmp fassign i
t = t+1
fget: 0
jms betwen; d0; d9
jmp fget i
cll; mul; 3
lacq
"** 01-s1.pdf page 29
tad ofilesp
dac 9f+t
dac .+2
jms copy; ..; fnode; 3
isz fget
jmp fget i
fput: 0
lac 9f+t
dac .+3
jms copy; fnode; ..; 3
jmp fput i
t = t+1
forall: 0
lac u.base
sad u.limit
jmp 1f
lac u.base
ral
lac u.base i
snl
lrs 9
and o777
jmp forall i
fallr:
lac u.base
add o400000
dac u.base
jmp forall+1
1:
lac u.count
dac u.ac
jmp sysexit
sleep: 0
law ulist-1
dac 8
lac o200000
lmq
1:
lac u.ulistp i
sad 8 i
jmp 1f
isz 8
isz 8
isz 8
cla; lrs 1
jmp 1b
1:
tad o100000
dac u.ulistp i
lac sleep i
dac 9f+t
lac 9f+t i
omq
dac 9f+t i
isz sleep
jmp sleep i
t = t+1
"** 01-s1.pdf page 30
dslot: 0
dzm di
skp
1:
isz di
lac di
jms dget
lac d.i
sza
jmp 1b
jmp dslot i
icreat: 0
dac 9f+t
jms dslot
lac o20
dac ii
1:
isz ii
lac ii
jms iget
lac i.flags
spa
jmp 1b
lac ii
dac d.i
jms copy; name; d.name; 4
isz s.uniq
lac s.uniq
dac d.uniq
dac i.uniq
lac 9f+t
xor o400000
dac i.flags
lac u.uid
dac i.uid
-1
dac i.nlks
dzm i.size
jms copyz; i.dskps; 7
jms iput
jms dput
jmp icreat i
t = t+1
dspput: 0
and o177
sna
jmp i dspput
sad o14
jmp 1f
lmq
sad o12
jms dspnl
lac dsploc i
sad o400000
jmp dspleft
omq
dac dsploc i
isz dsploc
jmp i dspput
"** 01-s1.pdf page 31
1:
jms dspinit
jmp dspput i
dspleft:
lac dsploc
sad edspbuf
jmp 1f
dac 8
lac o400000
dac 8 i
cla; llss 18+7
dac dsploc i
jmp dspput i
dspnl: 0
lac dsplno
sad d33
jmp 1f
isz dsplno
jmp dspnl i
1:
lac o2000
wbl
isz dspput
jmp dspput i
dspinit: 0
lac dspbufp3
dac dsploc
lac o400000
dac dspbuf+3
dzm dsplno
jmp dspinit i
movdsp: 0
iof
cdf
dac dspbufp
-1
dac .dspb
ion
jmp movdsp i
arg: 0
lac u.rq+8 i
isz u.rq+8
jmp arg i
argname: 0
jms arg
dac .+2
jms copy; ..; name; 4
lac u.cdir
jms namei; name
jms error
jmp argname i
seektell: 0
jms arg
dac u.base
"** 01-s1.pdf page 32
jms arg
dac u.limit
jms finac
lac u.limit
sna
jmp seektell i
sad d1
jmp .+3
lac i.size
jmp seektell i
lac f.badd
jmp seektell i
isown: 0
jms argname
jms iget
lac u.uid
sma
sad i.uid
skp
jms error
jmp isown i

View File

@@ -0,0 +1,350 @@
"** 01-s1.pdf page 34
" s6
itrunc: 0
-7
dac 9f+t
lac idskpp
dac 9f+t+1
1:
lac 9f+t+1 i
sna
jmp 4f
lac i.flags
and o200000
sna
jmp 3f
-64
dac 9f+t+2
lac dskbufp
dac 9f+t+3
2:
lac 9f+t+1 i
jms dskrd
lac 9f+t+3 i
sza
jms free
isz 9f+t+3
isz 9f+t+2
jmp 2b
3:
lac 9f+t+1 i
jms free
dzm 9f+t+1 i
4:
isz 9f+t+1
isz 9f+t
jmp 1b
lac i.flags
and o577777
dac i.flags
jmp itrunc i
t = t+4
namei: 0
jms iget
-1
tad namei i
dac 9f+t+1
isz namei
lac i.flags
and o20
sna
jmp namei i
-8
tad i.size
cma
lrss 3
dac 9f+t
sna
jmp namei i
dzm di
1:
lac di
"** 01-s1.pdf page 35
jms dget
lac d.i
sna
jmp 2f
lac 9f+t+1
dac 8
lac d.name
sad 8 i
skp
jmp 2f
lac d.name+1
sad 8 i
skp
jmp 2f
lac d.name+2
sad 8 i
skp
jmp 2f
lac d.name+3
sad 8 i
skp
jmp 2f
lac d.i
isz namei
jmp namei i
2:
isz di
isz 9f+t
jmp 1b
jmp namei i
t = t+2
iget: 0
dac ii
cll; idiv; 5
dac 9f+t
lacq
tad d2
dac 9f+t+1
jms dskrd
lac 9f+t
cll; mul; 12
lacq
tad dskbufp
dac 9f+t
dac .+2
jms copy; ..; inode; 12
jmp iget i
iput: 0
lac 9f+t+1
jms dskrd
law inode-1
dac 8
-1
tad 9f+t
dac 9
-12
dac 9f+t+2
1:
lac 8 i
"** 01-s1.pdf page 36
sad 9 i
skp
jmp 2f
isz 9f+t+2
jmp 1b
jmp iput i
2:
-1
tad 8
dac 8
-1
tad 9
dac 9
1:
lac 8 i
dac 9 i
isz 9f+t+2
jmp 1b
lac 9f+t+1
jms dskwr
jmp iput i
t = t+3
dget: 0
dac di
alss 3
dac 9f+t
jms pget
dac 9f+t+1
jms dskrd
lac 9f+t
and o77
tad dskbufp
dac 9f+t+2
dac .+2
jms copy; ..; dnode; 8
lac 9f+t
tad d8
jms betwen; d0; i.size
skp
jmp dget i
jms dacisize
dzm d.i
jmp dget i
dput: 0
lac 9f+t+1
jms dskrd
lac 9f+t+2
dac .+3
jms copy; dnode; ..; 8
lac 9f+t+1
jms dskwr
jmp dput i
t = t+3
pget: 0
lrss 6
dac 9f+t
lac i.flags
"** 01-s1.pdf page 37
and o200000
sza
jmp 2f
lac 9f+t
jms betwen; d0; d6
jmp 1f
tad idskpp
dac 9f+t
lac 9f+t i
sna
jms alloc
dac 9f+t i
jmp pget i
1:
jms alloc
dac 9f+t+1
jms copy; i.dskps; dskbuf; 7
jms copyz; dskbuf+7; 64-7
lac 9f+t+1
jms dskwr
lac 9f+t+1
dac i.dskps
jms copyz; i.dskps+1; 6
lac i.flags
xor o200000
dac i.flags
2:
lac 9f+t
lrss 6
jms betwen; d0; d6
jms halt " file too big
tad idskpp
dac 9f+t+1
lac 9f+t+1 i
sna
jms alloc
dac 9f+t+1 i
dac 9f+t+2
jms dskrd
lac 9f+t
and o77
tad dskbufp
dac 9f+t+1
lac 9f+t+1 i
sza
jmp pget i
jms alloc
dac 9f+t
lac 9f+t+2
jms dskrd
lac 9f+t
dac 9f+t+1 i
lac 9f+t+2
jms dskwr
lac 9f+t
jmp pget i
t = t+3
iwrite: 0
dac 9f+t
lac iwrite
"** 01-s1.pdf page 38
dac iread
lac cskp
dac iwrite
jmp 1f
iread: 0
dac 9f+t
lac cnop
dac iwrite
1:
-1
tad iread i
dac 10
dac 11
isz iread
lac iread i
dac 9f+t+1
isz iread
lac o70000
xct iwrite
lac i.size
cma
tad 9f+t
cma
jms betwen; d0; 9f+t+1
lac 9f+t+1
dac 9f+t+2
cma
tad d1
sna
jmp iread i
dac 9f+t+1
1:
lac 9f+t
jms pget
dac 9f+t+3
jms dskrd
lac 9f+t
and o77
tad dskbufp
tad dm1
xct iwrite
jmp .+3
dac 10
cskp:
skp
dac 11
2:
lac 11 i
dac 10 i
isz 9f+t
isz 9f+t+1
jmp 3f
xct iwrite
jmp 4f
lac 9f+t
jms betwen; d0; i.size
dac i.size
lac 9f+t+3
jms dskwr
4:
"** 01-s1.pdf page 38
lac 9f+t+2
jmp iread i
3:
lac 9f+t
and o77
sza
jmp 2b
xct iwrite
jmp 1b
lac 9f+t+3
jms dskwr
jmp 1b
t = t+4
finac: 0
lac u.ac
jms fget
jms error
lac f.flags
sma
jms error
lac f.i
jms iget
jmp finac i
dacisize: 0
dac i.size
jms iput
lac i.size
jmp dacisize i

View File

@@ -0,0 +1,214 @@
"** 01-s1.pdf page 48
" s8
" manifests
mnproc = 10
dspbsz = 270
ndskbs = 4
" flags
.insys: 0
.int1: 0
.int2: 0
.ac: 0
.savblk: 0
.dsptm: 0
.dskb: 0
.dske: 0
" pointers
tadu: tad ulist
dacu: dac ulist
maxquant: 30
ofilesp: u.ofiles
idskpp: i.dskps
dskbufp: dskbuf
edspbuf: dspbuf+dspbsz
dspbufp3: dspbuf+3
fblksp: s.fblks
dacq1: dac q1
lacq1: lac q1
q2p: q2
" strings
initf:
<i>n;<i>t;< > ;< > "
" constants
d0: 0
d1: 1
d2: 2
d3: 3
d4: 4
d5: 5
d6: 6
d7: o7: 07
d8: 8
d9: 9
o12: d10: 10
o14: 014
o15: 015
o17: 017
o20: 020
o33: 033
o40: 040
o55: 055
o77: 077
d65:o101: 0101
d33: 33
o132: 0132
o134: 0134
o137: 0137
o155: 0155
o177: 0177
"** 01-s1.pdf page 49
o212: 0212
o375: 0375
o777: 0777
o2000: 02000
o4000: 04000
d7999: 7999
o10000: 010000
o17762: 017762
o17777: 017777
o20001: 020001
o40000: 040000
o40001: 040001
o70000: 070000
o77777: 077777
o100000: 0100000
o140000: 0140000
o200000: 0200000
o200001: 0200001
o300000: 0300000
o400000: 0400000
o500000: 0500000
o577777: 0577777
o600000: 0600000
o640000: 0640000
o700000: 0700000
o777700: 0777700
o777760: 0777760
dm3: -3
dm1: -1
9: .=.+t
c1: .=.+1
q1: q2;q2+90 "** ?? 98 ??
.=.+14
q2:
.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0
.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0
.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0
.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0
.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;0;0
dsploc: .=.+1
dsplno: .=.+1
dspbuf:
0065057;0147740;0160000
.=.+30
coldentry:
dzm 0100 " not re-entrant
caf
ion
clon
law 3072
wcga
jms dspinit
law dspbuf
jms movdsp
cla
jms dskio; 06000
jms copy; dskbuf; sysdata; ulist-sysdata
lac d3
jms namei; initf
jms halt
"** 01-s1.pdf page 50
jms iget
cla
jms iread; 4096; 4096
jmp 4096
. = dspbuf+dspbsz+3
dskbuf = 07700
dskbs: .=.+65+65+65+65
edskbsp: .
uquant: .=.+1
dspbufp: .=.+1
pbsflgs: .=.+2
mode: .=.+1
nttychar: .=.+1
npptchar: .=.+1
ttydelay: .=.+1
name: .=.+4
lnkaddr: .=.+1
char: .=.+1
dskaddr: .=.+1
uniqpid: 1
lu: .=.+4
sfiles: .=.+10
dpdata:
dpstat: .=.+1
dpread: .=.+1
dpwrite: .=.+1
dpchar: .=.+1
dspdata:
.dspb: .=.+1
.lpba: .=.+1 "** 4 written on listing
crdata:
crread: .=.+1
crchar: .=.+1
sysdata:
s.nxfblk: .=.+1
s.nfblks: .=.+1
s.fblks: .=.+10
s.uniq: .=.+1
s.tim: .=.+2
ulist:
0131000;1;0;0
0031040;0;0;0
0031100;0;0;0
0031140;0;0;0
0031200;0;0;0
0031240;0;0;0
0031300;0;0;0
0031340;0;0;0
0031400;0;0;0
0031440;0;0;0
userdata:
u.ac: 0
u.mq: 0
u.rq: .=.+9
u.uid: -1
u.pid: 1
u.cdir: 3
u.ulistp: ulist
u.swapret: 0
u.base: 0
u.count: 0
"** 01-s1.pdf page 51
u.limit: 0
u.ofiles: .=.+30
u.dspbuf: 0
u.intflg: 1
.=userdata+64
ii: .=.+1
inode:
i.flags: .=.+1
i.dskps: .=.+7
i.uid: .=.+1
i.nlks: .=.+1
i.size: .=.+1
i.uniq: .=.+1
.= inode+12
di: .=.+1
dnode:
d.i: .=.+1
d.name: .=.+4
d.uniq: .=.+1
. = dnode+8
fnode:
f.flags: .=.+1
f.badd: .=.+1
f.i: 0

View File

@@ -0,0 +1,115 @@
"** 01-s1.pdf page 53
" s9 -- cold boot
. = coldentry+4
" zero i-list
dzm ii
jms copyz; dskbuf; 64
1:
lac ii
jms dskio; 07000
isz ii
-710
tad ii
sza
jmp 1b
" free rest of disk
1:
lac ii
jms free
isz ii
-6400
tad ii
sza
jmp 1b
" read in tapes
dzm ii
1:
dzm sum
jms getw " count
sza
jmp .+3
hlt
jmp 1b " 0 count means pause
dac xx
isz ii
lac ii
jms iget
jms copyz; inode; 12
jms getw " flags
dac i.flags
-1
dac i.uid
jms getw " number links
dac i.nlks
-2
tad xx
dac i.size
lac ii
dac i.uniq
law 4096-1
dac 8
-1
tad i.size
cma
sna
jmp 3f
dac xx
"** 01-s1.pdf page 54
2:
jms getw
dac 8 i
isz xx
jmp 2b
3:
lac sum
dac xx
jms getw " checksum
sad xx
skp
jms halt
lac i.size
dac .+4
cla
jms iwrite; 4096; ..
jms iput
cla
jms dskio; 07000 "** writing on listing
jmp 1b
getw: 0
jms getc
alss 12
lmq
jms getc
alss 6
omq
lmq
jms getc
omq
lmq
add sum
dac sum
lacq
jmp getw i
getc: 0
iof
rsa
rsf
jmp .-1
rrb
sna
jmp getc+1
and o77
ion
jmp getc i
xx: 0
sum: 0

View File

@@ -0,0 +1,95 @@
"** 01-s1.pdf page 62
" sop
dac = 0040000 " MEM: deposit AC
jms = 0100000 " MEM: jump to subroutine
dzm = 0140000 " MEM: deposit zero to memory
lac = 0200000 " MEM: load AC
xor = 0240000 " MEM: XOR with AC
add = 0300000 " MEM: one's complement add
tad = 0340000 " MEM: two's complement add
xct = 0400000 " MEM: execute
isz = 0440000 " MEM: increment and skip if zero
and = 0500000 " MEM: AND
sad = 0540000 " MEM: skip if AC different
jmp = 0600000 " MEM: jump
nop = 0740000 " OPR: no-op
i = 020000 " indirect
law = 0760000 " OPR: load accumulator with (instr)
cma = 0740001 " OPR: complement AC
las = 0750004 " OPR: load AC from switches
ral = 0740010 " OPR: rotate AC left
rar = 0740020 " OPR: rotate AC right
hlt = 0740040 " OPR: halt
sma = 0740100 " OPR: skip on minus AC
sza = 0740200 " OPR: skip on zero AC
snl = 0740400 " OPR: skip on non-zero link
skp = 0741000 " OPR: skip unconditionally
sna = 0741200 " OPR: skip on non-zero AC
szl = 0741400 " OPR: skip on zero link
rtl = 0742010 " OPR: rotate two left
rtr = 0742020 " OPR: rotate two right
cll = 0744000 " OPR: clear link
rcl = 0744010 " OPR: clear link, rotate left
rcr = 0744020 " OPR: clear link, rotate right
cla = 0750000 " OPR: clear AC
lrs = 0640500 " EAE: long right shift
lrss = 0660500 " EAE: long right shift, signed
lls = 0640600 " EAE: long left shift
llss = 0660600 " EAE: long left shift, signed
als = 0640700 " EAE: AC left shift
alss = 0660700 " EAE: AC left shift, signed
mul = 0653323 " EAE: multiply
idiv = 0653323 " EAE: integer divide
lacq = 0641002 " EAE: load AC with MQ
clq = 0650000 " EAE: clear MQ
omq = 0650002 " EAE: OR MQ into AC
cmq = 0650004 " EAE: complement MQ
lmq = 0652000 " EAE: load MQ from AC
dscs = 0707141 " DSK: clear status register
dslw = 0707124 " DSK: clear and load WC from AC
dslm = 0707142 " DSK: clear and load MAC from AC
dsld = 0707104 " DSK: clear and load TA and SA from AC
dsls = 0707144 " DSK: load status
dssf = 0707121 " DSK: skip on flags
dsrs = 0707132 " DSK: read status register
iof = 0700002 " PIC: interrupts off
ion = 0700042 " PIC: interrupts on
caf = 0703302 " CPU: clear all flags
clon = 0700044 " CLK: clear flag, enable
clsf = 0700001 " CLK: skip if overflow
"** 01-s1.pdf page 63
clof = 0700004 " CLK: clear flag, disable
ksf = 0700301 " KBD: skip if flag set
krb = 0700312 " KBD: read buffer
tsf = 0700401 " TTY: skip if flag set
tcf = 0700402 " TTY: clear flag
tls = 0700406 " TTY: load buffer, select
sck = 0704301 " S-2: skip on console keyboard
cck = 0704304 " S-2: clear console keyboard
lck = 0704312 " S-2: load console keyboard
rsf = 0700101 " PTR: skip if flag set
rsa = 0700104 " PTR: select alphanumeric mode
rrb = 0700112 " PTR: clear flag, or read buffer
psf = 0700201 " PTP: skip if flag set
pcf = 0700202 " PTP: clear flag
psa = 0700204 " PTP: alphanumeric mode
cdf = 0700501 " ???
lds = 0701052 " S-2: load display status
lda = 0701012 " S-2: load display address
wcga = 0704206 " S-2: ???
raef = 0700742 " S-2: resume after edges flag
rlpd = 0700723 " S-2: resume after light pen stop, disabled
beg = 0700547 " S-2: begin
spb = 0704401 " S-2: skip on push button flag
cpb = 0704404 " S-2: clear push button flag
lpb = 0704412 " S-2: load push buttons
wbl = 0704424 " S-2: write button lights
dprs = 0704752 " dataphone: read status
dpsf = 0704741 " dataphone: skip on flag
dpcf = 0704761 " dataphone: clear flag
dprc = 0704712 " dataphone: read character
crsf = 0706701 " CDR: skip if ready
crrb = 0706712 " CDR: read buffer

View File

@@ -0,0 +1,264 @@
"** 01-s1.pdf page 57 -- system assembly map
. 004671 r
.ac 004012 r
.chown 000426 r
.capt 000404 r
.creat 000665 r
.chdir 000622 r
.chmod 000414 r
.dskb 004105 r
.dspb 005547 r
.dsptm 004104 r
.dske 004106 r
.exit 001170 r
.fork 001116 r
.getuid 000433 r
.halt 001343 r
.int1 004100 r
.insys 004077 r
.int2 004101 r
.intrp 000257 r
.link 000474 r
.lpba 005550 r
.open 000633 r
.rmes 001204 r
.rele 000410 r
.rename 000547 r
.read 000731 r
.smes 001232 r
.savblk 004103 r
.sysloc 000262 r
.setuid 000566 r
.status 000352 r
.save 001156 r
.seek 000436 r
.tell 000466 r
.time 000615 r
.unlink 000547 r
.write 001000 r
access 002323 r
alloc 001556 r
argname 002642 r
arg 002636 r
awake 001311 r
badcal 001153 r
betwen 001654 r
c1 004270 r
chkint 000320 r
chkink1 001546 r
char 005522 r
cnop 003453 r
coldentr 004520 r
copyz 001723 r
collapse 002066 r
copy 001700 r
crdata 005551 r
crchar 005552 r
crread 005551 r
cskp 003346 r
d.name 005761 r
d.uniq 005765 r
d.i 005760 r
"** 01-s1.pdf page 58
d0 004127 r
d10 004141 r
d1 004130 r
d2 004131 r
d33 004153 r
d3 004132 r
d4 004133 r
d5 004134 r
d6 004135 r
d65 004155 r
d7999 004166 r
d7 004136 r
d8 004137 r
d9 004140 r
dacq1 004120 r
dacu 004110 r
dacisize 003413 r
dget 003115 r
di 005757 r
dm1 004215 r
dm3 004214 r
dnode 005760 r
dpdata 005543 r
dput 003147 r
dpchar 005546 r
dpwrite 005545 r
dpstat 005543 r
dpread 005544 r
dskbufp 004114 r
dskio 002173 r
dspdata 005547 r
dskrd 002127 r
dsktrans 002231 r
dsploc 004455 r
dslot 002474 r
dspino 004456 r
dspbufp3 004116 r
dspbufp 005506 r
dspresta 003523 r
dskaddr 005523 r
dskbs 005100 r
dskwr 002157 r
dspput 002551 r
dspleft 002573 r
dspbuf 004457 r
error 001542 r
exitrw 001041 r
f.badd 005771 r
f.flags 005770 r
fassign 002340 r
fallr 002436 r
fblksp 004117 r
fget 002371 r
finac 003401 r
fnode 005770 r
"** 01-s1.pdf page 59
forall 002434 r
fput 003413 r
free 001615 r
getchar 001756 r
getw 004635 r
getc 004654 r
halt 002265 r
i.flags 005743 r
i.dskps 005744 r
i.uniq 005756 r
i.size 005755 r
i.nlks 005754 r
i.uid 005753 r
icreat 002506 r
idskpp 004113 r
iget 003030 r
ii 005742 r
inode 005743 r
intrp1 004032 r
intrp2 004055 r
initf 004123 r
iput 003057 r
iread 003277 r
isown 002675 r
itrunc 002706 r
iwrite 003270 r
laci 001646 r
lacq1 004121 r
lnkaddr 005521 r
lookfor 001073 r
locsw 000275 r
locn 000317 r
lu 005525 r
maxquant 004111 r
mode 005511 r
movdsp 002626 r
name 005515 r
namei 002750 r
npptchar 005513 r
nttychar 005512 r
o10000 004167 r
o17 004144 r
o177 004160 r
o101 004152 r
o17762 004170 r
o17777 004171 r
o12 004141 r
o132 004154 r
o134 004155 r
o137 004156 r
o100000 004177 r
o140000 004200 r
o14 004142 r
o15 004143 r
0155 004157 r
o2000 004164 r
o200001 004262 r
o20001 004172 r
020 004145 r
o212 004161 r
o200000 004201 r
"** 01-s1.pdf page 60
o375 004162 r
o33 004146 r
o300000 004203 r
o4000 004165 r
o40000 004173 r
o40 004147 r
o400000 004204 r
o500000 004205 r
o55 004150 r
o577777 004206 r
o600000 004207 r
o640000 004210 r
o777 004163 r
o77 004157 r
o70000 004175 r
o77777 004176 r
o777760 004213 r
o7 004136 r
o700000 004211 r
o777700 004212 r
ofilesp 004112 r
okexit 000102 r
open1 000722 r
orig 000000 r
passone 001534 r
pbsflgs 005507 r
pget 003163 r
piret 003766 r
pibreak 003420 r
putchar 001741 r
putq 002022 r
putcr 004025 r
q1 004271 r
q2p 004122 r
q2 004311 r
rkbdi 001415 r
rppti 001472 r
rttyi 001344 r
s.tim 005570 r
s.nxfblk 005553 r
s.uniq 005567 r
s.nfblks 005554 r
s.fblks 005555 r
seektell 002656 r
searchu 001047 r
sfiles 005551 r
sleep 002445 r
srcdbs 002046 r
sum 004670 r
swr 001331 r
swp 000220 r
swn 000256 r
sww 001331 r
swap 000136 r
sysdata 005553 r
sysexit 000103 r
takeq 001770 r
tadu 004107 r
ttydelay 005514 r
ttyresta 003603 r
"** 01-s1.pdf page 61
u.dspbuf 005723 r
u.intflg 005724 r
u.ulistp 005660 r
u.pid 005656 r
u.ofiles 005665 r
u.swapre 005661 r
u.mq 005643 r
u.uid 005655 r
u.ac 005642 r
u.limit 005664 r
u.cdir 005657 r
u.count 005663 r
u.base 005662 r
u.rq 005644 r
ulsit 005562 r
uniqpid 005524 r
uquant 005505 r
userdata 005642 r
wakeup 003773 r
wdspo 001462 r
wppto 001506 r
wttyo 001364 r
xx 004667 r