mirror of
https://github.com/livingcomputermuseum/pdp7-unix.git
synced 2026-02-11 18:55:18 +00:00
removed pdp7parse
This commit is contained in:
8
pdp7parse/.gitignore
vendored
8
pdp7parse/.gitignore
vendored
@@ -1,8 +0,0 @@
|
||||
/**/*.log
|
||||
/**/.DS_Store
|
||||
/**/.project
|
||||
/**/.classpath
|
||||
/**/.settings/
|
||||
/**/target
|
||||
/**/test-output
|
||||
ANTLRv4Lexer.g4
|
||||
@@ -1,7 +0,0 @@
|
||||
PDP7Parse
|
||||
---
|
||||
|
||||
PDP7Parse is an example of parsing PDP7 using an [Antlr4](http://www.antlr.org/) grammar. The authoritative home of the grammar file is on Antlr4 [grammars-v4](https://github.com/antlr/grammars-v4) tree.
|
||||
|
||||
PDP7Parse could be extended to implement a simple assembler for pdp7-unix.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
mvn clean antlr4:antlr4
|
||||
@@ -1,58 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.khubla.pdp7</groupId>
|
||||
<artifactId>pdp7parse</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>khubla.com PDP7 Parser</name>
|
||||
<version>1.0</version>
|
||||
<properties>
|
||||
<antlr.version>4.5</antlr.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
<version>1.2</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-runtime</artifactId>
|
||||
<version>${antlr.version}</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
<version>6.9.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>${antlr.version}</version>
|
||||
<configuration>
|
||||
<grammars>pdp7.g4</grammars>
|
||||
<outputDirectory>src/main/java</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,289 +0,0 @@
|
||||
/*
|
||||
BSD License
|
||||
|
||||
Copyright (c) 2013, Tom Everett
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of Tom Everett nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
grammar pdp7;
|
||||
|
||||
prog
|
||||
: lineeol+ line? EOF
|
||||
;
|
||||
|
||||
line
|
||||
: declarations? comment?
|
||||
;
|
||||
|
||||
lineeol
|
||||
: line eol
|
||||
;
|
||||
|
||||
declarations
|
||||
: declaration (';' declaration)*
|
||||
;
|
||||
|
||||
// multiple labels can occur on the same line
|
||||
declaration
|
||||
: label* (instruction | assignment | expression)*
|
||||
;
|
||||
|
||||
instruction
|
||||
: opcode argument*
|
||||
;
|
||||
|
||||
argument
|
||||
: expression
|
||||
;
|
||||
|
||||
assignment
|
||||
: symbol '=' expression
|
||||
;
|
||||
|
||||
// note that opcodes can be symbols. This is because it is legal to have a
|
||||
// variable name that is an opcode
|
||||
symbol
|
||||
: opcode | variable | LOC | RELOC
|
||||
;
|
||||
|
||||
expression
|
||||
: multiplyingExpression ((PLUS | MINUS) multiplyingExpression)*
|
||||
;
|
||||
|
||||
multiplyingExpression
|
||||
: atom ((TIMES | DIV) atom)*
|
||||
;
|
||||
|
||||
atom
|
||||
: variable
|
||||
| LOC
|
||||
| CHAR
|
||||
| RELOC
|
||||
| string
|
||||
| DECIMAL
|
||||
| DECIMAL_MINUS
|
||||
| OCTAL
|
||||
| NUMERIC_LITERAL
|
||||
| '-' atom
|
||||
;
|
||||
|
||||
// string chars, then potentially more than 1 octal constant, then potentially '>'
|
||||
string
|
||||
: STRING NUMERIC_LITERAL* '>'?
|
||||
;
|
||||
|
||||
eol
|
||||
: EOL
|
||||
;
|
||||
|
||||
comment
|
||||
: COMMENT
|
||||
;
|
||||
|
||||
label
|
||||
: LABEL
|
||||
;
|
||||
|
||||
variable
|
||||
: IDENTIFIER
|
||||
;
|
||||
|
||||
opcode
|
||||
: 'dac'
|
||||
| 'jms'
|
||||
| 'dzm'
|
||||
| 'lac'
|
||||
| 'xor'
|
||||
| 'add'
|
||||
| 'tad'
|
||||
| 'xct'
|
||||
| 'isz'
|
||||
| 'and'
|
||||
| 'sad'
|
||||
| 'jmp'
|
||||
| 'nop'
|
||||
// | 'i'
|
||||
| 'law'
|
||||
| 'cma'
|
||||
| 'las'
|
||||
| 'ral'
|
||||
| 'rar'
|
||||
| 'hlt'
|
||||
| 'sma'
|
||||
| 'sza'
|
||||
| 'snl'
|
||||
| 'skp'
|
||||
| 'sna'
|
||||
| 'szl'
|
||||
| 'rtl'
|
||||
| 'rtr'
|
||||
| 'cil'
|
||||
| 'rcl'
|
||||
| 'rcr'
|
||||
| 'cia'
|
||||
| 'lrs'
|
||||
| 'lrss'
|
||||
| 'lls'
|
||||
| 'llss'
|
||||
| 'als'
|
||||
| 'alss'
|
||||
| 'mul'
|
||||
| 'idiv'
|
||||
| 'lacq'
|
||||
| 'clq'
|
||||
| 'omq'
|
||||
| 'cmq'
|
||||
| 'lmq'
|
||||
| 'dscs'
|
||||
| 'dslw'
|
||||
| 'dslm'
|
||||
| 'dsld'
|
||||
| 'dsls'
|
||||
| 'dssf'
|
||||
| 'dsrs'
|
||||
| 'iof'
|
||||
| 'ion'
|
||||
| 'caf'
|
||||
| 'clon'
|
||||
| 'clsf'
|
||||
| 'clof'
|
||||
| 'ksf'
|
||||
| 'krb'
|
||||
| 'tsf'
|
||||
| 'tcf'
|
||||
| 'tls'
|
||||
| 'sck'
|
||||
| 'cck'
|
||||
| 'lck'
|
||||
| 'rsf'
|
||||
| 'rsa'
|
||||
| 'rrb'
|
||||
| 'psf'
|
||||
| 'pcf'
|
||||
| 'psa'
|
||||
| 'cdf'
|
||||
| 'rlpd'
|
||||
| 'lda'
|
||||
| 'wcga'
|
||||
| 'raef'
|
||||
| 'rlpd'
|
||||
| 'beg'
|
||||
| 'spb'
|
||||
| 'cpb'
|
||||
| 'lpb'
|
||||
| 'wbl'
|
||||
| 'dprs'
|
||||
| 'dpsf'
|
||||
| 'dpcf'
|
||||
| 'dprc'
|
||||
| 'crsf'
|
||||
| 'crrb'
|
||||
| 'sys'
|
||||
| 'czm'
|
||||
| 'irss'
|
||||
| 'dsm'
|
||||
;
|
||||
|
||||
LOC
|
||||
: '.'
|
||||
;
|
||||
|
||||
|
||||
RELOC
|
||||
: '..'
|
||||
;
|
||||
|
||||
|
||||
PLUS
|
||||
: '+'
|
||||
;
|
||||
|
||||
|
||||
MINUS
|
||||
: '-'
|
||||
;
|
||||
|
||||
|
||||
TIMES
|
||||
: '*'
|
||||
;
|
||||
|
||||
|
||||
DIV
|
||||
: '/'
|
||||
;
|
||||
|
||||
|
||||
LABEL
|
||||
: [a-zA-Z0-9.] + ':'
|
||||
;
|
||||
|
||||
|
||||
// the period is considered a letter
|
||||
IDENTIFIER
|
||||
: [a-zA-Z] [a-zA-Z0-9.]*
|
||||
;
|
||||
|
||||
|
||||
NUMERIC_LITERAL
|
||||
: [0-9][0-9a-f]*
|
||||
;
|
||||
|
||||
DECIMAL
|
||||
: 'd' [0-9] +
|
||||
;
|
||||
|
||||
OCTAL
|
||||
: 'o' [0-7] +
|
||||
;
|
||||
|
||||
DECIMAL_MINUS
|
||||
: 'dm' [0-9] +
|
||||
;
|
||||
|
||||
STRING
|
||||
: '<' [a-zA-Z0-9$*,%/:?]*
|
||||
;
|
||||
|
||||
CHAR
|
||||
: [a-zA-Z0-9>.] '>'
|
||||
;
|
||||
|
||||
COMMENT
|
||||
: '"' ~ [\r\n]*
|
||||
;
|
||||
|
||||
|
||||
EOL
|
||||
: [\r\n]+
|
||||
;
|
||||
|
||||
|
||||
WS
|
||||
: [ \t] -> skip
|
||||
;
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.khubla.pdp7parse;
|
||||
/*
|
||||
* Copyright 2016, Tom Everett <tom@khubla.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import org.antlr.v4.runtime.ParserRuleContext;
|
||||
import org.antlr.v4.runtime.tree.ErrorNode;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeListener;
|
||||
import org.antlr.v4.runtime.tree.TerminalNode;
|
||||
|
||||
import com.khubla.pdp7parse.antlr4.pdp7Parser.LabelContext;
|
||||
|
||||
public class LabelParseTreeListener implements ParseTreeListener {
|
||||
private final PDP7Metadata pdp7Metadata;
|
||||
|
||||
public LabelParseTreeListener(PDP7Metadata pdp7Metadata) {
|
||||
this.pdp7Metadata = pdp7Metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitTerminal(TerminalNode node) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitErrorNode(ErrorNode node) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterEveryRule(ParserRuleContext ctx) {
|
||||
if (ctx instanceof LabelContext) {
|
||||
LabelContext labelContext = (LabelContext) ctx;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exitEveryRule(ParserRuleContext ctx) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.khubla.pdp7parse;
|
||||
|
||||
/*
|
||||
* Copyright 2016, Tom Everett <tom@khubla.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
public class Opcode {
|
||||
public static int dac = 0040000;
|
||||
public static int jms = 0100000;
|
||||
public static int dzm = 0140000;
|
||||
public static int lac = 0200000;
|
||||
public static int xor = 0240000;
|
||||
public static int add = 0300000;
|
||||
public static int tad = 0340000;
|
||||
public static int xct = 0400000;
|
||||
public static int isz = 0440000;
|
||||
public static int and = 0500000;
|
||||
public static int sad = 0540000;
|
||||
public static int jmp = 0600000;
|
||||
public static int nop = 0740000;
|
||||
public static int i = 020000;
|
||||
public static int law = 0760000;
|
||||
public static int cma = 0740001;
|
||||
public static int las = 0750004;
|
||||
public static int ral = 0740010;
|
||||
public static int rar = 0740020;
|
||||
public static int hlt = 0740040;
|
||||
public static int sma = 0740100;
|
||||
public static int sza = 0740200;
|
||||
public static int snl = 0740400;
|
||||
public static int skp = 0741000;
|
||||
public static int sna = 0741200;
|
||||
public static int szl = 0741400;
|
||||
public static int rtl = 0742010;
|
||||
public static int rtr = 0742020;
|
||||
public static int cll = 0744000;
|
||||
public static int rcl = 0744010;
|
||||
public static int rcr = 0744020;
|
||||
public static int cla = 0750000;
|
||||
public static int lrs = 0640500;
|
||||
public static int lrss = 0660500;
|
||||
public static int lls = 0640600;
|
||||
public static int llss = 0660600;
|
||||
public static int als = 0640700;
|
||||
public static int alss = 0660700;
|
||||
public static int mul = 0653323;
|
||||
public static int idiv = 0653323;
|
||||
public static int lacq = 0641002;
|
||||
public static int clq = 0650000;
|
||||
public static int omq = 0650002;
|
||||
public static int cmq = 0650004;
|
||||
public static int lmq = 0652000;
|
||||
public static int dscs = 0707141;
|
||||
public static int dslw = 0707124;
|
||||
public static int dslm = 0707142;
|
||||
public static int dsld = 0707104;
|
||||
public static int dsls = 0707144;
|
||||
public static int dssf = 0707121;
|
||||
public static int dsrs = 0707132;
|
||||
public static int iof = 0700002;
|
||||
public static int ion = 0700042;
|
||||
public static int caf = 0703302;
|
||||
public static int clon = 0700044;
|
||||
public static int clsf = 0700001;
|
||||
public static int clof = 0700004;
|
||||
public static int ksf = 0700301;
|
||||
public static int krb = 0700312;
|
||||
public static int tsf = 0700401;
|
||||
public static int tcf = 0700402;
|
||||
public static int tls = 0700406;
|
||||
public static int sck = 0704301;
|
||||
public static int cck = 0704304;
|
||||
public static int lck = 0704312;
|
||||
public static int rsf = 0700101;
|
||||
public static int rsa = 0700104;
|
||||
public static int rrb = 0700112;
|
||||
public static int psf = 0700201;
|
||||
public static int pcf = 0700202;
|
||||
public static int psa = 0700204;
|
||||
public static int cdf = 0700501;
|
||||
public static int lds = 0701052;
|
||||
public static int lda = 0701012;
|
||||
public static int wcga = 0704206;
|
||||
public static int raef = 0700742;
|
||||
public static int rlpd = 0700723;
|
||||
public static int beg = 0700547;
|
||||
public static int spb = 0704401;
|
||||
public static int cpb = 0704404;
|
||||
public static int lpb = 0704412;
|
||||
public static int wbl = 0704424;
|
||||
public static int dprs = 0704752;
|
||||
public static int dpsf = 0704741;
|
||||
public static int dpcf = 0704761;
|
||||
public static int dprc = 0704712;
|
||||
public static int crsf = 0706701;
|
||||
public static int crrb = 0706712;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.khubla.pdp7parse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* Copyright 2016, Tom Everett <tom@khubla.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
public class PDP7Metadata {
|
||||
public List<String> labels = new ArrayList<String>();
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.khubla.pdp7parse;
|
||||
|
||||
/*
|
||||
* Copyright 2016, Tom Everett <tom@khubla.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.commons.cli.CommandLineParser;
|
||||
import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Option;
|
||||
import org.apache.commons.cli.OptionBuilder;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
|
||||
import com.khubla.pdp7parse.antlr4.pdp7Parser.ProgContext;
|
||||
|
||||
/**
|
||||
* @author tom
|
||||
*/
|
||||
public class PDP7Parse {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("khubla.com PDP7 Parser");
|
||||
/*
|
||||
* options
|
||||
*/
|
||||
final Options options = new Options();
|
||||
OptionBuilder.withArgName(INPUT_FILE_OPTION);
|
||||
OptionBuilder.isRequired();
|
||||
OptionBuilder.withType(String.class);
|
||||
OptionBuilder.hasArg();
|
||||
OptionBuilder.withDescription("file to read");
|
||||
final Option ifo = OptionBuilder.create(INPUT_FILE_OPTION);
|
||||
options.addOption(ifo);
|
||||
/*
|
||||
* parse
|
||||
*/
|
||||
final CommandLineParser parser = new PosixParser();
|
||||
CommandLine cmd = null;
|
||||
try {
|
||||
cmd = parser.parse(options, args);
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
final HelpFormatter formatter = new HelpFormatter();
|
||||
formatter.printHelp("posix", options);
|
||||
System.exit(0);
|
||||
}
|
||||
/*
|
||||
* get file
|
||||
*/
|
||||
final String inputFileName = cmd.getOptionValue(INPUT_FILE_OPTION);
|
||||
final File inputFile = new File(inputFileName);
|
||||
if (inputFile.exists()) {
|
||||
ProgContext progContext = PDP7Parser.parse(new FileInputStream(inputFile), System.out);
|
||||
PDP7Metadata pdp7Metadata = new PDP7Metadata();
|
||||
PDP7Parser.analyse(progContext, pdp7Metadata);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* file option
|
||||
*/
|
||||
private static final String INPUT_FILE_OPTION = "file";
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.khubla.pdp7parse;
|
||||
/*
|
||||
* Copyright 2016, Tom Everett <tom@khubla.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Reader;
|
||||
|
||||
import org.antlr.v4.runtime.ANTLRInputStream;
|
||||
import org.antlr.v4.runtime.CommonTokenStream;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeWalker;
|
||||
|
||||
import com.khubla.pdp7parse.antlr4.pdp7Lexer;
|
||||
import com.khubla.pdp7parse.antlr4.pdp7Parser;
|
||||
import com.khubla.pdp7parse.antlr4.pdp7Parser.ProgContext;
|
||||
|
||||
public class PDP7Parser {
|
||||
public static ProgContext parse(InputStream inputStream, OutputStream outputStream) throws Exception {
|
||||
try {
|
||||
if (null != inputStream) {
|
||||
final Reader reader = new InputStreamReader(inputStream, "UTF-8");
|
||||
final pdp7Lexer lexer = new pdp7Lexer(new ANTLRInputStream(reader));
|
||||
final CommonTokenStream commonTokenStream = new CommonTokenStream(lexer);
|
||||
final pdp7Parser parser = new pdp7Parser(commonTokenStream);
|
||||
return parser.prog();
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
throw new Exception("Exception reading and parsing file", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void analyse(ProgContext progContext, PDP7Metadata pdp7Metadata) {
|
||||
ParseTreeWalker parseTreeWalker = new ParseTreeWalker();
|
||||
parseTreeWalker.walk(new LabelParseTreeListener(pdp7Metadata), progContext);
|
||||
}
|
||||
}
|
||||
@@ -1,256 +0,0 @@
|
||||
// Generated from com/khubla/pdp7parse/antlr4/pdp7.g4 by ANTLR 4.5
|
||||
package com.khubla.pdp7parse.antlr4;
|
||||
|
||||
import org.antlr.v4.runtime.ParserRuleContext;
|
||||
import org.antlr.v4.runtime.misc.NotNull;
|
||||
import org.antlr.v4.runtime.tree.ErrorNode;
|
||||
import org.antlr.v4.runtime.tree.TerminalNode;
|
||||
|
||||
/**
|
||||
* This class provides an empty implementation of {@link pdp7Listener},
|
||||
* which can be extended to create a listener which only needs to handle a subset
|
||||
* of the available methods.
|
||||
*/
|
||||
public class pdp7BaseListener implements pdp7Listener {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterProg(pdp7Parser.ProgContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitProg(pdp7Parser.ProgContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterLine(pdp7Parser.LineContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <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}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterDeclarations(pdp7Parser.DeclarationsContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitDeclarations(pdp7Parser.DeclarationsContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterDeclaration(pdp7Parser.DeclarationContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitDeclaration(pdp7Parser.DeclarationContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterInstruction(pdp7Parser.InstructionContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitInstruction(pdp7Parser.InstructionContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterArgument(pdp7Parser.ArgumentContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitArgument(pdp7Parser.ArgumentContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterAssignment(pdp7Parser.AssignmentContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitAssignment(pdp7Parser.AssignmentContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterSymbol(pdp7Parser.SymbolContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitSymbol(pdp7Parser.SymbolContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterExpression(pdp7Parser.ExpressionContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitExpression(pdp7Parser.ExpressionContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterMultiplyingExpression(pdp7Parser.MultiplyingExpressionContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitMultiplyingExpression(pdp7Parser.MultiplyingExpressionContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterAtom(pdp7Parser.AtomContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitAtom(pdp7Parser.AtomContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterString(pdp7Parser.StringContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <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 enterEol(pdp7Parser.EolContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitEol(pdp7Parser.EolContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterComment(pdp7Parser.CommentContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitComment(pdp7Parser.CommentContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterLabel(pdp7Parser.LabelContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitLabel(pdp7Parser.LabelContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterVariable(pdp7Parser.VariableContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitVariable(pdp7Parser.VariableContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterOpcode(pdp7Parser.OpcodeContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitOpcode(pdp7Parser.OpcodeContext ctx) { }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterEveryRule(ParserRuleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitEveryRule(ParserRuleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void visitTerminal(TerminalNode node) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void visitErrorNode(ErrorNode node) { }
|
||||
}
|
||||
@@ -1,375 +0,0 @@
|
||||
// Generated from com/khubla/pdp7parse/antlr4/pdp7.g4 by ANTLR 4.5
|
||||
package com.khubla.pdp7parse.antlr4;
|
||||
import org.antlr.v4.runtime.Lexer;
|
||||
import org.antlr.v4.runtime.CharStream;
|
||||
import org.antlr.v4.runtime.Token;
|
||||
import org.antlr.v4.runtime.TokenStream;
|
||||
import org.antlr.v4.runtime.*;
|
||||
import org.antlr.v4.runtime.atn.*;
|
||||
import org.antlr.v4.runtime.dfa.DFA;
|
||||
import org.antlr.v4.runtime.misc.*;
|
||||
|
||||
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
|
||||
public class pdp7Lexer extends Lexer {
|
||||
static { RuntimeMetaData.checkVersion("4.5", RuntimeMetaData.VERSION); }
|
||||
|
||||
protected static final DFA[] _decisionToDFA;
|
||||
protected static final PredictionContextCache _sharedContextCache =
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9,
|
||||
T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17,
|
||||
T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24,
|
||||
T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31,
|
||||
T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38,
|
||||
T__38=39, T__39=40, T__40=41, T__41=42, T__42=43, T__43=44, T__44=45,
|
||||
T__45=46, T__46=47, T__47=48, T__48=49, T__49=50, T__50=51, T__51=52,
|
||||
T__52=53, T__53=54, T__54=55, T__55=56, T__56=57, T__57=58, T__58=59,
|
||||
T__59=60, T__60=61, T__61=62, T__62=63, T__63=64, T__64=65, T__65=66,
|
||||
T__66=67, T__67=68, T__68=69, T__69=70, T__70=71, T__71=72, T__72=73,
|
||||
T__73=74, T__74=75, T__75=76, T__76=77, T__77=78, T__78=79, T__79=80,
|
||||
T__80=81, T__81=82, T__82=83, T__83=84, T__84=85, T__85=86, T__86=87,
|
||||
T__87=88, T__88=89, T__89=90, T__90=91, T__91=92, T__92=93, T__93=94,
|
||||
LOC=95, RELOC=96, PLUS=97, MINUS=98, TIMES=99, DIV=100, LABEL=101, IDENTIFIER=102,
|
||||
NUMERIC_LITERAL=103, DECIMAL=104, OCTAL=105, DECIMAL_MINUS=106, STRING=107,
|
||||
CHAR=108, COMMENT=109, EOL=110, WS=111;
|
||||
public static String[] modeNames = {
|
||||
"DEFAULT_MODE"
|
||||
};
|
||||
|
||||
public static final String[] ruleNames = {
|
||||
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
|
||||
"T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16",
|
||||
"T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24",
|
||||
"T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32",
|
||||
"T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40",
|
||||
"T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "T__47", "T__48",
|
||||
"T__49", "T__50", "T__51", "T__52", "T__53", "T__54", "T__55", "T__56",
|
||||
"T__57", "T__58", "T__59", "T__60", "T__61", "T__62", "T__63", "T__64",
|
||||
"T__65", "T__66", "T__67", "T__68", "T__69", "T__70", "T__71", "T__72",
|
||||
"T__73", "T__74", "T__75", "T__76", "T__77", "T__78", "T__79", "T__80",
|
||||
"T__81", "T__82", "T__83", "T__84", "T__85", "T__86", "T__87", "T__88",
|
||||
"T__89", "T__90", "T__91", "T__92", "T__93", "LOC", "RELOC", "PLUS", "MINUS",
|
||||
"TIMES", "DIV", "LABEL", "IDENTIFIER", "NUMERIC_LITERAL", "DECIMAL", "OCTAL",
|
||||
"DECIMAL_MINUS", "STRING", "CHAR", "COMMENT", "EOL", "WS"
|
||||
};
|
||||
|
||||
private static final String[] _LITERAL_NAMES = {
|
||||
null, "';'", "'='", "'>'", "'dac'", "'jms'", "'dzm'", "'lac'", "'xor'",
|
||||
"'add'", "'tad'", "'xct'", "'isz'", "'and'", "'sad'", "'jmp'", "'nop'",
|
||||
"'law'", "'cma'", "'las'", "'ral'", "'rar'", "'hlt'", "'sma'", "'sza'",
|
||||
"'snl'", "'skp'", "'sna'", "'szl'", "'rtl'", "'rtr'", "'cil'", "'rcl'",
|
||||
"'rcr'", "'cia'", "'lrs'", "'lrss'", "'lls'", "'llss'", "'als'", "'alss'",
|
||||
"'mul'", "'idiv'", "'lacq'", "'clq'", "'omq'", "'cmq'", "'lmq'", "'dscs'",
|
||||
"'dslw'", "'dslm'", "'dsld'", "'dsls'", "'dssf'", "'dsrs'", "'iof'", "'ion'",
|
||||
"'caf'", "'clon'", "'clsf'", "'clof'", "'ksf'", "'krb'", "'tsf'", "'tcf'",
|
||||
"'tls'", "'sck'", "'cck'", "'lck'", "'rsf'", "'rsa'", "'rrb'", "'psf'",
|
||||
"'pcf'", "'psa'", "'cdf'", "'rlpd'", "'lda'", "'wcga'", "'raef'", "'beg'",
|
||||
"'spb'", "'cpb'", "'lpb'", "'wbl'", "'dprs'", "'dpsf'", "'dpcf'", "'dprc'",
|
||||
"'crsf'", "'crrb'", "'sys'", "'czm'", "'irss'", "'dsm'", "'.'", "'..'",
|
||||
"'+'", "'-'", "'*'", "'/'"
|
||||
};
|
||||
private static final String[] _SYMBOLIC_NAMES = {
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, "LOC",
|
||||
"RELOC", "PLUS", "MINUS", "TIMES", "DIV", "LABEL", "IDENTIFIER", "NUMERIC_LITERAL",
|
||||
"DECIMAL", "OCTAL", "DECIMAL_MINUS", "STRING", "CHAR", "COMMENT", "EOL",
|
||||
"WS"
|
||||
};
|
||||
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #VOCABULARY} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String[] tokenNames;
|
||||
static {
|
||||
tokenNames = new String[_SYMBOLIC_NAMES.length];
|
||||
for (int i = 0; i < tokenNames.length; i++) {
|
||||
tokenNames[i] = VOCABULARY.getLiteralName(i);
|
||||
if (tokenNames[i] == null) {
|
||||
tokenNames[i] = VOCABULARY.getSymbolicName(i);
|
||||
}
|
||||
|
||||
if (tokenNames[i] == null) {
|
||||
tokenNames[i] = "<INVALID>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String[] getTokenNames() {
|
||||
return tokenNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public Vocabulary getVocabulary() {
|
||||
return VOCABULARY;
|
||||
}
|
||||
|
||||
|
||||
public pdp7Lexer(CharStream input) {
|
||||
super(input);
|
||||
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGrammarFileName() { return "pdp7.g4"; }
|
||||
|
||||
@Override
|
||||
public String[] getRuleNames() { return ruleNames; }
|
||||
|
||||
@Override
|
||||
public String getSerializedATN() { return _serializedATN; }
|
||||
|
||||
@Override
|
||||
public String[] getModeNames() { return modeNames; }
|
||||
|
||||
@Override
|
||||
public ATN getATN() { return _ATN; }
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2q\u02bc\b\1\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"+
|
||||
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
|
||||
"\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+
|
||||
"\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+
|
||||
",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+
|
||||
"\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+
|
||||
"\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+
|
||||
"\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT"+
|
||||
"\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4_\t_\4"+
|
||||
"`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h\th\4i\ti\4j\tj\4k\t"+
|
||||
"k\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3"+
|
||||
"\5\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\n"+
|
||||
"\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\16"+
|
||||
"\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\21\3\21\3\21"+
|
||||
"\3\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\25"+
|
||||
"\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\30\3\30\3\30"+
|
||||
"\3\30\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\34"+
|
||||
"\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\37\3\37\3\37"+
|
||||
"\3\37\3 \3 \3 \3 \3!\3!\3!\3!\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3$\3$\3$\3$"+
|
||||
"\3%\3%\3%\3%\3%\3&\3&\3&\3&\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3)\3)\3)\3"+
|
||||
")\3)\3*\3*\3*\3*\3+\3+\3+\3+\3+\3,\3,\3,\3,\3,\3-\3-\3-\3-\3.\3.\3.\3"+
|
||||
".\3/\3/\3/\3/\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\62\3\62\3"+
|
||||
"\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\64\3\64\3\64\3\64\3\64\3\65\3"+
|
||||
"\65\3\65\3\65\3\65\3\66\3\66\3\66\3\66\3\66\3\67\3\67\3\67\3\67\3\67\3"+
|
||||
"8\38\38\38\39\39\39\39\3:\3:\3:\3:\3;\3;\3;\3;\3;\3<\3<\3<\3<\3<\3=\3"+
|
||||
"=\3=\3=\3=\3>\3>\3>\3>\3?\3?\3?\3?\3@\3@\3@\3@\3A\3A\3A\3A\3B\3B\3B\3"+
|
||||
"B\3C\3C\3C\3C\3D\3D\3D\3D\3E\3E\3E\3E\3F\3F\3F\3F\3G\3G\3G\3G\3H\3H\3"+
|
||||
"H\3H\3I\3I\3I\3I\3J\3J\3J\3J\3K\3K\3K\3K\3L\3L\3L\3L\3M\3M\3M\3M\3M\3"+
|
||||
"N\3N\3N\3N\3O\3O\3O\3O\3O\3P\3P\3P\3P\3P\3Q\3Q\3Q\3Q\3R\3R\3R\3R\3S\3"+
|
||||
"S\3S\3S\3T\3T\3T\3T\3U\3U\3U\3U\3V\3V\3V\3V\3V\3W\3W\3W\3W\3W\3X\3X\3"+
|
||||
"X\3X\3X\3Y\3Y\3Y\3Y\3Y\3Z\3Z\3Z\3Z\3Z\3[\3[\3[\3[\3[\3\\\3\\\3\\\3\\\3"+
|
||||
"]\3]\3]\3]\3^\3^\3^\3^\3^\3_\3_\3_\3_\3`\3`\3a\3a\3a\3b\3b\3c\3c\3d\3"+
|
||||
"d\3e\3e\3f\6f\u027b\nf\rf\16f\u027c\3f\3f\3g\3g\7g\u0283\ng\fg\16g\u0286"+
|
||||
"\13g\3h\3h\7h\u028a\nh\fh\16h\u028d\13h\3i\3i\6i\u0291\ni\ri\16i\u0292"+
|
||||
"\3j\3j\6j\u0297\nj\rj\16j\u0298\3k\3k\3k\3k\6k\u029f\nk\rk\16k\u02a0\3"+
|
||||
"l\3l\7l\u02a5\nl\fl\16l\u02a8\13l\3m\3m\3m\3n\3n\7n\u02af\nn\fn\16n\u02b2"+
|
||||
"\13n\3o\6o\u02b5\no\ro\16o\u02b6\3p\3p\3p\3p\2\2q\3\3\5\4\7\5\t\6\13\7"+
|
||||
"\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25"+
|
||||
")\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O"+
|
||||
")Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q:s;u<w=y>{?}@\177A\u0081"+
|
||||
"B\u0083C\u0085D\u0087E\u0089F\u008bG\u008dH\u008fI\u0091J\u0093K\u0095"+
|
||||
"L\u0097M\u0099N\u009bO\u009dP\u009fQ\u00a1R\u00a3S\u00a5T\u00a7U\u00a9"+
|
||||
"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\u00dfq\3\2\13\6\2\60\60\62"+
|
||||
";C\\c|\4\2C\\c|\3\2\62;\4\2\62;ch\3\2\629\t\2&\',,..\61<AAC\\c|\7\2\60"+
|
||||
"\60\62;@@C\\c|\4\2\f\f\17\17\4\2\13\13\"\"\u02c4\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\2"+
|
||||
"Y\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\2\2\u00a7\3\2\2\2\2\u00a9\3\2\2\2\2\u00ab"+
|
||||
"\3\2\2\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2\2\2\u00b3\3\2\2"+
|
||||
"\2\2\u00b5\3\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bb\3\2\2\2\2\u00bd"+
|
||||
"\3\2\2\2\2\u00bf\3\2\2\2\2\u00c1\3\2\2\2\2\u00c3\3\2\2\2\2\u00c5\3\2\2"+
|
||||
"\2\2\u00c7\3\2\2\2\2\u00c9\3\2\2\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2\2\2\u00cf"+
|
||||
"\3\2\2\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7\3\2\2"+
|
||||
"\2\2\u00d9\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2\2\2\u00df\3\2\2\2\3\u00e1"+
|
||||
"\3\2\2\2\5\u00e3\3\2\2\2\7\u00e5\3\2\2\2\t\u00e7\3\2\2\2\13\u00eb\3\2"+
|
||||
"\2\2\r\u00ef\3\2\2\2\17\u00f3\3\2\2\2\21\u00f7\3\2\2\2\23\u00fb\3\2\2"+
|
||||
"\2\25\u00ff\3\2\2\2\27\u0103\3\2\2\2\31\u0107\3\2\2\2\33\u010b\3\2\2\2"+
|
||||
"\35\u010f\3\2\2\2\37\u0113\3\2\2\2!\u0117\3\2\2\2#\u011b\3\2\2\2%\u011f"+
|
||||
"\3\2\2\2\'\u0123\3\2\2\2)\u0127\3\2\2\2+\u012b\3\2\2\2-\u012f\3\2\2\2"+
|
||||
"/\u0133\3\2\2\2\61\u0137\3\2\2\2\63\u013b\3\2\2\2\65\u013f\3\2\2\2\67"+
|
||||
"\u0143\3\2\2\29\u0147\3\2\2\2;\u014b\3\2\2\2=\u014f\3\2\2\2?\u0153\3\2"+
|
||||
"\2\2A\u0157\3\2\2\2C\u015b\3\2\2\2E\u015f\3\2\2\2G\u0163\3\2\2\2I\u0167"+
|
||||
"\3\2\2\2K\u016c\3\2\2\2M\u0170\3\2\2\2O\u0175\3\2\2\2Q\u0179\3\2\2\2S"+
|
||||
"\u017e\3\2\2\2U\u0182\3\2\2\2W\u0187\3\2\2\2Y\u018c\3\2\2\2[\u0190\3\2"+
|
||||
"\2\2]\u0194\3\2\2\2_\u0198\3\2\2\2a\u019c\3\2\2\2c\u01a1\3\2\2\2e\u01a6"+
|
||||
"\3\2\2\2g\u01ab\3\2\2\2i\u01b0\3\2\2\2k\u01b5\3\2\2\2m\u01ba\3\2\2\2o"+
|
||||
"\u01bf\3\2\2\2q\u01c3\3\2\2\2s\u01c7\3\2\2\2u\u01cb\3\2\2\2w\u01d0\3\2"+
|
||||
"\2\2y\u01d5\3\2\2\2{\u01da\3\2\2\2}\u01de\3\2\2\2\177\u01e2\3\2\2\2\u0081"+
|
||||
"\u01e6\3\2\2\2\u0083\u01ea\3\2\2\2\u0085\u01ee\3\2\2\2\u0087\u01f2\3\2"+
|
||||
"\2\2\u0089\u01f6\3\2\2\2\u008b\u01fa\3\2\2\2\u008d\u01fe\3\2\2\2\u008f"+
|
||||
"\u0202\3\2\2\2\u0091\u0206\3\2\2\2\u0093\u020a\3\2\2\2\u0095\u020e\3\2"+
|
||||
"\2\2\u0097\u0212\3\2\2\2\u0099\u0216\3\2\2\2\u009b\u021b\3\2\2\2\u009d"+
|
||||
"\u021f\3\2\2\2\u009f\u0224\3\2\2\2\u00a1\u0229\3\2\2\2\u00a3\u022d\3\2"+
|
||||
"\2\2\u00a5\u0231\3\2\2\2\u00a7\u0235\3\2\2\2\u00a9\u0239\3\2\2\2\u00ab"+
|
||||
"\u023d\3\2\2\2\u00ad\u0242\3\2\2\2\u00af\u0247\3\2\2\2\u00b1\u024c\3\2"+
|
||||
"\2\2\u00b3\u0251\3\2\2\2\u00b5\u0256\3\2\2\2\u00b7\u025b\3\2\2\2\u00b9"+
|
||||
"\u025f\3\2\2\2\u00bb\u0263\3\2\2\2\u00bd\u0268\3\2\2\2\u00bf\u026c\3\2"+
|
||||
"\2\2\u00c1\u026e\3\2\2\2\u00c3\u0271\3\2\2\2\u00c5\u0273\3\2\2\2\u00c7"+
|
||||
"\u0275\3\2\2\2\u00c9\u0277\3\2\2\2\u00cb\u027a\3\2\2\2\u00cd\u0280\3\2"+
|
||||
"\2\2\u00cf\u0287\3\2\2\2\u00d1\u028e\3\2\2\2\u00d3\u0294\3\2\2\2\u00d5"+
|
||||
"\u029a\3\2\2\2\u00d7\u02a2\3\2\2\2\u00d9\u02a9\3\2\2\2\u00db\u02ac\3\2"+
|
||||
"\2\2\u00dd\u02b4\3\2\2\2\u00df\u02b8\3\2\2\2\u00e1\u00e2\7=\2\2\u00e2"+
|
||||
"\4\3\2\2\2\u00e3\u00e4\7?\2\2\u00e4\6\3\2\2\2\u00e5\u00e6\7@\2\2\u00e6"+
|
||||
"\b\3\2\2\2\u00e7\u00e8\7f\2\2\u00e8\u00e9\7c\2\2\u00e9\u00ea\7e\2\2\u00ea"+
|
||||
"\n\3\2\2\2\u00eb\u00ec\7l\2\2\u00ec\u00ed\7o\2\2\u00ed\u00ee\7u\2\2\u00ee"+
|
||||
"\f\3\2\2\2\u00ef\u00f0\7f\2\2\u00f0\u00f1\7|\2\2\u00f1\u00f2\7o\2\2\u00f2"+
|
||||
"\16\3\2\2\2\u00f3\u00f4\7n\2\2\u00f4\u00f5\7c\2\2\u00f5\u00f6\7e\2\2\u00f6"+
|
||||
"\20\3\2\2\2\u00f7\u00f8\7z\2\2\u00f8\u00f9\7q\2\2\u00f9\u00fa\7t\2\2\u00fa"+
|
||||
"\22\3\2\2\2\u00fb\u00fc\7c\2\2\u00fc\u00fd\7f\2\2\u00fd\u00fe\7f\2\2\u00fe"+
|
||||
"\24\3\2\2\2\u00ff\u0100\7v\2\2\u0100\u0101\7c\2\2\u0101\u0102\7f\2\2\u0102"+
|
||||
"\26\3\2\2\2\u0103\u0104\7z\2\2\u0104\u0105\7e\2\2\u0105\u0106\7v\2\2\u0106"+
|
||||
"\30\3\2\2\2\u0107\u0108\7k\2\2\u0108\u0109\7u\2\2\u0109\u010a\7|\2\2\u010a"+
|
||||
"\32\3\2\2\2\u010b\u010c\7c\2\2\u010c\u010d\7p\2\2\u010d\u010e\7f\2\2\u010e"+
|
||||
"\34\3\2\2\2\u010f\u0110\7u\2\2\u0110\u0111\7c\2\2\u0111\u0112\7f\2\2\u0112"+
|
||||
"\36\3\2\2\2\u0113\u0114\7l\2\2\u0114\u0115\7o\2\2\u0115\u0116\7r\2\2\u0116"+
|
||||
" \3\2\2\2\u0117\u0118\7p\2\2\u0118\u0119\7q\2\2\u0119\u011a\7r\2\2\u011a"+
|
||||
"\"\3\2\2\2\u011b\u011c\7n\2\2\u011c\u011d\7c\2\2\u011d\u011e\7y\2\2\u011e"+
|
||||
"$\3\2\2\2\u011f\u0120\7e\2\2\u0120\u0121\7o\2\2\u0121\u0122\7c\2\2\u0122"+
|
||||
"&\3\2\2\2\u0123\u0124\7n\2\2\u0124\u0125\7c\2\2\u0125\u0126\7u\2\2\u0126"+
|
||||
"(\3\2\2\2\u0127\u0128\7t\2\2\u0128\u0129\7c\2\2\u0129\u012a\7n\2\2\u012a"+
|
||||
"*\3\2\2\2\u012b\u012c\7t\2\2\u012c\u012d\7c\2\2\u012d\u012e\7t\2\2\u012e"+
|
||||
",\3\2\2\2\u012f\u0130\7j\2\2\u0130\u0131\7n\2\2\u0131\u0132\7v\2\2\u0132"+
|
||||
".\3\2\2\2\u0133\u0134\7u\2\2\u0134\u0135\7o\2\2\u0135\u0136\7c\2\2\u0136"+
|
||||
"\60\3\2\2\2\u0137\u0138\7u\2\2\u0138\u0139\7|\2\2\u0139\u013a\7c\2\2\u013a"+
|
||||
"\62\3\2\2\2\u013b\u013c\7u\2\2\u013c\u013d\7p\2\2\u013d\u013e\7n\2\2\u013e"+
|
||||
"\64\3\2\2\2\u013f\u0140\7u\2\2\u0140\u0141\7m\2\2\u0141\u0142\7r\2\2\u0142"+
|
||||
"\66\3\2\2\2\u0143\u0144\7u\2\2\u0144\u0145\7p\2\2\u0145\u0146\7c\2\2\u0146"+
|
||||
"8\3\2\2\2\u0147\u0148\7u\2\2\u0148\u0149\7|\2\2\u0149\u014a\7n\2\2\u014a"+
|
||||
":\3\2\2\2\u014b\u014c\7t\2\2\u014c\u014d\7v\2\2\u014d\u014e\7n\2\2\u014e"+
|
||||
"<\3\2\2\2\u014f\u0150\7t\2\2\u0150\u0151\7v\2\2\u0151\u0152\7t\2\2\u0152"+
|
||||
">\3\2\2\2\u0153\u0154\7e\2\2\u0154\u0155\7k\2\2\u0155\u0156\7n\2\2\u0156"+
|
||||
"@\3\2\2\2\u0157\u0158\7t\2\2\u0158\u0159\7e\2\2\u0159\u015a\7n\2\2\u015a"+
|
||||
"B\3\2\2\2\u015b\u015c\7t\2\2\u015c\u015d\7e\2\2\u015d\u015e\7t\2\2\u015e"+
|
||||
"D\3\2\2\2\u015f\u0160\7e\2\2\u0160\u0161\7k\2\2\u0161\u0162\7c\2\2\u0162"+
|
||||
"F\3\2\2\2\u0163\u0164\7n\2\2\u0164\u0165\7t\2\2\u0165\u0166\7u\2\2\u0166"+
|
||||
"H\3\2\2\2\u0167\u0168\7n\2\2\u0168\u0169\7t\2\2\u0169\u016a\7u\2\2\u016a"+
|
||||
"\u016b\7u\2\2\u016bJ\3\2\2\2\u016c\u016d\7n\2\2\u016d\u016e\7n\2\2\u016e"+
|
||||
"\u016f\7u\2\2\u016fL\3\2\2\2\u0170\u0171\7n\2\2\u0171\u0172\7n\2\2\u0172"+
|
||||
"\u0173\7u\2\2\u0173\u0174\7u\2\2\u0174N\3\2\2\2\u0175\u0176\7c\2\2\u0176"+
|
||||
"\u0177\7n\2\2\u0177\u0178\7u\2\2\u0178P\3\2\2\2\u0179\u017a\7c\2\2\u017a"+
|
||||
"\u017b\7n\2\2\u017b\u017c\7u\2\2\u017c\u017d\7u\2\2\u017dR\3\2\2\2\u017e"+
|
||||
"\u017f\7o\2\2\u017f\u0180\7w\2\2\u0180\u0181\7n\2\2\u0181T\3\2\2\2\u0182"+
|
||||
"\u0183\7k\2\2\u0183\u0184\7f\2\2\u0184\u0185\7k\2\2\u0185\u0186\7x\2\2"+
|
||||
"\u0186V\3\2\2\2\u0187\u0188\7n\2\2\u0188\u0189\7c\2\2\u0189\u018a\7e\2"+
|
||||
"\2\u018a\u018b\7s\2\2\u018bX\3\2\2\2\u018c\u018d\7e\2\2\u018d\u018e\7"+
|
||||
"n\2\2\u018e\u018f\7s\2\2\u018fZ\3\2\2\2\u0190\u0191\7q\2\2\u0191\u0192"+
|
||||
"\7o\2\2\u0192\u0193\7s\2\2\u0193\\\3\2\2\2\u0194\u0195\7e\2\2\u0195\u0196"+
|
||||
"\7o\2\2\u0196\u0197\7s\2\2\u0197^\3\2\2\2\u0198\u0199\7n\2\2\u0199\u019a"+
|
||||
"\7o\2\2\u019a\u019b\7s\2\2\u019b`\3\2\2\2\u019c\u019d\7f\2\2\u019d\u019e"+
|
||||
"\7u\2\2\u019e\u019f\7e\2\2\u019f\u01a0\7u\2\2\u01a0b\3\2\2\2\u01a1\u01a2"+
|
||||
"\7f\2\2\u01a2\u01a3\7u\2\2\u01a3\u01a4\7n\2\2\u01a4\u01a5\7y\2\2\u01a5"+
|
||||
"d\3\2\2\2\u01a6\u01a7\7f\2\2\u01a7\u01a8\7u\2\2\u01a8\u01a9\7n\2\2\u01a9"+
|
||||
"\u01aa\7o\2\2\u01aaf\3\2\2\2\u01ab\u01ac\7f\2\2\u01ac\u01ad\7u\2\2\u01ad"+
|
||||
"\u01ae\7n\2\2\u01ae\u01af\7f\2\2\u01afh\3\2\2\2\u01b0\u01b1\7f\2\2\u01b1"+
|
||||
"\u01b2\7u\2\2\u01b2\u01b3\7n\2\2\u01b3\u01b4\7u\2\2\u01b4j\3\2\2\2\u01b5"+
|
||||
"\u01b6\7f\2\2\u01b6\u01b7\7u\2\2\u01b7\u01b8\7u\2\2\u01b8\u01b9\7h\2\2"+
|
||||
"\u01b9l\3\2\2\2\u01ba\u01bb\7f\2\2\u01bb\u01bc\7u\2\2\u01bc\u01bd\7t\2"+
|
||||
"\2\u01bd\u01be\7u\2\2\u01ben\3\2\2\2\u01bf\u01c0\7k\2\2\u01c0\u01c1\7"+
|
||||
"q\2\2\u01c1\u01c2\7h\2\2\u01c2p\3\2\2\2\u01c3\u01c4\7k\2\2\u01c4\u01c5"+
|
||||
"\7q\2\2\u01c5\u01c6\7p\2\2\u01c6r\3\2\2\2\u01c7\u01c8\7e\2\2\u01c8\u01c9"+
|
||||
"\7c\2\2\u01c9\u01ca\7h\2\2\u01cat\3\2\2\2\u01cb\u01cc\7e\2\2\u01cc\u01cd"+
|
||||
"\7n\2\2\u01cd\u01ce\7q\2\2\u01ce\u01cf\7p\2\2\u01cfv\3\2\2\2\u01d0\u01d1"+
|
||||
"\7e\2\2\u01d1\u01d2\7n\2\2\u01d2\u01d3\7u\2\2\u01d3\u01d4\7h\2\2\u01d4"+
|
||||
"x\3\2\2\2\u01d5\u01d6\7e\2\2\u01d6\u01d7\7n\2\2\u01d7\u01d8\7q\2\2\u01d8"+
|
||||
"\u01d9\7h\2\2\u01d9z\3\2\2\2\u01da\u01db\7m\2\2\u01db\u01dc\7u\2\2\u01dc"+
|
||||
"\u01dd\7h\2\2\u01dd|\3\2\2\2\u01de\u01df\7m\2\2\u01df\u01e0\7t\2\2\u01e0"+
|
||||
"\u01e1\7d\2\2\u01e1~\3\2\2\2\u01e2\u01e3\7v\2\2\u01e3\u01e4\7u\2\2\u01e4"+
|
||||
"\u01e5\7h\2\2\u01e5\u0080\3\2\2\2\u01e6\u01e7\7v\2\2\u01e7\u01e8\7e\2"+
|
||||
"\2\u01e8\u01e9\7h\2\2\u01e9\u0082\3\2\2\2\u01ea\u01eb\7v\2\2\u01eb\u01ec"+
|
||||
"\7n\2\2\u01ec\u01ed\7u\2\2\u01ed\u0084\3\2\2\2\u01ee\u01ef\7u\2\2\u01ef"+
|
||||
"\u01f0\7e\2\2\u01f0\u01f1\7m\2\2\u01f1\u0086\3\2\2\2\u01f2\u01f3\7e\2"+
|
||||
"\2\u01f3\u01f4\7e\2\2\u01f4\u01f5\7m\2\2\u01f5\u0088\3\2\2\2\u01f6\u01f7"+
|
||||
"\7n\2\2\u01f7\u01f8\7e\2\2\u01f8\u01f9\7m\2\2\u01f9\u008a\3\2\2\2\u01fa"+
|
||||
"\u01fb\7t\2\2\u01fb\u01fc\7u\2\2\u01fc\u01fd\7h\2\2\u01fd\u008c\3\2\2"+
|
||||
"\2\u01fe\u01ff\7t\2\2\u01ff\u0200\7u\2\2\u0200\u0201\7c\2\2\u0201\u008e"+
|
||||
"\3\2\2\2\u0202\u0203\7t\2\2\u0203\u0204\7t\2\2\u0204\u0205\7d\2\2\u0205"+
|
||||
"\u0090\3\2\2\2\u0206\u0207\7r\2\2\u0207\u0208\7u\2\2\u0208\u0209\7h\2"+
|
||||
"\2\u0209\u0092\3\2\2\2\u020a\u020b\7r\2\2\u020b\u020c\7e\2\2\u020c\u020d"+
|
||||
"\7h\2\2\u020d\u0094\3\2\2\2\u020e\u020f\7r\2\2\u020f\u0210\7u\2\2\u0210"+
|
||||
"\u0211\7c\2\2\u0211\u0096\3\2\2\2\u0212\u0213\7e\2\2\u0213\u0214\7f\2"+
|
||||
"\2\u0214\u0215\7h\2\2\u0215\u0098\3\2\2\2\u0216\u0217\7t\2\2\u0217\u0218"+
|
||||
"\7n\2\2\u0218\u0219\7r\2\2\u0219\u021a\7f\2\2\u021a\u009a\3\2\2\2\u021b"+
|
||||
"\u021c\7n\2\2\u021c\u021d\7f\2\2\u021d\u021e\7c\2\2\u021e\u009c\3\2\2"+
|
||||
"\2\u021f\u0220\7y\2\2\u0220\u0221\7e\2\2\u0221\u0222\7i\2\2\u0222\u0223"+
|
||||
"\7c\2\2\u0223\u009e\3\2\2\2\u0224\u0225\7t\2\2\u0225\u0226\7c\2\2\u0226"+
|
||||
"\u0227\7g\2\2\u0227\u0228\7h\2\2\u0228\u00a0\3\2\2\2\u0229\u022a\7d\2"+
|
||||
"\2\u022a\u022b\7g\2\2\u022b\u022c\7i\2\2\u022c\u00a2\3\2\2\2\u022d\u022e"+
|
||||
"\7u\2\2\u022e\u022f\7r\2\2\u022f\u0230\7d\2\2\u0230\u00a4\3\2\2\2\u0231"+
|
||||
"\u0232\7e\2\2\u0232\u0233\7r\2\2\u0233\u0234\7d\2\2\u0234\u00a6\3\2\2"+
|
||||
"\2\u0235\u0236\7n\2\2\u0236\u0237\7r\2\2\u0237\u0238\7d\2\2\u0238\u00a8"+
|
||||
"\3\2\2\2\u0239\u023a\7y\2\2\u023a\u023b\7d\2\2\u023b\u023c\7n\2\2\u023c"+
|
||||
"\u00aa\3\2\2\2\u023d\u023e\7f\2\2\u023e\u023f\7r\2\2\u023f\u0240\7t\2"+
|
||||
"\2\u0240\u0241\7u\2\2\u0241\u00ac\3\2\2\2\u0242\u0243\7f\2\2\u0243\u0244"+
|
||||
"\7r\2\2\u0244\u0245\7u\2\2\u0245\u0246\7h\2\2\u0246\u00ae\3\2\2\2\u0247"+
|
||||
"\u0248\7f\2\2\u0248\u0249\7r\2\2\u0249\u024a\7e\2\2\u024a\u024b\7h\2\2"+
|
||||
"\u024b\u00b0\3\2\2\2\u024c\u024d\7f\2\2\u024d\u024e\7r\2\2\u024e\u024f"+
|
||||
"\7t\2\2\u024f\u0250\7e\2\2\u0250\u00b2\3\2\2\2\u0251\u0252\7e\2\2\u0252"+
|
||||
"\u0253\7t\2\2\u0253\u0254\7u\2\2\u0254\u0255\7h\2\2\u0255\u00b4\3\2\2"+
|
||||
"\2\u0256\u0257\7e\2\2\u0257\u0258\7t\2\2\u0258\u0259\7t\2\2\u0259\u025a"+
|
||||
"\7d\2\2\u025a\u00b6\3\2\2\2\u025b\u025c\7u\2\2\u025c\u025d\7{\2\2\u025d"+
|
||||
"\u025e\7u\2\2\u025e\u00b8\3\2\2\2\u025f\u0260\7e\2\2\u0260\u0261\7|\2"+
|
||||
"\2\u0261\u0262\7o\2\2\u0262\u00ba\3\2\2\2\u0263\u0264\7k\2\2\u0264\u0265"+
|
||||
"\7t\2\2\u0265\u0266\7u\2\2\u0266\u0267\7u\2\2\u0267\u00bc\3\2\2\2\u0268"+
|
||||
"\u0269\7f\2\2\u0269\u026a\7u\2\2\u026a\u026b\7o\2\2\u026b\u00be\3\2\2"+
|
||||
"\2\u026c\u026d\7\60\2\2\u026d\u00c0\3\2\2\2\u026e\u026f\7\60\2\2\u026f"+
|
||||
"\u0270\7\60\2\2\u0270\u00c2\3\2\2\2\u0271\u0272\7-\2\2\u0272\u00c4\3\2"+
|
||||
"\2\2\u0273\u0274\7/\2\2\u0274\u00c6\3\2\2\2\u0275\u0276\7,\2\2\u0276\u00c8"+
|
||||
"\3\2\2\2\u0277\u0278\7\61\2\2\u0278\u00ca\3\2\2\2\u0279\u027b\t\2\2\2"+
|
||||
"\u027a\u0279\3\2\2\2\u027b\u027c\3\2\2\2\u027c\u027a\3\2\2\2\u027c\u027d"+
|
||||
"\3\2\2\2\u027d\u027e\3\2\2\2\u027e\u027f\7<\2\2\u027f\u00cc\3\2\2\2\u0280"+
|
||||
"\u0284\t\3\2\2\u0281\u0283\t\2\2\2\u0282\u0281\3\2\2\2\u0283\u0286\3\2"+
|
||||
"\2\2\u0284\u0282\3\2\2\2\u0284\u0285\3\2\2\2\u0285\u00ce\3\2\2\2\u0286"+
|
||||
"\u0284\3\2\2\2\u0287\u028b\t\4\2\2\u0288\u028a\t\5\2\2\u0289\u0288\3\2"+
|
||||
"\2\2\u028a\u028d\3\2\2\2\u028b\u0289\3\2\2\2\u028b\u028c\3\2\2\2\u028c"+
|
||||
"\u00d0\3\2\2\2\u028d\u028b\3\2\2\2\u028e\u0290\7f\2\2\u028f\u0291\t\4"+
|
||||
"\2\2\u0290\u028f\3\2\2\2\u0291\u0292\3\2\2\2\u0292\u0290\3\2\2\2\u0292"+
|
||||
"\u0293\3\2\2\2\u0293\u00d2\3\2\2\2\u0294\u0296\7q\2\2\u0295\u0297\t\6"+
|
||||
"\2\2\u0296\u0295\3\2\2\2\u0297\u0298\3\2\2\2\u0298\u0296\3\2\2\2\u0298"+
|
||||
"\u0299\3\2\2\2\u0299\u00d4\3\2\2\2\u029a\u029b\7f\2\2\u029b\u029c\7o\2"+
|
||||
"\2\u029c\u029e\3\2\2\2\u029d\u029f\t\4\2\2\u029e\u029d\3\2\2\2\u029f\u02a0"+
|
||||
"\3\2\2\2\u02a0\u029e\3\2\2\2\u02a0\u02a1\3\2\2\2\u02a1\u00d6\3\2\2\2\u02a2"+
|
||||
"\u02a6\7>\2\2\u02a3\u02a5\t\7\2\2\u02a4\u02a3\3\2\2\2\u02a5\u02a8\3\2"+
|
||||
"\2\2\u02a6\u02a4\3\2\2\2\u02a6\u02a7\3\2\2\2\u02a7\u00d8\3\2\2\2\u02a8"+
|
||||
"\u02a6\3\2\2\2\u02a9\u02aa\t\b\2\2\u02aa\u02ab\7@\2\2\u02ab\u00da\3\2"+
|
||||
"\2\2\u02ac\u02b0\7$\2\2\u02ad\u02af\n\t\2\2\u02ae\u02ad\3\2\2\2\u02af"+
|
||||
"\u02b2\3\2\2\2\u02b0\u02ae\3\2\2\2\u02b0\u02b1\3\2\2\2\u02b1\u00dc\3\2"+
|
||||
"\2\2\u02b2\u02b0\3\2\2\2\u02b3\u02b5\t\t\2\2\u02b4\u02b3\3\2\2\2\u02b5"+
|
||||
"\u02b6\3\2\2\2\u02b6\u02b4\3\2\2\2\u02b6\u02b7\3\2\2\2\u02b7\u00de\3\2"+
|
||||
"\2\2\u02b8\u02b9\t\n\2\2\u02b9\u02ba\3\2\2\2\u02ba\u02bb\bp\2\2\u02bb"+
|
||||
"\u00e0\3\2\2\2\f\2\u027c\u0284\u028b\u0292\u0298\u02a0\u02a6\u02b0\u02b6"+
|
||||
"\3\b\2\2";
|
||||
public static final ATN _ATN =
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
static {
|
||||
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
|
||||
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
|
||||
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
// Generated from com/khubla/pdp7parse/antlr4/pdp7.g4 by ANTLR 4.5
|
||||
package com.khubla.pdp7parse.antlr4;
|
||||
import org.antlr.v4.runtime.misc.NotNull;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeListener;
|
||||
|
||||
/**
|
||||
* This interface defines a complete listener for a parse tree produced by
|
||||
* {@link pdp7Parser}.
|
||||
*/
|
||||
public interface pdp7Listener extends ParseTreeListener {
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#prog}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterProg(pdp7Parser.ProgContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#prog}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitProg(pdp7Parser.ProgContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#line}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterLine(pdp7Parser.LineContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#line}.
|
||||
* @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
|
||||
*/
|
||||
void enterDeclarations(pdp7Parser.DeclarationsContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#declarations}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitDeclarations(pdp7Parser.DeclarationsContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#declaration}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterDeclaration(pdp7Parser.DeclarationContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#declaration}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitDeclaration(pdp7Parser.DeclarationContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#instruction}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterInstruction(pdp7Parser.InstructionContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#instruction}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitInstruction(pdp7Parser.InstructionContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#argument}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterArgument(pdp7Parser.ArgumentContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#argument}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitArgument(pdp7Parser.ArgumentContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#assignment}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterAssignment(pdp7Parser.AssignmentContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#assignment}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitAssignment(pdp7Parser.AssignmentContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#symbol}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterSymbol(pdp7Parser.SymbolContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#symbol}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitSymbol(pdp7Parser.SymbolContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#expression}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterExpression(pdp7Parser.ExpressionContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#expression}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitExpression(pdp7Parser.ExpressionContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#multiplyingExpression}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterMultiplyingExpression(pdp7Parser.MultiplyingExpressionContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#multiplyingExpression}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitMultiplyingExpression(pdp7Parser.MultiplyingExpressionContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#atom}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterAtom(pdp7Parser.AtomContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#atom}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitAtom(pdp7Parser.AtomContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#string}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterString(pdp7Parser.StringContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#string}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitString(pdp7Parser.StringContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#eol}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterEol(pdp7Parser.EolContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#eol}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitEol(pdp7Parser.EolContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#comment}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterComment(pdp7Parser.CommentContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#comment}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitComment(pdp7Parser.CommentContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#label}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterLabel(pdp7Parser.LabelContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#label}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitLabel(pdp7Parser.LabelContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#variable}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterVariable(pdp7Parser.VariableContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#variable}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitVariable(pdp7Parser.VariableContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link pdp7Parser#opcode}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterOpcode(pdp7Parser.OpcodeContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link pdp7Parser#opcode}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitOpcode(pdp7Parser.OpcodeContext ctx);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,211 +0,0 @@
|
||||
T__0=1
|
||||
T__1=2
|
||||
T__2=3
|
||||
T__3=4
|
||||
T__4=5
|
||||
T__5=6
|
||||
T__6=7
|
||||
T__7=8
|
||||
T__8=9
|
||||
T__9=10
|
||||
T__10=11
|
||||
T__11=12
|
||||
T__12=13
|
||||
T__13=14
|
||||
T__14=15
|
||||
T__15=16
|
||||
T__16=17
|
||||
T__17=18
|
||||
T__18=19
|
||||
T__19=20
|
||||
T__20=21
|
||||
T__21=22
|
||||
T__22=23
|
||||
T__23=24
|
||||
T__24=25
|
||||
T__25=26
|
||||
T__26=27
|
||||
T__27=28
|
||||
T__28=29
|
||||
T__29=30
|
||||
T__30=31
|
||||
T__31=32
|
||||
T__32=33
|
||||
T__33=34
|
||||
T__34=35
|
||||
T__35=36
|
||||
T__36=37
|
||||
T__37=38
|
||||
T__38=39
|
||||
T__39=40
|
||||
T__40=41
|
||||
T__41=42
|
||||
T__42=43
|
||||
T__43=44
|
||||
T__44=45
|
||||
T__45=46
|
||||
T__46=47
|
||||
T__47=48
|
||||
T__48=49
|
||||
T__49=50
|
||||
T__50=51
|
||||
T__51=52
|
||||
T__52=53
|
||||
T__53=54
|
||||
T__54=55
|
||||
T__55=56
|
||||
T__56=57
|
||||
T__57=58
|
||||
T__58=59
|
||||
T__59=60
|
||||
T__60=61
|
||||
T__61=62
|
||||
T__62=63
|
||||
T__63=64
|
||||
T__64=65
|
||||
T__65=66
|
||||
T__66=67
|
||||
T__67=68
|
||||
T__68=69
|
||||
T__69=70
|
||||
T__70=71
|
||||
T__71=72
|
||||
T__72=73
|
||||
T__73=74
|
||||
T__74=75
|
||||
T__75=76
|
||||
T__76=77
|
||||
T__77=78
|
||||
T__78=79
|
||||
T__79=80
|
||||
T__80=81
|
||||
T__81=82
|
||||
T__82=83
|
||||
T__83=84
|
||||
T__84=85
|
||||
T__85=86
|
||||
T__86=87
|
||||
T__87=88
|
||||
T__88=89
|
||||
T__89=90
|
||||
T__90=91
|
||||
T__91=92
|
||||
T__92=93
|
||||
T__93=94
|
||||
LOC=95
|
||||
RELOC=96
|
||||
PLUS=97
|
||||
MINUS=98
|
||||
TIMES=99
|
||||
DIV=100
|
||||
LABEL=101
|
||||
IDENTIFIER=102
|
||||
NUMERIC_LITERAL=103
|
||||
DECIMAL=104
|
||||
OCTAL=105
|
||||
DECIMAL_MINUS=106
|
||||
STRING=107
|
||||
CHAR=108
|
||||
COMMENT=109
|
||||
EOL=110
|
||||
WS=111
|
||||
';'=1
|
||||
'='=2
|
||||
'>'=3
|
||||
'dac'=4
|
||||
'jms'=5
|
||||
'dzm'=6
|
||||
'lac'=7
|
||||
'xor'=8
|
||||
'add'=9
|
||||
'tad'=10
|
||||
'xct'=11
|
||||
'isz'=12
|
||||
'and'=13
|
||||
'sad'=14
|
||||
'jmp'=15
|
||||
'nop'=16
|
||||
'law'=17
|
||||
'cma'=18
|
||||
'las'=19
|
||||
'ral'=20
|
||||
'rar'=21
|
||||
'hlt'=22
|
||||
'sma'=23
|
||||
'sza'=24
|
||||
'snl'=25
|
||||
'skp'=26
|
||||
'sna'=27
|
||||
'szl'=28
|
||||
'rtl'=29
|
||||
'rtr'=30
|
||||
'cil'=31
|
||||
'rcl'=32
|
||||
'rcr'=33
|
||||
'cia'=34
|
||||
'lrs'=35
|
||||
'lrss'=36
|
||||
'lls'=37
|
||||
'llss'=38
|
||||
'als'=39
|
||||
'alss'=40
|
||||
'mul'=41
|
||||
'idiv'=42
|
||||
'lacq'=43
|
||||
'clq'=44
|
||||
'omq'=45
|
||||
'cmq'=46
|
||||
'lmq'=47
|
||||
'dscs'=48
|
||||
'dslw'=49
|
||||
'dslm'=50
|
||||
'dsld'=51
|
||||
'dsls'=52
|
||||
'dssf'=53
|
||||
'dsrs'=54
|
||||
'iof'=55
|
||||
'ion'=56
|
||||
'caf'=57
|
||||
'clon'=58
|
||||
'clsf'=59
|
||||
'clof'=60
|
||||
'ksf'=61
|
||||
'krb'=62
|
||||
'tsf'=63
|
||||
'tcf'=64
|
||||
'tls'=65
|
||||
'sck'=66
|
||||
'cck'=67
|
||||
'lck'=68
|
||||
'rsf'=69
|
||||
'rsa'=70
|
||||
'rrb'=71
|
||||
'psf'=72
|
||||
'pcf'=73
|
||||
'psa'=74
|
||||
'cdf'=75
|
||||
'rlpd'=76
|
||||
'lda'=77
|
||||
'wcga'=78
|
||||
'raef'=79
|
||||
'beg'=80
|
||||
'spb'=81
|
||||
'cpb'=82
|
||||
'lpb'=83
|
||||
'wbl'=84
|
||||
'dprs'=85
|
||||
'dpsf'=86
|
||||
'dpcf'=87
|
||||
'dprc'=88
|
||||
'crsf'=89
|
||||
'crrb'=90
|
||||
'sys'=91
|
||||
'czm'=92
|
||||
'irss'=93
|
||||
'dsm'=94
|
||||
'.'=95
|
||||
'..'=96
|
||||
'+'=97
|
||||
'-'=98
|
||||
'*'=99
|
||||
'/'=100
|
||||
@@ -1,211 +0,0 @@
|
||||
T__0=1
|
||||
T__1=2
|
||||
T__2=3
|
||||
T__3=4
|
||||
T__4=5
|
||||
T__5=6
|
||||
T__6=7
|
||||
T__7=8
|
||||
T__8=9
|
||||
T__9=10
|
||||
T__10=11
|
||||
T__11=12
|
||||
T__12=13
|
||||
T__13=14
|
||||
T__14=15
|
||||
T__15=16
|
||||
T__16=17
|
||||
T__17=18
|
||||
T__18=19
|
||||
T__19=20
|
||||
T__20=21
|
||||
T__21=22
|
||||
T__22=23
|
||||
T__23=24
|
||||
T__24=25
|
||||
T__25=26
|
||||
T__26=27
|
||||
T__27=28
|
||||
T__28=29
|
||||
T__29=30
|
||||
T__30=31
|
||||
T__31=32
|
||||
T__32=33
|
||||
T__33=34
|
||||
T__34=35
|
||||
T__35=36
|
||||
T__36=37
|
||||
T__37=38
|
||||
T__38=39
|
||||
T__39=40
|
||||
T__40=41
|
||||
T__41=42
|
||||
T__42=43
|
||||
T__43=44
|
||||
T__44=45
|
||||
T__45=46
|
||||
T__46=47
|
||||
T__47=48
|
||||
T__48=49
|
||||
T__49=50
|
||||
T__50=51
|
||||
T__51=52
|
||||
T__52=53
|
||||
T__53=54
|
||||
T__54=55
|
||||
T__55=56
|
||||
T__56=57
|
||||
T__57=58
|
||||
T__58=59
|
||||
T__59=60
|
||||
T__60=61
|
||||
T__61=62
|
||||
T__62=63
|
||||
T__63=64
|
||||
T__64=65
|
||||
T__65=66
|
||||
T__66=67
|
||||
T__67=68
|
||||
T__68=69
|
||||
T__69=70
|
||||
T__70=71
|
||||
T__71=72
|
||||
T__72=73
|
||||
T__73=74
|
||||
T__74=75
|
||||
T__75=76
|
||||
T__76=77
|
||||
T__77=78
|
||||
T__78=79
|
||||
T__79=80
|
||||
T__80=81
|
||||
T__81=82
|
||||
T__82=83
|
||||
T__83=84
|
||||
T__84=85
|
||||
T__85=86
|
||||
T__86=87
|
||||
T__87=88
|
||||
T__88=89
|
||||
T__89=90
|
||||
T__90=91
|
||||
T__91=92
|
||||
T__92=93
|
||||
T__93=94
|
||||
LOC=95
|
||||
RELOC=96
|
||||
PLUS=97
|
||||
MINUS=98
|
||||
TIMES=99
|
||||
DIV=100
|
||||
LABEL=101
|
||||
IDENTIFIER=102
|
||||
NUMERIC_LITERAL=103
|
||||
DECIMAL=104
|
||||
OCTAL=105
|
||||
DECIMAL_MINUS=106
|
||||
STRING=107
|
||||
CHAR=108
|
||||
COMMENT=109
|
||||
EOL=110
|
||||
WS=111
|
||||
';'=1
|
||||
'='=2
|
||||
'>'=3
|
||||
'dac'=4
|
||||
'jms'=5
|
||||
'dzm'=6
|
||||
'lac'=7
|
||||
'xor'=8
|
||||
'add'=9
|
||||
'tad'=10
|
||||
'xct'=11
|
||||
'isz'=12
|
||||
'and'=13
|
||||
'sad'=14
|
||||
'jmp'=15
|
||||
'nop'=16
|
||||
'law'=17
|
||||
'cma'=18
|
||||
'las'=19
|
||||
'ral'=20
|
||||
'rar'=21
|
||||
'hlt'=22
|
||||
'sma'=23
|
||||
'sza'=24
|
||||
'snl'=25
|
||||
'skp'=26
|
||||
'sna'=27
|
||||
'szl'=28
|
||||
'rtl'=29
|
||||
'rtr'=30
|
||||
'cil'=31
|
||||
'rcl'=32
|
||||
'rcr'=33
|
||||
'cia'=34
|
||||
'lrs'=35
|
||||
'lrss'=36
|
||||
'lls'=37
|
||||
'llss'=38
|
||||
'als'=39
|
||||
'alss'=40
|
||||
'mul'=41
|
||||
'idiv'=42
|
||||
'lacq'=43
|
||||
'clq'=44
|
||||
'omq'=45
|
||||
'cmq'=46
|
||||
'lmq'=47
|
||||
'dscs'=48
|
||||
'dslw'=49
|
||||
'dslm'=50
|
||||
'dsld'=51
|
||||
'dsls'=52
|
||||
'dssf'=53
|
||||
'dsrs'=54
|
||||
'iof'=55
|
||||
'ion'=56
|
||||
'caf'=57
|
||||
'clon'=58
|
||||
'clsf'=59
|
||||
'clof'=60
|
||||
'ksf'=61
|
||||
'krb'=62
|
||||
'tsf'=63
|
||||
'tcf'=64
|
||||
'tls'=65
|
||||
'sck'=66
|
||||
'cck'=67
|
||||
'lck'=68
|
||||
'rsf'=69
|
||||
'rsa'=70
|
||||
'rrb'=71
|
||||
'psf'=72
|
||||
'pcf'=73
|
||||
'psa'=74
|
||||
'cdf'=75
|
||||
'rlpd'=76
|
||||
'lda'=77
|
||||
'wcga'=78
|
||||
'raef'=79
|
||||
'beg'=80
|
||||
'spb'=81
|
||||
'cpb'=82
|
||||
'lpb'=83
|
||||
'wbl'=84
|
||||
'dprs'=85
|
||||
'dpsf'=86
|
||||
'dpcf'=87
|
||||
'dprc'=88
|
||||
'crsf'=89
|
||||
'crrb'=90
|
||||
'sys'=91
|
||||
'czm'=92
|
||||
'irss'=93
|
||||
'dsm'=94
|
||||
'.'=95
|
||||
'..'=96
|
||||
'+'=97
|
||||
'-'=98
|
||||
'*'=99
|
||||
'/'=100
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.khubla.pdp7parse;
|
||||
|
||||
/*
|
||||
* Copyright 2016, Tom Everett <tom@khubla.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.khubla.pdp7parse.antlr4.pdp7Parser.ProgContext;
|
||||
|
||||
public class BasicTests {
|
||||
@Test
|
||||
public void test1() {
|
||||
String[] extensions = new String[] { "s" };
|
||||
Collection<File> files = FileUtils.listFiles(new File("src/test/resources"), extensions, true);
|
||||
for (File file : files) {
|
||||
testFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
private void testFile(File file) {
|
||||
try {
|
||||
System.out.println(file.getAbsolutePath());
|
||||
InputStream is = new FileInputStream(file);
|
||||
ProgContext progContext = PDP7Parser.parse(is, System.out);
|
||||
Assert.assertNotNull(progContext);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Assert.fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,586 +0,0 @@
|
||||
" 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
|
||||
@@ -1,683 +0,0 @@
|
||||
" 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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,288 +0,0 @@
|
||||
" bc
|
||||
|
||||
jmp start
|
||||
rinit:
|
||||
jms initio
|
||||
jmp .+1 i
|
||||
initio: 0
|
||||
lac inter-1
|
||||
dac fetch
|
||||
jmp rinit
|
||||
jms inter
|
||||
inter: 0
|
||||
las
|
||||
and o17
|
||||
sza
|
||||
jms trace
|
||||
lac pc i
|
||||
dac instr
|
||||
lac pc
|
||||
and o10000
|
||||
sna
|
||||
jmp badpc
|
||||
lac sp
|
||||
and o17700
|
||||
sad o17700
|
||||
jmp badsp
|
||||
and o10000
|
||||
sna
|
||||
jmp badsp
|
||||
lac instr
|
||||
sad insasg
|
||||
skp
|
||||
jmp inter i
|
||||
-4
|
||||
tad sp
|
||||
dac t1
|
||||
lac t1 i
|
||||
and o10000
|
||||
sna
|
||||
jmp badasgn
|
||||
lac instr
|
||||
jmp inter i
|
||||
|
||||
trace: 0
|
||||
and d1
|
||||
sza
|
||||
jms dtrace
|
||||
las
|
||||
and d2
|
||||
sza
|
||||
jms ddisp
|
||||
las
|
||||
and d4
|
||||
sza
|
||||
jms histog
|
||||
las
|
||||
and d8
|
||||
sza
|
||||
jmp stop
|
||||
jmp trace i
|
||||
|
||||
dtrace: 0
|
||||
lac pc
|
||||
dac 8
|
||||
lac 8 i
|
||||
dac instr
|
||||
lac 8
|
||||
jms octal; -4
|
||||
law 040
|
||||
jms putc
|
||||
lac instr
|
||||
cll; lrs 14
|
||||
tad lacop
|
||||
dac .+1
|
||||
lac ..
|
||||
jms putc
|
||||
law 040
|
||||
jms putc
|
||||
lac instr
|
||||
jms octal; -4
|
||||
|
||||
lac instr
|
||||
sad inslitr
|
||||
skp
|
||||
jmp 1f
|
||||
law 040
|
||||
jms putc
|
||||
lac 8 i
|
||||
jms octal; -6
|
||||
1:
|
||||
law 012
|
||||
jms putc
|
||||
jms flush
|
||||
jmp dtrace i
|
||||
|
||||
ddisp: 0
|
||||
jms dspinit
|
||||
lac dspbp
|
||||
dac 8
|
||||
lac dp
|
||||
sad olddp
|
||||
skp
|
||||
jms dspblk
|
||||
lac pc
|
||||
jms dspnt
|
||||
lac sp
|
||||
jms dspnt
|
||||
lac lastv
|
||||
jms dspnt
|
||||
-1
|
||||
dac B i
|
||||
lac pbs i
|
||||
sza
|
||||
jmp .-2
|
||||
jmp ddisp i
|
||||
|
||||
dspblk: 0
|
||||
lac dspbuf
|
||||
dac 8
|
||||
lac dp
|
||||
dac t1
|
||||
dzm t2
|
||||
1:
|
||||
lac t1
|
||||
sna
|
||||
jmp 1f
|
||||
lac o216000 " dx -20
|
||||
dac 8 i
|
||||
lac t2
|
||||
tad o20
|
||||
dac t2
|
||||
lac t1
|
||||
tad d1
|
||||
dac t3
|
||||
lac t3 i
|
||||
jms dspnt
|
||||
lac t1 i
|
||||
dac t1
|
||||
jmp 1b
|
||||
1:
|
||||
lac o160020 " sx 20
|
||||
tad t2
|
||||
dac dspbuf i
|
||||
dac 8 i
|
||||
lac 8
|
||||
dac dspbp
|
||||
jmp dspblk i
|
||||
|
||||
dspnt: 0
|
||||
and o7777
|
||||
lrss 2
|
||||
xor o164000 " sy 0
|
||||
dac 8 i
|
||||
lac o17010
|
||||
dac 8 i
|
||||
jmp dspnt i
|
||||
|
||||
dspinit: 0
|
||||
-1
|
||||
tad dspinit
|
||||
dac dspinit
|
||||
-300
|
||||
tad lastv
|
||||
dac lastv
|
||||
dac dspbuf
|
||||
-1
|
||||
dac dspinit i
|
||||
dac dspbuf i
|
||||
dzm olddp
|
||||
lac dspbuf
|
||||
sys capt
|
||||
law 13
|
||||
sys sysloc
|
||||
dac pbs
|
||||
jmp dspinit i
|
||||
|
||||
histog: 0
|
||||
jms hisinit
|
||||
lac pc
|
||||
lrs 6
|
||||
and o77
|
||||
tad histbuf
|
||||
dac t1
|
||||
isz t1 i
|
||||
jmp histog i
|
||||
jmp .
|
||||
|
||||
hisinit: 0
|
||||
-1
|
||||
tad hisinit
|
||||
dac hisinit
|
||||
-1
|
||||
dac hisinit i
|
||||
-64
|
||||
dac t1
|
||||
tad lastv
|
||||
dac lastv
|
||||
dac histbuf
|
||||
tad dm1
|
||||
dac 8
|
||||
1:
|
||||
dsm 8 i
|
||||
isz t1
|
||||
jmp 1b
|
||||
jmp hisinit i
|
||||
|
||||
histbuf: 0
|
||||
olddp: 0
|
||||
dspbuf: 0
|
||||
dspbp: 0
|
||||
instr: 0
|
||||
obs: 0
|
||||
inslitr: n 5
|
||||
insasg: b 1
|
||||
o17: 017
|
||||
d8: 8
|
||||
o77: 077
|
||||
o10000: 010000
|
||||
d5: 5
|
||||
o60: 060
|
||||
o7777: 07777
|
||||
o216000: 0216000
|
||||
o160020: 0160020
|
||||
o20: 020
|
||||
o164000: 0164000
|
||||
o17010: 017010
|
||||
o17700: 017700
|
||||
d2: 2
|
||||
|
||||
lacop: lac .
|
||||
a>;b>;c>;f>;n>;s>;t>;u>;x>;y>
|
||||
|
||||
badpc:
|
||||
jms flush
|
||||
lac d1
|
||||
sys write; mpc; mpcs
|
||||
jmp stop
|
||||
badsp:
|
||||
jms flush
|
||||
lac d1
|
||||
sys write; msp; msps
|
||||
jmp stop
|
||||
badasgn:
|
||||
jms flush
|
||||
lac d1
|
||||
sys write; mas; mass
|
||||
jmp stop
|
||||
mpc:
|
||||
012;<pc>;012
|
||||
mpcs = .-mpc
|
||||
msp:
|
||||
012;<sp>;012
|
||||
msps = .-msp
|
||||
mas:
|
||||
012;<as>;012
|
||||
mass = .-mas
|
||||
|
||||
octal: 0
|
||||
lmq
|
||||
lac d5
|
||||
tad octal i
|
||||
cma
|
||||
dac 2f
|
||||
sna
|
||||
jmp 3f
|
||||
1:
|
||||
llss 3
|
||||
isz 2f
|
||||
jmp 1b
|
||||
3:
|
||||
lac octal i
|
||||
dac 2f
|
||||
lacq
|
||||
dac 2f+1
|
||||
1:
|
||||
lac 2f+1
|
||||
lmq
|
||||
ecla llss 3
|
||||
tad o60
|
||||
jms putc
|
||||
lac 2f+1
|
||||
alss 3
|
||||
dac 2f+1
|
||||
isz 2f
|
||||
jmp 1b
|
||||
isz octal
|
||||
jmp octal i
|
||||
2: 0;0
|
||||
@@ -1,433 +0,0 @@
|
||||
" bi
|
||||
|
||||
start:
|
||||
jms initio
|
||||
-1
|
||||
tad .main
|
||||
dac pc
|
||||
|
||||
fetch:
|
||||
lac pc i
|
||||
lmq
|
||||
and o17777
|
||||
dac addr
|
||||
ecla lls 4
|
||||
tad .+3
|
||||
dac .+1
|
||||
jmp .. i
|
||||
jmp . i
|
||||
autop; binop; consop; ifop; etcop; setop; traop
|
||||
unaop; extop; aryop
|
||||
|
||||
|
||||
ifop:
|
||||
-2
|
||||
tad sp
|
||||
dac sp
|
||||
lac sp i
|
||||
dac t1
|
||||
lac t1 i
|
||||
sza
|
||||
jmp fetch
|
||||
-1
|
||||
tad addr i
|
||||
dac pc
|
||||
jmp fetch
|
||||
|
||||
autop:
|
||||
lac addr
|
||||
tad dp
|
||||
dac sp i
|
||||
isz sp
|
||||
isz sp
|
||||
jmp fetch
|
||||
|
||||
binop:
|
||||
-2
|
||||
tad sp
|
||||
dac sp
|
||||
tad dm1
|
||||
dac t4
|
||||
tad dm1
|
||||
dac t3
|
||||
lac t3 i
|
||||
dac t1
|
||||
lac sp i
|
||||
dac t2
|
||||
lac t4
|
||||
dac t3 i
|
||||
lac addr
|
||||
tad .+3
|
||||
dac .+1
|
||||
jmp .. i
|
||||
jmp . i
|
||||
basg; bor; band; beq; bne; ble; blt; bge; bgt; brsh; blsh
|
||||
badd; bmin; bmod; bmul; bdiv
|
||||
|
||||
basg:
|
||||
lac t2 i
|
||||
dac t1 i
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
bor:
|
||||
lac t1 i
|
||||
lmq
|
||||
lac t2 i
|
||||
omq
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
band:
|
||||
lac t1 i
|
||||
and t2 i
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
beq:
|
||||
lac t1 i
|
||||
xor t2 i
|
||||
sna cla
|
||||
lac d1
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
bne:
|
||||
lac t1 i
|
||||
xor t2 i
|
||||
sza
|
||||
lac d1
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
ble:
|
||||
lac t2 i
|
||||
cma
|
||||
tad t1 i
|
||||
spa cla
|
||||
lac d1
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
blt:
|
||||
lac t1 i
|
||||
cma
|
||||
tad t2 i
|
||||
sma cla
|
||||
lac d1
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
bge:
|
||||
lac t1 i
|
||||
cma
|
||||
tad t2 i
|
||||
spa cla
|
||||
lac d1
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
bgt:
|
||||
lac t2 i
|
||||
cma
|
||||
tad t1 i
|
||||
sma cla
|
||||
lac d1
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
brsh:
|
||||
blsh:
|
||||
hlt
|
||||
|
||||
badd:
|
||||
lac t1 i
|
||||
tad t2 i
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
bmin:
|
||||
lac t1 i
|
||||
cma
|
||||
tad t2 i
|
||||
cma
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
bmod:
|
||||
lac t2 i
|
||||
dac .+4
|
||||
lac t1 i
|
||||
cll; idiv; ..
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
bmul:
|
||||
lac t2 i
|
||||
dac .+4
|
||||
lac t1 i
|
||||
cll; mul; ..
|
||||
lacq
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
bdiv:
|
||||
lac t2 i
|
||||
dac .+4
|
||||
lac t1 i
|
||||
cll; idiv; ..
|
||||
lacq
|
||||
dac t4 i
|
||||
jmp fetch
|
||||
|
||||
consop:
|
||||
lac sp
|
||||
tad d1
|
||||
dac sp i
|
||||
isz sp
|
||||
lac addr
|
||||
dac sp i
|
||||
isz sp
|
||||
jmp fetch
|
||||
|
||||
etcop:
|
||||
lac addr
|
||||
tad .+3
|
||||
dac .+1
|
||||
jmp .. i
|
||||
jmp . i
|
||||
mcall; mark; call; vector; litrl; goto; retrn; escp
|
||||
|
||||
mcall:
|
||||
-2
|
||||
tad sp
|
||||
dac t1
|
||||
lac t1 i
|
||||
dac t2
|
||||
-1
|
||||
tad t2 i
|
||||
lmq
|
||||
lac dp
|
||||
dac t1 i
|
||||
lac t1
|
||||
dac dp
|
||||
isz t1
|
||||
lac pc
|
||||
dac t1 i
|
||||
lacq
|
||||
dac pc
|
||||
jmp fetch
|
||||
|
||||
mark:
|
||||
-1
|
||||
tad sp
|
||||
dac t2
|
||||
tad dm1
|
||||
dac t1
|
||||
lac t1 i
|
||||
dac t3
|
||||
lac t3 i
|
||||
dac t2 i
|
||||
lac ap
|
||||
dac t1 i
|
||||
lac t1
|
||||
dac ap
|
||||
jmp fetch
|
||||
|
||||
call:
|
||||
lac ap
|
||||
tad d1
|
||||
dac 8
|
||||
dac 9
|
||||
1:
|
||||
lac 8 i
|
||||
dac t1
|
||||
lac t1 i
|
||||
dac 9 i
|
||||
isz 8
|
||||
-1
|
||||
tad sp
|
||||
sad 8
|
||||
skp
|
||||
jmp 1b
|
||||
lac ap i
|
||||
lmq
|
||||
lac dp
|
||||
dac ap i
|
||||
lac ap
|
||||
dac dp
|
||||
isz ap
|
||||
-1
|
||||
tad ap i
|
||||
dac t1
|
||||
lac pc
|
||||
dac ap i
|
||||
lacq
|
||||
dac ap
|
||||
lac t1
|
||||
dac pc
|
||||
jmp fetch
|
||||
|
||||
vector:
|
||||
-2
|
||||
tad sp
|
||||
dac sp
|
||||
tad dm2
|
||||
dac t1
|
||||
lac sp i
|
||||
dac t2
|
||||
lac t1 i
|
||||
dac t3
|
||||
lac t3 i
|
||||
tad t2 i
|
||||
dac t1 i
|
||||
jmp fetch
|
||||
|
||||
litrl:
|
||||
lac sp
|
||||
tad d1
|
||||
dac sp i
|
||||
isz sp
|
||||
lac pc i
|
||||
dac sp i
|
||||
isz sp
|
||||
jmp fetch
|
||||
|
||||
goto:
|
||||
-2
|
||||
tad sp
|
||||
dac sp
|
||||
lac sp i
|
||||
dac t1
|
||||
-1
|
||||
tad t1 i
|
||||
dac pc
|
||||
jmp fetch
|
||||
|
||||
retrn:
|
||||
-2
|
||||
tad sp
|
||||
dac sp
|
||||
lac sp i
|
||||
dac t1
|
||||
lac t1 i
|
||||
lmq
|
||||
lac dp
|
||||
dac sp
|
||||
dac t1
|
||||
lac sp i
|
||||
sna
|
||||
jmp stop
|
||||
dac dp
|
||||
isz sp
|
||||
lac sp
|
||||
dac t1 i
|
||||
lac sp i
|
||||
dac pc
|
||||
lacq
|
||||
dac sp i
|
||||
isz sp
|
||||
jmp fetch
|
||||
|
||||
escp:
|
||||
law 2
|
||||
tad pc
|
||||
dac t1
|
||||
jmp t1 i
|
||||
|
||||
setop:
|
||||
lac addr
|
||||
tad dp
|
||||
dac sp
|
||||
jmp fetch
|
||||
|
||||
traop:
|
||||
-1
|
||||
tad addr
|
||||
dac pc
|
||||
jmp fetch
|
||||
|
||||
unaop:
|
||||
-1
|
||||
tad sp
|
||||
dac t3
|
||||
tad dm1
|
||||
dac t2
|
||||
lac t2 i
|
||||
dac t1
|
||||
lac t3
|
||||
dac t2 i
|
||||
lac addr
|
||||
tad .+3
|
||||
dac .+1
|
||||
jmp .. i
|
||||
jmp . i
|
||||
uadr; umin; uind; unot
|
||||
|
||||
uadr:
|
||||
lac t1
|
||||
dac t3 i
|
||||
jmp fetch
|
||||
|
||||
umin:
|
||||
-1
|
||||
tad t1 i
|
||||
cma
|
||||
dac t3 i
|
||||
jmp fetch
|
||||
|
||||
uind:
|
||||
lac t1 i
|
||||
dac t2 i
|
||||
jmp fetch
|
||||
|
||||
unot:
|
||||
lac t1 i
|
||||
sna cla
|
||||
lac d1
|
||||
dac t3 i
|
||||
jmp fetch
|
||||
|
||||
extop:
|
||||
lac addr
|
||||
dac sp i
|
||||
isz sp
|
||||
isz sp
|
||||
jmp fetch
|
||||
|
||||
aryop:
|
||||
lac addr
|
||||
tad dp
|
||||
dac t1
|
||||
tad d1
|
||||
dac t1 i
|
||||
jmp fetch
|
||||
|
||||
a = 040000
|
||||
b = a+a
|
||||
c = b+a
|
||||
f = c+a
|
||||
n = f+a
|
||||
s = n+a
|
||||
t = s+a
|
||||
u = t+a
|
||||
x = u+a
|
||||
y = x+a
|
||||
|
||||
d1: 1
|
||||
dm1: -1
|
||||
dm2: -2
|
||||
o17777: 017777
|
||||
|
||||
t1: 0
|
||||
t2: 0
|
||||
t3: 0
|
||||
t4: 0
|
||||
addr: 0
|
||||
|
||||
pc = 017
|
||||
|
||||
sp: stack
|
||||
dp: stack
|
||||
ap: stack
|
||||
stack: 0
|
||||
@@ -1,151 +0,0 @@
|
||||
" cat: cat [arg1 arg2 ...]
|
||||
|
||||
" Load the pointer pointer in 017777 to see if we have any arguments
|
||||
lac 017777 i
|
||||
sad d4 " Skip if we have more than four argument words
|
||||
jmp nofiles " Only four argument words, so no arguments
|
||||
lac 017777 " Move five words past the argument word count
|
||||
tad d1 " so that AC points at the first argument
|
||||
tad d4 " and save the pointer in name
|
||||
dac name
|
||||
|
||||
loop:
|
||||
sys open; name:0; 0 " Open file, get fd back
|
||||
spa
|
||||
jmp badfile " Negative fd, exit with an error message
|
||||
dac fi " Save file descriptor in fi
|
||||
|
||||
1:
|
||||
jms getc " Get a character in AC
|
||||
sad o4
|
||||
jmp 1f " Break the loop when we get a ctrl-D
|
||||
jms putc " Write the character on stdout
|
||||
jmp 1b " and loop back
|
||||
|
||||
1:
|
||||
lac fi " Close the file descriptor in fi
|
||||
sys close
|
||||
|
||||
loop1:
|
||||
-4
|
||||
tad 017777 i " Subtract 4 from the count of argument words
|
||||
dac 017777 i
|
||||
sad d4 " Is the value 4, i.e. no args left?
|
||||
jmp done " Yes, so exit
|
||||
|
||||
lac name " Still an argument, so move up
|
||||
tad d4 " to the next filename argument
|
||||
dac name
|
||||
jmp loop " and loop back to cat this file
|
||||
|
||||
badfile:
|
||||
lac name " Get the pointer to the filename
|
||||
dac 1f " Store it in 1f below
|
||||
lac d8 " Load fd 8 which is stderr
|
||||
sys write; 1:0; 4 " Write the four words of the filename
|
||||
lac d8
|
||||
sys write; 1f; 2 " and then write " ?\n"
|
||||
jmp loop1 " Now try doing the next argument
|
||||
|
||||
1: 040;077012 " String literal: " ?\n"
|
||||
|
||||
nofiles:
|
||||
lac d8
|
||||
sys write; 1f; 5 " Write "No files\n" to stderr
|
||||
sys exit " and exit
|
||||
|
||||
1: <no>; 040; <fi>;<le>;<s 012
|
||||
|
||||
done:
|
||||
lac noc " Is the number of characters left zero?
|
||||
sna
|
||||
sys exit " Yes, exit
|
||||
and d1
|
||||
sna cla
|
||||
jmp 1f
|
||||
jms putc " Store the character in the buffer
|
||||
jmp done " and loop back
|
||||
1:
|
||||
lac noc " Get the number of characters in the buffer
|
||||
rcr " Divide by two to convert to words
|
||||
dac 1f " Save in the write's word count below
|
||||
lac fo " Load fd 1, stdout
|
||||
sys write; iopt+1; 1:.. " Write the leftover buffer and exit
|
||||
sys exit
|
||||
|
||||
getc: 0
|
||||
lac ipt " Load the pointer to the next word in the buffer
|
||||
sad eipt
|
||||
jmp 1f " We've reached the end of the buffer, so read more
|
||||
dac 2f " Save the pointer
|
||||
add o400000 " Flip the msb and save into ipt
|
||||
dac ipt
|
||||
ral " Move the msb into the link register
|
||||
lac 2f i " Load the word from the buffer
|
||||
szl " Skip if this is the second character in the word
|
||||
lrss 9 " It's the first char, shift down the top character
|
||||
and o177 " Keep the lowest 7 bits
|
||||
sna
|
||||
jmp getc+1 " Skip a NUL characters and read another one
|
||||
jmp getc i " Return the character from the subroutine
|
||||
1:
|
||||
lac fi " Buffer is empty, read another 64 characters
|
||||
sys read; iipt+1; 64
|
||||
sna
|
||||
jmp 1f " No characters were read in
|
||||
tad iipt " Add the word count to the base of the buffer
|
||||
dac eipt " and store in the end buffer pointer
|
||||
lac iipt " Reset the ipt to the base of the buffer
|
||||
dac ipt
|
||||
jmp getc+1 " and loop back to get one character
|
||||
1:
|
||||
lac o4 " No character, return with ctrl-D
|
||||
jmp getc i " return from subroutine
|
||||
|
||||
putc: 0
|
||||
and o177 " Keep the lowest 7 bits and save into 2f+1
|
||||
dac 2f+1
|
||||
lac opt " Save the pointer to the empty buffer
|
||||
dac 2f " position to 2f
|
||||
add o400000 " Flip the msb and save back into opt
|
||||
dac opt " This also has the effect of incrementing
|
||||
" the opt pointer every second addition!
|
||||
|
||||
spa " If the bit was set, we already have one
|
||||
jmp 1f " character at 2f+1. If no previous character,
|
||||
lac 2f i " merge the old and new character together
|
||||
xor 2f+1
|
||||
jmp 3f " and go to the "save it in buffer" code
|
||||
1:
|
||||
lac 2f+1 " Move the character up into the top half
|
||||
alss 9
|
||||
3:
|
||||
dac 2f i " Save the word into the buffer
|
||||
isz noc " Add 1 to the char count, never skipping
|
||||
lac noc " Have we reached 128 characters, 64 words?
|
||||
sad d128
|
||||
skp
|
||||
jmp putc i " No, so return (more room still in the buffer)
|
||||
lac fo " Load fd1 (i.e stdout)
|
||||
sys write; iopt+1; 64 " and write out the 64 words in the buffer
|
||||
lac iopt
|
||||
dac opt " Set opt pointing back to base of buffer
|
||||
dzm noc " Set the number of chars in the buffer to 0
|
||||
jmp putc i " and return
|
||||
|
||||
2: 0;0 " Current input and output word pointers
|
||||
ipt: 0 " Current input buffer base
|
||||
eipt: 0 " Pointer to end of data read in input buffer
|
||||
iipt: .+1; .=.+64 " 64 word input buffer and pointer to it
|
||||
fi: 0 " Input file descriptor
|
||||
opt: .+2 " Current output buffer base
|
||||
iopt: .+1; .=.+64 " 64 word output buffer and pointer to it
|
||||
noc: 0 " Number of output characters
|
||||
fo: 1 " Output file descriptor, fd 1 is stdout
|
||||
|
||||
d1: 1 " Octal and decimal constants
|
||||
o4:d4: 4
|
||||
d8: 8
|
||||
o400000: 0400000 " Msb toggle bit
|
||||
o177: 0177 " ASCII mask
|
||||
d128: 128 " 128 words in the output buffer
|
||||
@@ -1,77 +0,0 @@
|
||||
" 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
|
||||
@@ -1,76 +0,0 @@
|
||||
" chown
|
||||
lac 017777 i
|
||||
sad d4
|
||||
jmp error
|
||||
|
||||
lac 017777
|
||||
tad d4
|
||||
dac 8
|
||||
tad d1
|
||||
dac name
|
||||
dzm octal
|
||||
dzm nochar
|
||||
-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 chowner; 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
|
||||
@@ -1,97 +0,0 @@
|
||||
" 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:
|
||||
@@ -1,256 +0,0 @@
|
||||
" 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
|
||||
@@ -1,501 +0,0 @@
|
||||
" ds
|
||||
|
||||
lac 017777 i
|
||||
sad d8
|
||||
skp
|
||||
sys exit
|
||||
lac 017777
|
||||
tad d5
|
||||
dac .+3
|
||||
law 017
|
||||
sys creat; ..
|
||||
dac fo
|
||||
law 017
|
||||
sys creat; scrname
|
||||
spa; jms error
|
||||
dac fso
|
||||
sys open; scrname; 0
|
||||
spa; jms error
|
||||
dac fsi
|
||||
sys chdir; dd
|
||||
spa; jms error
|
||||
lac d1
|
||||
sys write; pass1; 1
|
||||
law fsobuf
|
||||
dac fsopt
|
||||
dzm nfiles
|
||||
law fbuf
|
||||
dac filp
|
||||
dzm ndirs
|
||||
law dbuf
|
||||
dac dirp
|
||||
dzm fsloc
|
||||
sys open; dotdot; 0
|
||||
spa; jms error
|
||||
dac fd
|
||||
jms readdir; dotdot
|
||||
law statbuf
|
||||
sys status; dotdot; dotdot
|
||||
spa; jms error
|
||||
lac statbuf+12 " i index
|
||||
dac dirp i
|
||||
isz dirp
|
||||
-1
|
||||
tad nfiles
|
||||
cma
|
||||
dac ddfiles
|
||||
law fbuf
|
||||
dac ddfilp
|
||||
|
||||
loop:
|
||||
-1
|
||||
tad ndirs
|
||||
cma
|
||||
dac c1
|
||||
law dbuf
|
||||
dac i1
|
||||
|
||||
1:
|
||||
isz i1
|
||||
lac i1 i
|
||||
sad ddfilp i
|
||||
jmp 2f
|
||||
isz i1
|
||||
isz c1
|
||||
jmp 1b
|
||||
|
||||
lac ddfilp
|
||||
tad i1
|
||||
dac i1
|
||||
lac i1 i
|
||||
dac .+3
|
||||
lac fsi
|
||||
sys seek; ..; 0
|
||||
lac fsi
|
||||
sys read; scrname; 4
|
||||
law statbuf
|
||||
sys status; dotdot; scrname
|
||||
spa; jms error
|
||||
lac statbuf+0 " flags
|
||||
and o20
|
||||
sna
|
||||
jmp 2f
|
||||
sys open; scrname; 0
|
||||
spa; jms error
|
||||
dac fd
|
||||
jms readdir; scrname
|
||||
lac ddfilp i
|
||||
dac dirp i
|
||||
isz dirp
|
||||
|
||||
2:
|
||||
isz ddfilp
|
||||
isz ddfilp
|
||||
isz ddfiles
|
||||
jmp loop
|
||||
|
||||
" output phase
|
||||
|
||||
lac fso
|
||||
sys write; fsobuf; 64
|
||||
lac d1
|
||||
sys write; pass2; 2
|
||||
-500
|
||||
dac c1
|
||||
|
||||
1:
|
||||
law dbuf+2
|
||||
dac i1
|
||||
dzm fflg
|
||||
law fbuf
|
||||
dac i2
|
||||
r1
|
||||
tad nfiles
|
||||
cma
|
||||
dac c2
|
||||
|
||||
2:
|
||||
lac c1
|
||||
tad d501
|
||||
sad i2 i
|
||||
skp
|
||||
jmp 3f
|
||||
-1
|
||||
tad i1
|
||||
dac i3
|
||||
iac i3 i
|
||||
dac c3
|
||||
law fbuf
|
||||
dac i3
|
||||
0:
|
||||
lac i3 i
|
||||
sad c3
|
||||
jmp 0f
|
||||
isz i3
|
||||
isz i3
|
||||
jmp 0b
|
||||
0:
|
||||
lac i3
|
||||
tad d1
|
||||
dac c3
|
||||
lac c3 i
|
||||
dac .+3
|
||||
lac fsi
|
||||
sys seek; ..; 0
|
||||
lac fsi
|
||||
sys read; scrname; 4
|
||||
lac i2
|
||||
tad d1
|
||||
dac c3
|
||||
lac c3 i
|
||||
dac .+3
|
||||
lac fsi
|
||||
sys seek; ..; 0
|
||||
lac fsi
|
||||
sys read; dd; 4
|
||||
lac fflg
|
||||
sza
|
||||
jmp 0f
|
||||
|
||||
lac nlinkt
|
||||
sad nlinka
|
||||
skp
|
||||
jms fishy
|
||||
dzm nlinka
|
||||
law 012
|
||||
jms putc
|
||||
law statbuf
|
||||
sys status; scrname; dd
|
||||
spa; jms error
|
||||
-1
|
||||
tad statbuf+9
|
||||
cma
|
||||
dac nlinkt
|
||||
-1
|
||||
dac fflg
|
||||
jms longout
|
||||
law 012
|
||||
jms putc
|
||||
0:
|
||||
isz nlinka
|
||||
jms putname; scrname
|
||||
jms putname; dd
|
||||
law 012
|
||||
jms putc
|
||||
|
||||
3:
|
||||
isz i2
|
||||
isz i2
|
||||
lac i2
|
||||
sad i1 i
|
||||
skp
|
||||
jmp .+3
|
||||
isz i1
|
||||
isz i1
|
||||
isz c2
|
||||
jmp 2b
|
||||
|
||||
isz c1
|
||||
jmp 1b
|
||||
lac nlinkt
|
||||
sad nlinka
|
||||
skp
|
||||
jms fishy
|
||||
|
||||
sys chdir; system
|
||||
jmp done
|
||||
|
||||
fishy: 0
|
||||
jms asters
|
||||
jms asters
|
||||
law 012
|
||||
jms putc
|
||||
lac d1
|
||||
sys write; 1f; 1
|
||||
jmp fishy i
|
||||
1: 052012
|
||||
|
||||
nlinka: 0
|
||||
nlinkt: 0
|
||||
|
||||
asters: 0
|
||||
-10
|
||||
dac c
|
||||
1:
|
||||
law 052
|
||||
jms putc
|
||||
isz c
|
||||
jmp 1b
|
||||
jmp asters i
|
||||
|
||||
longout: 0
|
||||
lac statbuf+12 " i
|
||||
jms octal; -3
|
||||
lac statbuf+0 " flags
|
||||
jms octal; -2
|
||||
lac statbuf+8 " uid
|
||||
jms octal; -2
|
||||
-1
|
||||
tad statbuf+9 " nlinks
|
||||
cma
|
||||
jms octal; -2
|
||||
lac statbuf+10
|
||||
jms octal; -5
|
||||
jmp longout i
|
||||
|
||||
readdir: 0
|
||||
law 012
|
||||
jms putc
|
||||
law 012
|
||||
jms putc
|
||||
jms asters
|
||||
lac readdir i
|
||||
dac 5f
|
||||
dac .+2
|
||||
jms putname; ..
|
||||
jms asters
|
||||
law 012
|
||||
jms putc
|
||||
law 012
|
||||
jms putc
|
||||
isz readdir
|
||||
isz ndirs
|
||||
lac filp
|
||||
dac dirp i
|
||||
isz dirp
|
||||
0:
|
||||
jms copyz; buf; 64
|
||||
lac fd
|
||||
sys read; buf; 64
|
||||
spa; jms error
|
||||
sna
|
||||
jmp 4f
|
||||
-8
|
||||
dac c1
|
||||
law buf
|
||||
dac i1
|
||||
1:
|
||||
lac i1 i
|
||||
sna
|
||||
jmp 3f
|
||||
|
||||
isz nfiles
|
||||
dac filp i
|
||||
isz filp
|
||||
lac fsloc
|
||||
dac filp i
|
||||
tad d4
|
||||
dac fsloc
|
||||
isz filp
|
||||
lac i1
|
||||
tad d1
|
||||
dac .+4
|
||||
law statbuf
|
||||
sys status; 5:..; ..
|
||||
spa; jms error
|
||||
jms longout
|
||||
lac i1
|
||||
tad d1
|
||||
dac .+2
|
||||
jms putname; ..
|
||||
law 012
|
||||
jms putc
|
||||
lac i1
|
||||
dac 8
|
||||
lac 8 i
|
||||
dac fsopt i
|
||||
isz fsopt
|
||||
lac 8 i
|
||||
dac fsopt i
|
||||
isz fsopt
|
||||
lac 8 i
|
||||
dac fsopt i
|
||||
isz fsopt
|
||||
lac 8 i
|
||||
dac fsopt i
|
||||
isz fsopt
|
||||
law fsobuf+64
|
||||
sad fsopt
|
||||
skp
|
||||
jmp 3f
|
||||
lac fso
|
||||
sys write; fsobuf; 64
|
||||
law fsobuf
|
||||
dac fsopt
|
||||
|
||||
3:
|
||||
law 8
|
||||
tad i1
|
||||
dac i1
|
||||
isz c1
|
||||
jmp 1b
|
||||
jmp 0b
|
||||
4:
|
||||
lac fd
|
||||
sys close
|
||||
jmp readdir i
|
||||
|
||||
putname: 0
|
||||
-1
|
||||
tad putname i
|
||||
dac 8
|
||||
-4
|
||||
dac c
|
||||
1:
|
||||
lac 8 i
|
||||
lrss 9
|
||||
jms putc
|
||||
llss 9
|
||||
jms putc
|
||||
isz c
|
||||
jmp 1b
|
||||
isz putname
|
||||
jmp putname i
|
||||
|
||||
octal: 0
|
||||
lmq
|
||||
lac d5
|
||||
tad octal i
|
||||
cma
|
||||
dac c
|
||||
1:
|
||||
llss 3
|
||||
isz c
|
||||
jmp 1b
|
||||
lac octal i
|
||||
dac c
|
||||
1:
|
||||
ecla llss 3
|
||||
tad o60
|
||||
jms putc
|
||||
isz c
|
||||
jmp 1b
|
||||
law 040
|
||||
jms putc
|
||||
isz octal
|
||||
jmp octal i
|
||||
|
||||
error: 0
|
||||
-1
|
||||
tad error
|
||||
hlt
|
||||
sys save
|
||||
|
||||
copyz: 0
|
||||
-1
|
||||
tad copyz i
|
||||
dac 8
|
||||
isz copyz
|
||||
-1
|
||||
tad copyz i
|
||||
cma
|
||||
dac 2f
|
||||
isz copyz
|
||||
1:
|
||||
dzm 8 i
|
||||
isz 2f
|
||||
jmp 1b
|
||||
jmp copyz i
|
||||
2: 0
|
||||
|
||||
done:
|
||||
lac noc
|
||||
sna
|
||||
sys exit
|
||||
and d1
|
||||
sna cla
|
||||
jmp 1f
|
||||
jms putc
|
||||
jmp done
|
||||
1:
|
||||
lac noc
|
||||
rcr
|
||||
dac 1f
|
||||
lac fo
|
||||
sys write; obuf; 1;..
|
||||
sys exit
|
||||
|
||||
putc: 0
|
||||
and o177
|
||||
dac 2f+1
|
||||
lac opt
|
||||
dac 2f
|
||||
add o400000
|
||||
dac opt
|
||||
spa
|
||||
jmp 1f
|
||||
lac 2f i
|
||||
xor 2f+1
|
||||
jmp 3f
|
||||
1:
|
||||
lac 2f+1
|
||||
alss 9
|
||||
3:
|
||||
dac 2f i
|
||||
isz noc
|
||||
lac noc
|
||||
sad d128
|
||||
skp
|
||||
jmp putc i
|
||||
lac fo
|
||||
sys write; obuf; 64
|
||||
lac iopt
|
||||
dac opt
|
||||
dzm noc
|
||||
jmp putc i
|
||||
2: 0;0
|
||||
opt: obuf
|
||||
iopt: obuf
|
||||
noc: 0
|
||||
fo: 1
|
||||
|
||||
d1: 1
|
||||
o177: 0177
|
||||
o400000: 0400000
|
||||
d128: 128
|
||||
d4: 4
|
||||
d5: 5
|
||||
d8: 8
|
||||
o60: 060
|
||||
o20: 020
|
||||
d501: 501
|
||||
|
||||
dd:
|
||||
<dd>; 040040; 040040; 040040
|
||||
dotdot:
|
||||
056056; 040040; 040040; 040040
|
||||
system:
|
||||
<sy>;<st>;<em>; 040040
|
||||
scrname:
|
||||
<*s>;<rc>;040040;040040
|
||||
pass2:
|
||||
<i
|
||||
pass1:
|
||||
<i 012
|
||||
|
||||
fso: .=.+1
|
||||
fsi: .=.+1
|
||||
fsloc: .=.+1
|
||||
nfiles: .=.+1
|
||||
fflg: .=.+1
|
||||
buf: .=.+64
|
||||
obuf: .=.+64
|
||||
fd: .=.+1
|
||||
filp: .=.+1
|
||||
ddfilp: .=.+1
|
||||
ddfiles: .=.+1
|
||||
statbuf: .=.+13
|
||||
c: .=.+1
|
||||
i1: .=.+1
|
||||
i2: .=.+1
|
||||
i3: .=.+1
|
||||
c1: .=.+1
|
||||
c2: .=.+1
|
||||
c3: .=.+1
|
||||
ndirs: .=.+1
|
||||
dirp: .=.+1
|
||||
fsopt: .=.+1
|
||||
fsobuf: .=.+64
|
||||
dbuf: .=.+100
|
||||
fbuf:
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
" dsksav
|
||||
|
||||
iof
|
||||
hlt
|
||||
dzm track
|
||||
-640
|
||||
dac c1
|
||||
1:
|
||||
lac track
|
||||
jms dskrd1
|
||||
|
||||
lac track
|
||||
jms dskwr0
|
||||
|
||||
lac track
|
||||
tad d10
|
||||
dac track
|
||||
isz c1
|
||||
jmp 1b
|
||||
|
||||
hlt
|
||||
sys exit
|
||||
|
||||
track: 0
|
||||
c1: 0
|
||||
d10: 10
|
||||
@@ -1,771 +0,0 @@
|
||||
"** 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
|
||||
@@ -1,519 +0,0 @@
|
||||
"** 08-rest.pdf page 21
|
||||
"[handwritten page number top right of scan - 14]
|
||||
" ed2
|
||||
|
||||
cs:
|
||||
jsm getsc; tal
|
||||
sad o40
|
||||
jmp cs
|
||||
sad o12
|
||||
jmp error
|
||||
dac delim
|
||||
jms compile
|
||||
lac tbufp
|
||||
dac tal1
|
||||
1:
|
||||
jms getsc; tal
|
||||
sad delim
|
||||
jmp 1f
|
||||
sad o12
|
||||
jmp error
|
||||
jms putsc; tal1
|
||||
jmp 1b
|
||||
1:
|
||||
lac o12
|
||||
jms putsc; tal1
|
||||
jms newline
|
||||
jms setdd
|
||||
lac addr1
|
||||
sad zerop
|
||||
jmp error
|
||||
1:
|
||||
dac addr1
|
||||
lac i addr1
|
||||
jms execute
|
||||
jmp 2f
|
||||
lac addr1
|
||||
dac dot
|
||||
law line-1
|
||||
dac 8
|
||||
law nlist-1
|
||||
dac 9
|
||||
-64
|
||||
dac c1
|
||||
3:
|
||||
lac i 8
|
||||
dac i 9
|
||||
isz c1
|
||||
jmp 3b
|
||||
-1
|
||||
tad fchrno
|
||||
dac linsiz
|
||||
rcr
|
||||
szl
|
||||
xor o400000
|
||||
tad linep
|
||||
dac tal1 "???
|
||||
lac tbufp
|
||||
dac tal
|
||||
3:
|
||||
jms getsc; tal
|
||||
sad o12
|
||||
jmp 3f
|
||||
jms putsc; tal1
|
||||
isz linsiz "???
|
||||
"** 08-rest.pdf page 22
|
||||
"[handwritten page number top right of scan - 15]
|
||||
jmp 3b
|
||||
3:
|
||||
-1
|
||||
tad lcrhno
|
||||
rcr
|
||||
szl
|
||||
xor o400000
|
||||
tad nlistp
|
||||
dac tal
|
||||
3:
|
||||
jms getsc; tal
|
||||
jms putsc; tal1
|
||||
isz linsiz
|
||||
sad o12
|
||||
skp
|
||||
jmp 3b
|
||||
jms addline
|
||||
2:
|
||||
lac addr1
|
||||
sad addr2
|
||||
jmp advanc
|
||||
tad d1
|
||||
jmp 1b
|
||||
|
||||
fsrch:
|
||||
dac delim
|
||||
jms compile
|
||||
jms srcsav
|
||||
lac dot
|
||||
floop:
|
||||
tad d1
|
||||
dac addr
|
||||
lac i addr
|
||||
sza
|
||||
jmp 1f
|
||||
lac zerop
|
||||
dac addr
|
||||
jmp 2f
|
||||
1:
|
||||
jms execute
|
||||
jmp 2f
|
||||
jms srcres
|
||||
jmp ad1
|
||||
2:
|
||||
lac addr
|
||||
sad dot
|
||||
jmp error
|
||||
jmp floop
|
||||
|
||||
bsrch:
|
||||
dac delim
|
||||
jms compile
|
||||
jms srcsav
|
||||
lac dot
|
||||
dad zerop
|
||||
lac eofp
|
||||
bloop:
|
||||
tad dm1
|
||||
dac addr
|
||||
lac i addr
|
||||
"** 08-rest.pdf page 23
|
||||
"[handwritten page number top right of scan - 16]
|
||||
sza
|
||||
jmp 1f
|
||||
lac eofp
|
||||
dac addr
|
||||
jmp 2f
|
||||
1:
|
||||
jms execute
|
||||
jmp 2f
|
||||
jms srcres
|
||||
jmp ad1
|
||||
2:
|
||||
lac addr
|
||||
sad dot
|
||||
jmp error
|
||||
jmp bloop
|
||||
|
||||
srcsav: 0
|
||||
lac minflg
|
||||
sza
|
||||
jmp error
|
||||
lac addr
|
||||
sma
|
||||
jmp error
|
||||
law line-1
|
||||
dac 8
|
||||
law tbuf-1
|
||||
dac 9
|
||||
-64
|
||||
dac c1
|
||||
1:
|
||||
lac i 8
|
||||
dac i 9
|
||||
isz c1
|
||||
jmp 1b
|
||||
jmp i srcsav
|
||||
|
||||
srcres: 0
|
||||
law tbuf-1
|
||||
dac 8
|
||||
law line-1
|
||||
dac 9
|
||||
-64
|
||||
dac c1
|
||||
1:
|
||||
lac i 8
|
||||
dac i 9
|
||||
isz c1
|
||||
jmp 1b
|
||||
jmp i srcres
|
||||
|
||||
compile: 0
|
||||
law compbuf-1
|
||||
dac 8
|
||||
dzm prev
|
||||
dzm compflg
|
||||
|
||||
cadvanc:
|
||||
jms getsc; tal
|
||||
sad delim
|
||||
jmp cdone
|
||||
dac compflg "???
|
||||
"** 08-rest.pdf page 24
|
||||
"[handwritten page number top right of scan - 17]
|
||||
dzm lastre
|
||||
sad o12
|
||||
jmp error
|
||||
"sad o133
|
||||
"jmp chrcls
|
||||
sad o136 "???
|
||||
jmp beglin
|
||||
sad o44
|
||||
jmp endlin
|
||||
"sad o52
|
||||
"jmp clsure
|
||||
dac 1f
|
||||
jmp comp
|
||||
1; jms matchar; 1: 0; 0
|
||||
jmp cadvanc
|
||||
|
||||
cdone:
|
||||
lac compflg
|
||||
sna
|
||||
jmp 1f
|
||||
dac lastre
|
||||
jms comp
|
||||
1; jms found; 0
|
||||
jmp i compile
|
||||
1: "???
|
||||
lac lastre
|
||||
sna
|
||||
jmp error
|
||||
jmp i compile
|
||||
|
||||
chrcls:
|
||||
jmp error
|
||||
|
||||
beglin: "???
|
||||
jms comp
|
||||
1; jms matbol; 0
|
||||
dzm prev
|
||||
jmp cadvanc
|
||||
|
||||
endlin: "???
|
||||
jms comp
|
||||
1; jms mateol; 0
|
||||
dzm prev
|
||||
jmp cadvanc
|
||||
|
||||
clsure:
|
||||
lac prev
|
||||
sna
|
||||
jmp error
|
||||
tad d1
|
||||
dac 1f
|
||||
jms comp
|
||||
1; jms matclo; 1: 0; 0
|
||||
dzm prev
|
||||
jmp cadvanc
|
||||
|
||||
comp: 0 "???
|
||||
-1
|
||||
tad comp
|
||||
dac 9
|
||||
lac 8 "???
|
||||
"** 08-rest.pdf page 25
|
||||
"[handwritten page number top right of scan - 18]
|
||||
dac prev
|
||||
1: "???
|
||||
lac i 9
|
||||
sna
|
||||
jmp i 9
|
||||
dac i 8
|
||||
jmp 1b
|
||||
|
||||
execute: 0
|
||||
jms gline
|
||||
lac linep
|
||||
dac tal1
|
||||
dzm charno
|
||||
dzm fchrno
|
||||
dzm lchrno
|
||||
lac jmpclist
|
||||
dac trvect
|
||||
lac jmpnlist
|
||||
dac trvect+1
|
||||
lac jmpxchg
|
||||
dac i trvect+1
|
||||
jmp 1f
|
||||
|
||||
exchg: "???
|
||||
lacq
|
||||
sad o12
|
||||
jmp i execute
|
||||
lac jmpxchg
|
||||
dac i 8
|
||||
1: "???
|
||||
lac trvect
|
||||
lmq
|
||||
lac trvect+1
|
||||
dac trvect
|
||||
lacq
|
||||
dac trvect+1
|
||||
tad dm1
|
||||
dac 8
|
||||
jms getsc; tal1
|
||||
lmq
|
||||
isz charno
|
||||
jms compbuf
|
||||
charno:
|
||||
0
|
||||
trvect:
|
||||
0;0
|
||||
|
||||
matchar: 0 "???
|
||||
-2
|
||||
tad matchar
|
||||
dac exret
|
||||
lac i exret
|
||||
dac exret
|
||||
lacq
|
||||
sad i matchar
|
||||
skp
|
||||
jmp 1f
|
||||
lac matchar
|
||||
adn o17777
|
||||
tad jms1
|
||||
dac i 8 "??? [unreadable page cutoff]
|
||||
"** 08-rest.pdf page 26
|
||||
"[handwritten page number top right of scan - 19]
|
||||
lac i exret
|
||||
dac i 8
|
||||
1: "???
|
||||
isz exret
|
||||
jmp i exret
|
||||
|
||||
found: 0
|
||||
-2
|
||||
tad found
|
||||
dac exret
|
||||
lac i exret
|
||||
dac exret
|
||||
lac fchrno
|
||||
sza
|
||||
jmp 1f
|
||||
isz execute
|
||||
jmp 2f
|
||||
1: "???
|
||||
sad i exret
|
||||
jmp 1f
|
||||
cma
|
||||
tad i exret
|
||||
spa
|
||||
jmp 2f
|
||||
jmp 3f
|
||||
1: "???
|
||||
lac charno
|
||||
cma
|
||||
tad charno
|
||||
spa
|
||||
jmp 3f
|
||||
2: "???
|
||||
lac i exret
|
||||
dac fchrno
|
||||
lac charno
|
||||
dac lchrno
|
||||
3: "???
|
||||
isz exret
|
||||
jmp i exret
|
||||
|
||||
matbol: 0 "???
|
||||
lac charno
|
||||
sad d1
|
||||
jmp 1f
|
||||
lac matbol
|
||||
jmp 2f
|
||||
1: "???
|
||||
lac matbol
|
||||
jmp 3f
|
||||
|
||||
mateol: 0 "???
|
||||
lacq
|
||||
sad o12
|
||||
jmp 1f
|
||||
lac mateol
|
||||
2: "???
|
||||
tad dm2
|
||||
dac exret
|
||||
lac i exret
|
||||
dac 9
|
||||
"??? [line is cut off in scan, maybe lac i 8 or jmp i 9]
|
||||
"** 08-rest.pdf page 27
|
||||
"[handwritten page number top right of scan - 20]
|
||||
1: "???
|
||||
lac mateol
|
||||
3: "???
|
||||
tad dm3
|
||||
dac 9
|
||||
lac i 9
|
||||
isz 9
|
||||
dac i 9
|
||||
jmp i 9
|
||||
|
||||
matclo: 0 "???
|
||||
-2
|
||||
tad matclo
|
||||
dac exret
|
||||
lac i exret
|
||||
dac cloret
|
||||
lac i cloret
|
||||
dac 1f
|
||||
dac 2f
|
||||
lac i matclo
|
||||
dac exret
|
||||
jms i exret; 1: 0
|
||||
isz matclo
|
||||
jms i matclo; 2: 0
|
||||
isz cloret
|
||||
jmp i cloret
|
||||
|
||||
"??? the remainder of this scan had an unreadable first character
|
||||
"??? I did the best I could to recreate the characters appropriately
|
||||
o1: 1
|
||||
o133: 0133
|
||||
dm3: -3
|
||||
o136: 0136
|
||||
dm2: -2
|
||||
o52: 052
|
||||
o57: 057
|
||||
o77: 077
|
||||
o40: 040
|
||||
o12: 012
|
||||
d47: 47
|
||||
d58: 58
|
||||
dm48: -48
|
||||
d10: 10
|
||||
d8: 8
|
||||
d48: o60: 060
|
||||
d100000: 100000
|
||||
o44: 044
|
||||
o53: 053
|
||||
o56: 056
|
||||
o55: 055
|
||||
o11: 011
|
||||
o400000: 0400000
|
||||
o17777: 017777
|
||||
o144: 0144
|
||||
dm1: -1
|
||||
o56012: 056012
|
||||
o777: 0777
|
||||
o100: 0100
|
||||
o43: 043
|
||||
o777000: 0777000
|
||||
o75: 075
|
||||
o167: 0167
|
||||
o161: 0161
|
||||
"** 08-rest.pdf page 28
|
||||
"[handwritten page number top right of scan - 21]
|
||||
o160: 0160
|
||||
o143: 0143
|
||||
o141: 0141
|
||||
o1777: 01777
|
||||
d1024: 1024
|
||||
o776000: 0776000
|
||||
o162: 0162
|
||||
o163: 0163
|
||||
o73: 073
|
||||
o54: 054
|
||||
o17: 017
|
||||
|
||||
tname:
|
||||
0145056;0164155;0160040;040040
|
||||
tbufp: tbuf
|
||||
linep: line
|
||||
nlistp: nlist
|
||||
fbufp: fbuf
|
||||
dskbfp: dskbuf "[line crossed out - scan markup]
|
||||
edskbfp: dskbuf+1024 "[line crossed out - scan markup]
|
||||
lnodp: lnodes
|
||||
linpm1: line-1
|
||||
jmpclist: jmp clist
|
||||
jmpnlist: jmp nlist
|
||||
jmpxchg: jmp xchg
|
||||
jms1: jms 1
|
||||
tal: .=.+1
|
||||
exret: .=.+1
|
||||
cloret: .=.+1
|
||||
delim: .=.+1
|
||||
prev: .=.+1
|
||||
compflg: .=.+1
|
||||
tal1: .=.+1
|
||||
c1: .=.+1
|
||||
ital: .=.+1
|
||||
otal: .=.+1
|
||||
diskin: .=.+1
|
||||
glint: .=.+1
|
||||
c2: .=.+1
|
||||
num: .=.+1
|
||||
zermp: .=.+1
|
||||
minflg: .=.+1
|
||||
adrflg: .=.+1
|
||||
dot: .=.+1
|
||||
addr: .=.+1
|
||||
addr1: .=.+1
|
||||
addr2: .=.+1
|
||||
eofp: .=.+1
|
||||
zerop: .=.+1
|
||||
dskadr: .=.+1
|
||||
linsiz: .=.+1
|
||||
tfi: .=.+1
|
||||
fchrno: .=.+1
|
||||
lchrno: .=.+1
|
||||
lastre: .=.+1
|
||||
bett1: .=.+1
|
||||
bett2: .=.+1
|
||||
wrflg: .=.+1
|
||||
apt1: .=.+1
|
||||
"[page cuts off one label]
|
||||
"** 08-rest.pdf page 29
|
||||
"[handwritten page number top right of scan - 22]
|
||||
sfo: .=.+1
|
||||
sctal: .=.+1
|
||||
sctalp: .=.+1
|
||||
char: .=.+1
|
||||
fbuf: .=.+4 "not sure if this is fbuf, but
|
||||
tbuf: .=.+64 "there is a write; tbuf; 64 call
|
||||
line: .=.+64
|
||||
nlist: .=.+50
|
||||
"??? ?list: .=.+50, unable to determine label
|
||||
compbuf: .=.+100
|
||||
dskbuf: .=.+1 "[line crossed out - scan markup]
|
||||
lnodes: .=.+1000
|
||||
@@ -1,291 +0,0 @@
|
||||
" 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
|
||||
@@ -1,209 +0,0 @@
|
||||
" S1
|
||||
|
||||
.. = 0
|
||||
t = 0
|
||||
orig:
|
||||
hlt " overwritten with interrupt return addr
|
||||
jmp pibreak " dispatch to interrupt processing
|
||||
|
||||
. = orig+7
|
||||
-1 " only ever set (to -1): never read?!
|
||||
|
||||
. = orig+020 " syscall (CAL) processing
|
||||
1f " addr for "CAL I": store return here on "CAL"
|
||||
iof " interrupts off
|
||||
dac u.ac " save user AC
|
||||
lac 020 " save user return addr
|
||||
dac 1f " save as if "CAL I"
|
||||
lac 1f-1
|
||||
dac 020 " restore location 20
|
||||
lac u.ac " restore user AC
|
||||
jmp 1f+1 " join "CAL I" processing
|
||||
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 " here to start kernel
|
||||
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 " pending interrupt?
|
||||
skp " no
|
||||
jmp .save " yes: 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
|
||||
|
||||
" scheduler / idle loop
|
||||
swap: 0
|
||||
ion
|
||||
1:
|
||||
jms lookfor; 3 " out/ready
|
||||
jmp 1f
|
||||
jms lookfor; 1 " in/ready
|
||||
skp
|
||||
jmp 1b " loop until a process becomes ready
|
||||
dzm maxquant " here with in/ready (self?)
|
||||
jmp 3f
|
||||
1: " here with out/ready process
|
||||
dac 9f+t " save process pointer (swapped out) in t0
|
||||
jms lookfor; 2 " in/notready " find a swapped in process to swap out?
|
||||
jmp 1f
|
||||
jms lookfor; 1 " in/ready
|
||||
jmp 1f
|
||||
jmp 2f
|
||||
1:
|
||||
lac swap
|
||||
dac u.swapret " return to scheduler when swapped back
|
||||
iof
|
||||
lac o200000 " change status to swapped out
|
||||
tad u.ulistp i
|
||||
dac u.ulistp i
|
||||
ion
|
||||
jms dskswap; 07000 " swap process out
|
||||
lac u.dspbuf
|
||||
sna
|
||||
jmp 2f
|
||||
law dspbuf
|
||||
jms movdsp
|
||||
2:
|
||||
iof " disable interrupts
|
||||
lac o600000 " change status (1->7?)
|
||||
tad 9f+t i
|
||||
dac 9f+t i
|
||||
ion " enable interrupts
|
||||
jms dskswap; 06000 " read process in?
|
||||
lac u.swapret " set our return addr
|
||||
dac swap " to saved return addr
|
||||
lac o20 " reset maxquant to 16 ticks
|
||||
dac maxquant
|
||||
lac u.dspbuf
|
||||
sza " using display?
|
||||
"** 01-s1.pdf page 4
|
||||
jms movdsp " yes.
|
||||
3:
|
||||
dzm uquant " no. reset process tick count
|
||||
iof
|
||||
jmp swap i " return
|
||||
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!
|
||||
|
||||
" AC/ new value for intflg (non-zero to ignore interrupt char)
|
||||
" sys intrp
|
||||
.intrp:
|
||||
lac u.ac
|
||||
dac u.intflg
|
||||
jmp okexit
|
||||
|
||||
" syscall to retrieve system addresses (data & routines!!)
|
||||
" AC/ index (1..17)
|
||||
" sys sysloc
|
||||
" AC/ address (or -1 on bad index)
|
||||
.sysloc:
|
||||
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 addresses for sysloc
|
||||
lac .
|
||||
iget; inode; userdata; sysdata; copy; copyz; betwen; dskrd
|
||||
dskwr; dskbuf; dpdata; namei; pbsflgs; alloc; free; dspdata
|
||||
crdata
|
||||
locn:
|
||||
.-locsw-1
|
||||
|
||||
" check if interrupt for user
|
||||
" checks .int1 and .int2 (contain i-number of interrupt source)
|
||||
" call:
|
||||
" .insys/ 0
|
||||
" jms chkint
|
||||
" no: no interrupt, or intflg set (discards interupt)
|
||||
" yes: PI off, .insys set
|
||||
chkint: 0
|
||||
lac .insys
|
||||
sza " in system?
|
||||
jmp chkint i " yes: return
|
||||
lac .int1 " get inumber of interrupt1 source?
|
||||
sna " zero?
|
||||
jmp 1f " yes: skip stdin check
|
||||
sad u.ofiles+2 " non-zero: compare to stdin inumber
|
||||
jmp 2f " same
|
||||
1:
|
||||
lac .int2 " get inum of interrupt 2 source?
|
||||
sna " zero?
|
||||
jmp chkint i " yes: return
|
||||
sad u.ofiles+2 " non-zero: compare to stdin inumber
|
||||
skp " match!
|
||||
jmp chkint i " no match: return
|
||||
dzm .int2 " clear int2 source
|
||||
jmp 1f
|
||||
2:
|
||||
dzm .int1 " clear int1 source
|
||||
1:
|
||||
"** 01-s1.pdf page 5
|
||||
lac u.intflg " get user intflg
|
||||
sza " zero?
|
||||
jmp chkint i " no: ignore
|
||||
-1
|
||||
dac .insys " set "in system" flag
|
||||
ion " enable interrupts
|
||||
isz chkint " give skip return
|
||||
jmp chkint i
|
||||
|
||||
@@ -1,344 +0,0 @@
|
||||
"** 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 " save mode bits for access
|
||||
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 " mode bit 1 (write?)
|
||||
dac mode " save for access call
|
||||
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 " mode bit 1 (write?)
|
||||
dac mode " save for access call
|
||||
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 system call
|
||||
" sys open; filename_ptr; flags (0 for read, 1 for write)
|
||||
" returns w/ "fd" in AC (or -1 if not found)
|
||||
.open:
|
||||
jms arg " get filename
|
||||
dac 0f " save for namei
|
||||
jms arg " get flags
|
||||
sza " zero (read)
|
||||
lac d1 " no: get write mode bit
|
||||
sna " non-zero (write)?
|
||||
lac d2 " no: get read mode bot
|
||||
dac mode " save for access call
|
||||
lac u.cdir " get current working directory
|
||||
jms namei; 0:0 " search for file
|
||||
jms error " error: return -1
|
||||
jms iget " load inode
|
||||
jms access " check access (may return w/ error to user)
|
||||
lac i.flags " get file flags
|
||||
and o20 " get directory bit
|
||||
sna " is directory?
|
||||
jmp open1 " no, join common code
|
||||
lac mode " get access mode
|
||||
and d1 " get write bit
|
||||
sna " write access?
|
||||
jmp open1 " no, continue
|
||||
lac u.uid " yes: get uid?
|
||||
sma " negative? (-1 is superuser)
|
||||
jms error " no: return error
|
||||
jmp open1 " yes: join common code
|
||||
|
||||
.creat:
|
||||
lac d1 " mode bit 1 (write)
|
||||
dac mode " save for access call
|
||||
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 " get access bits from user AC (zero for lock!)
|
||||
and o17 " mask to permissions
|
||||
jms icreat
|
||||
open1: " common exit for open/creat
|
||||
jms fassign " assign fd slot
|
||||
jms error " none free, return -1
|
||||
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 " get inode flags
|
||||
and o40 " get special file bit
|
||||
sna " special?
|
||||
jmp 1f " no
|
||||
iof " yes: disable interrupts
|
||||
lac ii " get i number
|
||||
tad swr " get read routine table addr
|
||||
dac .+1
|
||||
jmp .. i " dispatch to read routine
|
||||
1:
|
||||
lac u.base " get user base
|
||||
dac 1f+1 " save as iread base
|
||||
lac u.count " get user count
|
||||
dac 1f+2 " save as iread count
|
||||
lac f.badd " get file offset
|
||||
1:
|
||||
jms iread; ..; ..
|
||||
jmp exitrw
|
||||
|
||||
" write system call:
|
||||
" AC/ fd
|
||||
" sys write; buffer; count
|
||||
" AC/ count or -1 on error
|
||||
.write:
|
||||
jms arg " pick up buffer
|
||||
and o17777 " mask to addr
|
||||
dac u.base " save as I/O base
|
||||
jms arg " pick up count
|
||||
dac u.count " save as count
|
||||
tad u.base " add base (get limit)
|
||||
jms betwen; u.base; o17777 " check between base and end of memory
|
||||
jms error " no: error
|
||||
dac u.limit " yes: save as limit
|
||||
jms finac " get fnode with fd from user AC
|
||||
lac f.flags " get open file table flags
|
||||
and d1 " open for write?
|
||||
sna " yes, skip
|
||||
jms error " no: error
|
||||
lac i.flags " get inode flags
|
||||
and o40 " get special bit?
|
||||
"** 01-s1.pdf page 12
|
||||
sna " special?
|
||||
jmp 1f " no
|
||||
iof " special file (device node)
|
||||
lac ii " get i number
|
||||
tad sww " get write routine
|
||||
dac .+1
|
||||
jmp .. i " dispatch to write routine
|
||||
1: " here with regular file
|
||||
lac u.base " get base
|
||||
dac 1f+1 " save as iwrite arg 1
|
||||
lac u.count " get count
|
||||
dac 1f+2 " save as iwrite 2
|
||||
lac f.badd " get fd offset
|
||||
1:
|
||||
jms iwrite; ..; .. " write to file
|
||||
|
||||
exitrw: " common exit for read/write system calls
|
||||
dac u.ac " save return in user AC
|
||||
tad f.badd
|
||||
dac f.badd " update file offset
|
||||
jms iput " release inode
|
||||
jms fput " release fnode
|
||||
jmp sysexit " return to user
|
||||
@@ -1,380 +0,0 @@
|
||||
"** 01-s1.pdf page 14
|
||||
" s3
|
||||
|
||||
" search for user (process)
|
||||
" call:
|
||||
" jms searchu; worker_routine_addr
|
||||
" worker called with copy of a process table entry in "lu"
|
||||
" can return directly (from caller of searchu)
|
||||
" index location 8 points to next process table entry
|
||||
searchu: 0
|
||||
lac searchu i " fetch argument
|
||||
dac 9f+t+1 " in t1
|
||||
-mnproc " loop counter
|
||||
dac 9f+t " in t0
|
||||
law ulist-1 " ulist ptr
|
||||
dac 8 " in index 8
|
||||
1:
|
||||
lac 8 i " copy ulist entry to lu
|
||||
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 " call argument as subroutine
|
||||
isz 9f+t " returned: loop done?
|
||||
jmp 1b " no, do it again
|
||||
isz searchu " skip argument
|
||||
jmp searchu i
|
||||
t = t+2
|
||||
|
||||
" look for a process with matching status
|
||||
" jms lookfor; status
|
||||
" found: ulist ptr in AC
|
||||
" not found
|
||||
lookfor: 0
|
||||
jms searchu; 1f
|
||||
isz lookfor " skip argument
|
||||
isz lookfor " give skip return
|
||||
jmp lookfor i
|
||||
1: 0 " worker called by searchu
|
||||
lac lu
|
||||
rtl; rtl; and o7 " bits 0:2 of lu
|
||||
sad lookfor i " match argument?
|
||||
skp " yes
|
||||
jmp 1b i " no, return, keep going
|
||||
-3
|
||||
tad 8 " roll index 8 back to this entry
|
||||
and o17777
|
||||
isz lookfor " skip lookfor argument
|
||||
jmp lookfor i " non-skip return
|
||||
|
||||
" fork system call:
|
||||
" sys fork
|
||||
" return at +1 in parent, child pid in AC
|
||||
" return at +2 in child, parent pid in AC
|
||||
.fork:
|
||||
jms lookfor; 0 " not-used " find an unused process slot
|
||||
skp
|
||||
jms error " none found- return error
|
||||
dac 9f+t " save ulist ptr in t0
|
||||
isz uniqpid " generate new pid
|
||||
lac uniqpid
|
||||
dac u.ac " return in child pid in AC
|
||||
law sysexit
|
||||
dac u.swapret " return from system call when swapped back in
|
||||
lac o200000 " change process status to out/ready (1->3)
|
||||
tad u.ulistp i
|
||||
dac u.ulistp i
|
||||
jms dskswap; 07000 " swap parent out
|
||||
lac 9f+t " get unused ulist slot back
|
||||
dac u.ulistp " set ulist pointer
|
||||
lac o100000 " mark child in/notready? (3->2)
|
||||
xor u.ulistp i
|
||||
dac u.ulistp i
|
||||
lac u.pid " get old (parent) pid
|
||||
"** 01-s1.pdf page 15
|
||||
dac u.ac " return parent pid in AC
|
||||
lac uniqpid
|
||||
dac u.pid " set child pid
|
||||
isz 9f+t " advance to second word in process table
|
||||
dac 9f+t i " set pid in process table
|
||||
isz u.rq+8 " give skip return
|
||||
dzm u.intflg " clear int flag
|
||||
jmp sysexit " return in child process
|
||||
t= t+1
|
||||
|
||||
badcal: " bad (unimplemented) system call
|
||||
clon " clear any pending clock interrupt?
|
||||
-1
|
||||
dac 7 " set location 7 to -1?!
|
||||
" fall into "save" system call
|
||||
" Ken says save files could be resumed, and used for checkpointing!
|
||||
.save: " "sys save" system call
|
||||
lac d1 " get inode 1 (core file?)
|
||||
jms iget
|
||||
cla
|
||||
jms iwrite; 4096; 4096 " dump core
|
||||
jms iwrite; userdata; 64 " and user area
|
||||
jms iput
|
||||
|
||||
.exit:
|
||||
lac u.dspbuf
|
||||
sna " process using display?
|
||||
jmp .+3 " no
|
||||
law dspbuf " yes
|
||||
jms movdsp " move display
|
||||
jms awake
|
||||
lac u.ulistp i
|
||||
and o77777 " mark process table entry free
|
||||
dac u.ulistp i
|
||||
isz u.ulistp
|
||||
dzm u.ulistp i " clear pid in process table
|
||||
jms swap " find a new process to run
|
||||
|
||||
.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 system call
|
||||
" AC/ pid
|
||||
" sys smes
|
||||
.smes:
|
||||
lac u.ac " get pid from user AC
|
||||
sna spa " >0?
|
||||
jms error " no: error
|
||||
jms searchu; 1f " search for process
|
||||
law 2
|
||||
tad u.ulistp
|
||||
dac 9f+t
|
||||
dzm 9f+t i
|
||||
jms error
|
||||
1: 0 " worker for searchu
|
||||
lac lu+1 " get pid
|
||||
sad u.ac " match?
|
||||
skp " yes
|
||||
jmp 1b i " no
|
||||
lac lu+2 " get mailbox
|
||||
sad dm1 " -1?
|
||||
jmp 1f " yes
|
||||
lac o100000 " no: increment process status
|
||||
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 " searchu worker
|
||||
lac u.pid " get caller pid
|
||||
sad lu+2 " match process table entry?
|
||||
skp " yes
|
||||
jmp 1b i " no, return
|
||||
-3
|
||||
tad 8 " get pointer to pid in process table??
|
||||
dac 9f+t " save in t0
|
||||
"** 01-s1.pdf page 17
|
||||
lac o700000 " set high bits
|
||||
tad 9f+t i
|
||||
dac 9f+t i
|
||||
jmp 1b i " return from worker
|
||||
t = t+1
|
||||
|
||||
swr:
|
||||
sww:
|
||||
jmp .-4 i
|
||||
.halt; rttyi; rkbdi; rppti; .halt
|
||||
.halt; wttyo; wdspo; wppto
|
||||
|
||||
.halt: jms halt
|
||||
|
||||
" read routine for ttyin special file
|
||||
rttyi:
|
||||
jms chkint1
|
||||
lac d1
|
||||
jms getchar
|
||||
jmp 1f
|
||||
and o177
|
||||
jms betwen; o101; o132 " upper case?
|
||||
skp " no
|
||||
tad o40 " yes: convert to lower
|
||||
alss 9
|
||||
jmp passone
|
||||
1:
|
||||
jms sleep; sfiles+0
|
||||
jms swap
|
||||
jmp rttyi
|
||||
|
||||
" write routine for ttyout special file
|
||||
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
|
||||
|
||||
" read routine for (display) "keyboard" special file
|
||||
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
|
||||
|
||||
" write routine for (graphic) "display" special file
|
||||
wdspo:
|
||||
jms chkint1
|
||||
jms forall
|
||||
jms dspput
|
||||
jmp fallr
|
||||
jms sleep; sfiles+6
|
||||
jms swap
|
||||
jmp wdspo
|
||||
|
||||
|
||||
" read routine for paper tape reader special file
|
||||
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
|
||||
|
||||
" write routine for paper tape punch special file
|
||||
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
|
||||
|
||||
" common exit for special file
|
||||
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
|
||||
@@ -1,371 +0,0 @@
|
||||
"** 01-s1.pdf page 21
|
||||
" s4
|
||||
|
||||
" allocate a free disk block for a file (data or indirect)
|
||||
alloc: 0
|
||||
-1
|
||||
tad s.nfblks
|
||||
spa
|
||||
jmp 1f
|
||||
dac s.nfblks
|
||||
tad fblksp
|
||||
jms laci
|
||||
dac 9f+t
|
||||
jms copyz; dskbuf; 64
|
||||
lac 9f+t
|
||||
jms dskwr
|
||||
dzm .savblk
|
||||
lac 9f+t
|
||||
jmp alloc i
|
||||
1:
|
||||
lac s.nxfblk
|
||||
sna
|
||||
jms halt " OUT OF DISK
|
||||
dac s.fblks
|
||||
jms dskrd
|
||||
lac dskbuf
|
||||
dac s.nxfblk
|
||||
jms copy; dskbuf+1; s.fblks+1; 9
|
||||
lac d10
|
||||
dac s.nfblks
|
||||
jmp alloc+1
|
||||
|
||||
" free a disk block
|
||||
free: 0
|
||||
lmq
|
||||
lac s.nfblks
|
||||
sad d10
|
||||
jmp 1f
|
||||
tad fblksp
|
||||
dac 9f+t
|
||||
lacq
|
||||
dac 9f+t i
|
||||
dzm .savblk
|
||||
isz s.nfblks
|
||||
jmp free i
|
||||
1:
|
||||
lac s.nxfblk
|
||||
dac dskbuf
|
||||
jms copy; s.fblks+1; dskbuf+1; 9
|
||||
lacq
|
||||
dac s.nxfblk
|
||||
jms dskwr
|
||||
dzm .savblk
|
||||
lac d1
|
||||
dac s.nfblks
|
||||
jmp free i
|
||||
t = t+1
|
||||
|
||||
" load AC indirect (without using indirect!)
|
||||
" AC/ address
|
||||
" jms laci
|
||||
" AC/ contents of address
|
||||
laci: 0
|
||||
and o17777 " clear everything but addr
|
||||
tad o200000 " make into "lac addr"
|
||||
dac .+1
|
||||
lac .. " fetch
|
||||
jmp laci i " return
|
||||
|
||||
"** 01-s1.pdf page 22
|
||||
|
||||
" skip if AC between two values (inclusive)
|
||||
" jms betwen; low_ptr; high_ptr
|
||||
" <not between>
|
||||
" <between>
|
||||
" listing has an alternate written in
|
||||
" (which would require 'lac ptr' instead of 'ptr' args?)
|
||||
betwen: 0
|
||||
lmq cmq " get ~AC in MQ
|
||||
lac betwen i " get low_ptr
|
||||
dac 9f+t
|
||||
isz betwen " skip low_ptr
|
||||
lacq " get ~AC (-AC-1) from MQ
|
||||
tad 9f+t i " get low-AC-1
|
||||
sma " negative (AC >= low)?
|
||||
jmp 1f " no, return w/o skip
|
||||
lac betwen i " fetch high_ptr
|
||||
dac 9f+t
|
||||
isz betwen " skip high_ptr
|
||||
lacq " get -AC-1
|
||||
tad 9f+t i " add to high value (high-AC-1)
|
||||
cma " complement (AC-high)
|
||||
spa sna " AC-high <= 0?
|
||||
1:
|
||||
isz betwen " no: give happy (skip) return
|
||||
lacq " restore ~AC
|
||||
cma " restore AC
|
||||
jmp betwen i " return w/o skip
|
||||
|
||||
" copy memory
|
||||
" call:
|
||||
" jms copy; src; dest; count
|
||||
copy: 0
|
||||
-1
|
||||
tad copy i
|
||||
dac 8
|
||||
isz copy
|
||||
-1
|
||||
tad copy i
|
||||
dac 9
|
||||
isz copy
|
||||
-1
|
||||
tad copy i
|
||||
cma
|
||||
dac 9f+t
|
||||
isz copy
|
||||
1:
|
||||
lac 8 i
|
||||
dac 9 i
|
||||
isz 9f+t
|
||||
jmp 1b
|
||||
jmp copy i
|
||||
|
||||
" copy zeroes (clear memory)
|
||||
" call:
|
||||
" jms copyz; pointer; count
|
||||
copyz: 0
|
||||
-1
|
||||
tad copyz i " get call PC
|
||||
dac 8 " save in index (pre-increments)
|
||||
isz copyz " skip pointer
|
||||
-1
|
||||
tad copyz i " get count-1
|
||||
cma " get negative count
|
||||
dac 9f+t " save in t0
|
||||
isz copyz " skip count
|
||||
1:
|
||||
dzm 8 i " zero word
|
||||
isz 9f+t " done?
|
||||
jmp 1b " no: loop
|
||||
jmp copyz i " return
|
||||
t = t+1
|
||||
|
||||
putchar: 0
|
||||
"** 01-s1.pdf page 23
|
||||
dac 9f+t
|
||||
cla
|
||||
jms takeq
|
||||
jmp putchar i
|
||||
tad o40001
|
||||
dac .+4
|
||||
lac 9f+t
|
||||
jms putq
|
||||
lac char
|
||||
dac q2+1 ..
|
||||
isz putchar
|
||||
jmp putchar i
|
||||
t = t+1
|
||||
|
||||
getchar: 0
|
||||
jms takeq
|
||||
jmp i getchar
|
||||
tad o200001
|
||||
dac .+3
|
||||
cla
|
||||
jms putq
|
||||
lac q2+1 ..
|
||||
isz getchar
|
||||
jmp i getchar
|
||||
|
||||
takeq: 0
|
||||
rcl
|
||||
tad lacq1
|
||||
dac .+7
|
||||
tad o640000
|
||||
dac .+17
|
||||
tad d1
|
||||
dac .+14
|
||||
tad o500000
|
||||
dac .+5
|
||||
lac q1 ..
|
||||
sna
|
||||
jmp takeq i
|
||||
dac lnkaddr
|
||||
sad q1+1 ..
|
||||
jmp .+5
|
||||
tad o200000
|
||||
dac .+1
|
||||
lac q2 ..
|
||||
jmp .+3
|
||||
cla
|
||||
dac q1+1 ..
|
||||
dac q1 ..
|
||||
isz takeq
|
||||
lac lnkaddr
|
||||
jmp i takeq
|
||||
|
||||
putq: 0
|
||||
rcl
|
||||
tad dacq1
|
||||
dac .+14
|
||||
tad d1
|
||||
dac .+13
|
||||
tad o140000
|
||||
dac .+1
|
||||
lac q1-1 ..
|
||||
"** 01-s1.pdf page 24
|
||||
sna
|
||||
jmp .+6
|
||||
tad o40000
|
||||
dac .+2
|
||||
lac lnkaddr
|
||||
dac q2 ..
|
||||
jmp .+3
|
||||
lac lnkaddr
|
||||
dac q1 ..
|
||||
dac q1+1 ..
|
||||
jmp putq i
|
||||
|
||||
srcdbs: 0
|
||||
dac 9f+t+2 "* lmq
|
||||
-ndskbs
|
||||
dac 9f+t
|
||||
law dskbs "* -1 dac 8 written
|
||||
dac 9f+t+1 "* lacq
|
||||
1:
|
||||
lac 9f+t+2 "** crossed out
|
||||
sad 9f+t+1 "** isz 8 written
|
||||
jmp srcdbs i
|
||||
law 65 "** ??? crossed out
|
||||
tad 9f+t+1 "** crossed out isz 8 written
|
||||
isz 9f+t+1
|
||||
isz 9f+t
|
||||
jmp 1b
|
||||
isz srcdbs
|
||||
jmp srcdbs i
|
||||
|
||||
collapse: 0
|
||||
cla
|
||||
jms srcdbs
|
||||
jmp 1f
|
||||
law dskbs
|
||||
dac 9f+t+1 "** 9f+t+1 crossed out: 8 written in
|
||||
1:
|
||||
lac 9f+t+1 "** 9f+t+1 crossed out: 8 written in
|
||||
dac 0f+1
|
||||
tad d65 "** crossed out: d2-- original obscured
|
||||
dac 0f
|
||||
cma
|
||||
tad d1
|
||||
tad edskbsp
|
||||
and o17777
|
||||
sna
|
||||
jmp 0f+3
|
||||
dac 0f+2
|
||||
jms copy; 0:..; ..; ..
|
||||
-65
|
||||
tad edskbsp
|
||||
dac 9f+t
|
||||
tad d1
|
||||
dac 0f
|
||||
lac dskaddr
|
||||
dac 9f+t i
|
||||
jms copy; dskbuf; 0:..; 64
|
||||
jmp collapse i
|
||||
|
||||
dskrd: 0
|
||||
jms betwen; d2; d7999
|
||||
|
||||
"** 01-s1.pdf page 25
|
||||
jms halt
|
||||
sad dskaddr
|
||||
jmp dskrd i
|
||||
dac dskaddr
|
||||
jms srcdbs
|
||||
jmp 1f
|
||||
lac dskaddr
|
||||
jms dskio; 06000
|
||||
jmp 2f
|
||||
1:
|
||||
dzm 9f+t+1 i
|
||||
law 1
|
||||
tad 9f+t+1
|
||||
dac .+2
|
||||
jms copy; ..; dskbuf; 64
|
||||
2:
|
||||
jms collapse
|
||||
jmp dskrd i
|
||||
|
||||
" write a file block (data, inode or indirect)
|
||||
" AC/ block
|
||||
dskwr: 0
|
||||
jms betwen; d2; d7999
|
||||
jms halt
|
||||
jms dskio; 07000
|
||||
lac dskaddr
|
||||
jms srcdbs
|
||||
dzm 9f+t+1 i
|
||||
jms collapse
|
||||
jmp dskwr i
|
||||
t = t+3
|
||||
|
||||
" AC/ block
|
||||
" jms dskio; dsld_bits
|
||||
dskio: 0
|
||||
dac dskaddr
|
||||
cll; idiv; 80
|
||||
dac 9f+t
|
||||
lacq
|
||||
idiv; 10
|
||||
dac 9f+t+1
|
||||
lls 22
|
||||
xor 9f+t+1
|
||||
als 8
|
||||
dac 9f+t+1
|
||||
lac 9f+t
|
||||
idiv; 10
|
||||
dac 9f+t
|
||||
lls 22
|
||||
xor 9f+t
|
||||
xor 9f+t+1
|
||||
xor o200000
|
||||
dac 9f+t
|
||||
jms dsktrans; -64; dskbuf; 9f+t; dskio
|
||||
isz dskio
|
||||
jmp dskio i
|
||||
t = t+1
|
||||
|
||||
" called with:
|
||||
" jms dsktrans; -WC; MAC; addr_ptr?; dsld_ptr
|
||||
dsktrans: 0
|
||||
-10
|
||||
dac 9f+t
|
||||
1:
|
||||
-1
|
||||
tad dsktrans
|
||||
dac 12
|
||||
"** 01-s1.pdf page 26
|
||||
dscs " clear status register
|
||||
lac 12 i
|
||||
dslw " load WC
|
||||
lac 12 i
|
||||
dslm " load MAC
|
||||
lac 12 i
|
||||
jms laci
|
||||
dsld " load TA & SA
|
||||
dzm .dskb
|
||||
lac 12 i
|
||||
jms laci
|
||||
jms laci
|
||||
dsls " load status
|
||||
lac .dskb " check for interrupt
|
||||
sna
|
||||
jmp .-2
|
||||
lac .dske " get status from interrupt
|
||||
sma
|
||||
jmp 12 i " return
|
||||
isz 9f+t
|
||||
jmp 1b
|
||||
jms halt " 10 disk errors
|
||||
t = t+1
|
||||
|
||||
halt: 0
|
||||
isz 9f+t " spin for a while (process interrupts)
|
||||
jmp .-1
|
||||
iof " disable interrupts
|
||||
hlt " halt
|
||||
jms copy; law; 4096; 4096 " continued: copy system up to user memory?
|
||||
hlt; jmp .-1 " halt for good
|
||||
t = t+1
|
||||
|
||||
@@ -1,291 +0,0 @@
|
||||
"** 01-s1.pdf page 28
|
||||
" s5
|
||||
" read/write a process from/to swap space
|
||||
" call:
|
||||
" AC/ first word of process table
|
||||
" jms dskswap; DSLD bits
|
||||
dskswap: 0
|
||||
cll; als 3 " get process disk address
|
||||
dac 9f+t " save in t0
|
||||
jms dsktrans; -64; userdata; 9f+t; dskswap " read/write user area
|
||||
lac 9f+t " get swap addr back
|
||||
tad o20 " advance by 16??
|
||||
dac 9f+t " save
|
||||
jms dsktrans; -4096; 4096; 9f+t; dskswap " read/write user memory
|
||||
isz dskswap " skip bits
|
||||
jmp dskswap i " return
|
||||
t = t+1
|
||||
|
||||
access: 0
|
||||
lac i.flags
|
||||
lmq " save in MQ
|
||||
lac u.uid " get user id
|
||||
spa " negative?
|
||||
jmp access i " yes: super user, return
|
||||
sad i.uid " compare to file owner
|
||||
lrs 2 " same: shift flags down two
|
||||
lacq " get flags back
|
||||
and mode " mode from system call
|
||||
sza " access allowed?
|
||||
jmp access i " yes: return
|
||||
jms error " no: return error from system call
|
||||
|
||||
fassign: 0
|
||||
-10 " loop count
|
||||
dac 9f+t " in t0
|
||||
1:
|
||||
lac 9f+t " get count
|
||||
tad d10 " turn into fd
|
||||
jms fget " fetch open file into "fnode"
|
||||
jms halt " will not happen
|
||||
lac f.flags " get fnode flags
|
||||
sma " sign bit set (active)?
|
||||
jmp 1f " no: free
|
||||
isz 9f+t " increment loop count & loop until zero
|
||||
jmp 1b
|
||||
jmp fassign i
|
||||
1:
|
||||
lac mode " get mode from system call
|
||||
xor o400000 " set sign bit
|
||||
dac f.flags " save in fnode
|
||||
lac ii " get i-number
|
||||
dac f.i " save in fnode
|
||||
lac 9f+t
|
||||
tad d10 " get fd
|
||||
dac u.ac " return in user AC
|
||||
dzm f.badd " clear file offset in fnode
|
||||
jms fput " copy fnode back into u.ofiles
|
||||
isz fassign " give skip return
|
||||
jmp fassign i
|
||||
t = t+1
|
||||
|
||||
" load fnode (open file entry) from u.ofiles
|
||||
" AC/ user fd
|
||||
" jms fget
|
||||
" bad fd
|
||||
" return with fnode set
|
||||
fget: 0
|
||||
jms betwen; d0; d9 " fd 0..9?
|
||||
jmp fget i " no, return
|
||||
cll; mul; 3 " multiply by three
|
||||
lacq
|
||||
"** 01-s1.pdf page 29
|
||||
|
||||
tad ofilesp " get pointer into u.ofiles
|
||||
dac 9f+t " save in t0
|
||||
dac .+2 " save as copy source
|
||||
jms copy; ..; fnode; 3 " copy to "fnode"
|
||||
isz fget " give skip return
|
||||
jmp fget i
|
||||
|
||||
" copy fnode back to u.ofiles
|
||||
" uses temp value set by "fget"
|
||||
" (fget and fput calls must be paired)
|
||||
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
|
||||
|
||||
" called with:
|
||||
" AC/ mode
|
||||
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
|
||||
|
||||
@@ -1,363 +0,0 @@
|
||||
"** 01-s1.pdf page 34
|
||||
" s6
|
||||
|
||||
itrunc: 0
|
||||
-7 " loop 7 times
|
||||
dac 9f+t " in t0
|
||||
lac idskpp " pointer to inode block numbers
|
||||
dac 9f+t+1 " save in t1
|
||||
1: " top of loop for inode blocks
|
||||
lac 9f+t+1 i " fetch next block number
|
||||
sna " allocated?
|
||||
jmp 4f " no
|
||||
lac i.flags " check flags
|
||||
and o200000
|
||||
sna " large file?
|
||||
jmp 3f " no
|
||||
-64 " loop 64 times
|
||||
dac 9f+t+2 " save count in t2
|
||||
lac dskbufp " get pointer to dskbuf
|
||||
dac 9f+t+3 " in t3
|
||||
2: " inner loop for indirect blocks
|
||||
lac 9f+t+1 i " get indirect block number
|
||||
jms dskrd " read it
|
||||
lac 9f+t+3 i " read block number from indirect
|
||||
sza " free?
|
||||
jms free " no: free it
|
||||
isz 9f+t+3 " increment pointer into indirect block
|
||||
isz 9f+t+2 " increment loop counter, skip if done
|
||||
jmp 2b " not done: loop
|
||||
3: " here with small file
|
||||
lac 9f+t+1 i " load block number
|
||||
jms free " free it
|
||||
dzm 9f+t+1 i " clear block number
|
||||
4: " bottom of loop for inode block ptrs
|
||||
isz 9f+t+1 " increment block pointer
|
||||
isz 9f+t " increment count, skip if done
|
||||
jmp 1b " not done
|
||||
lac i.flags
|
||||
and o577777 " clear large file flag
|
||||
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
|
||||
|
||||
" allocate a block for a file, returns disk block number
|
||||
" AC/ file offset
|
||||
" jms pget
|
||||
" AC/ disk block number
|
||||
pget: 0
|
||||
lrss 6 " convert offset to block
|
||||
dac 9f+t " save as t0
|
||||
lac i.flags
|
||||
|
||||
"** 01-s1.pdf page 37
|
||||
|
||||
and o200000
|
||||
sza " large file bit set?
|
||||
jmp 2f " yes
|
||||
lac 9f+t " no: small file
|
||||
jms betwen; d0; d6 " block 0..6?
|
||||
jmp 1f " no
|
||||
tad idskpp " make into block number pointer
|
||||
dac 9f+t " save in t0
|
||||
lac 9f+t i " get disk block number
|
||||
sna " allocated?
|
||||
jms alloc " no: allocate now
|
||||
dac 9f+t i " save (new) disk block number
|
||||
jmp pget i " return disk block number
|
||||
1: " here when file block>=7, not "large"
|
||||
jms alloc " allocate indirect block
|
||||
dac 9f+t+1 " save as t1
|
||||
jms copy; i.dskps; dskbuf; 7 " copy all the disk block numbers
|
||||
jms copyz; dskbuf+7; 64-7 " zero rest of indirect block
|
||||
lac 9f+t+1 " get indirect block number back
|
||||
jms dskwr " write indirect block to disk
|
||||
lac 9f+t+1
|
||||
dac i.dskps " save indirect as new first block
|
||||
jms copyz; i.dskps+1; 6 " zero rest of block pointers
|
||||
lac i.flags
|
||||
xor o200000 " set "large file"
|
||||
dac i.flags
|
||||
2: " here with "large file"
|
||||
lac 9f+t " get file block number
|
||||
lrss 6 " divide by 64 (indirects/block)
|
||||
jms betwen; d0; d6 " ok now?
|
||||
jms halt " file too big " no, you lose!
|
||||
tad idskpp " yes: get indirect block pointer
|
||||
dac 9f+t+1 " save in t1
|
||||
lac 9f+t+1 i " get indirect block number
|
||||
sna " allocated?
|
||||
jms alloc " no, get it now
|
||||
dac 9f+t+1 i " save (new) indirect block
|
||||
dac 9f+t+2 " save as t2
|
||||
jms dskrd " read indirect block
|
||||
lac 9f+t " get original block number
|
||||
and o77 " mod by 64
|
||||
tad dskbufp " get pointer to disk block number
|
||||
dac 9f+t+1 " save as t1
|
||||
lac 9f+t+1 i " fetch disk block number
|
||||
sza " allocated?
|
||||
jmp pget i " yes: return
|
||||
jms alloc " no: allocate data block
|
||||
dac 9f+t " save as t0
|
||||
lac 9f+t+2 " get indirect block number
|
||||
jms dskrd " read it in
|
||||
lac 9f+t " get data block number
|
||||
dac 9f+t+1 i " save data block number
|
||||
lac 9f+t+2
|
||||
jms dskwr " write indirect block back
|
||||
lac 9f+t " get data block back
|
||||
jmp pget i " return it
|
||||
t = t+3
|
||||
|
||||
iwrite: 0
|
||||
dac 9f+t " save arg in t0
|
||||
lac iwrite " load return address
|
||||
|
||||
"** 01-s1.pdf page 38
|
||||
|
||||
dac iread " save as iread return addr
|
||||
lac cskp " load skip instruction
|
||||
dac iwrite " save as iwrite instruction
|
||||
jmp 1f
|
||||
|
||||
" iread from file referenced by loaded inode
|
||||
" AC/ file offset
|
||||
" jms iread; addr; count
|
||||
iread: 0
|
||||
dac 9f+t " save offset in t0
|
||||
lac cnop " get nop
|
||||
dac iwrite " save as iwrite instruction
|
||||
1:
|
||||
-1
|
||||
tad iread i " get word before return addr
|
||||
dac 10 " store in index 10 & 11
|
||||
dac 11
|
||||
isz iread " increment return addr
|
||||
lac iread i " load addr
|
||||
dac 9f+t+1 " save in t1
|
||||
isz iread " increment return addr
|
||||
lac o70000
|
||||
xct iwrite " skip if write
|
||||
lac i.size " read: get file size
|
||||
cma
|
||||
tad 9f+t " add offset
|
||||
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
|
||||
|
||||
" system call helper
|
||||
" AC/ fd
|
||||
" jms finac
|
||||
" return with: fnode and inode loaded
|
||||
" or makes error return to user
|
||||
finac: 0
|
||||
lac u.ac
|
||||
jms fget
|
||||
jms error
|
||||
lac f.flags
|
||||
sma
|
||||
jms error
|
||||
lac f.i
|
||||
jms iget
|
||||
jmp finac i
|
||||
|
||||
" update inode file size with value in AC
|
||||
dacisize: 0
|
||||
dac i.size
|
||||
jms iput
|
||||
lac i.size
|
||||
jmp dacisize i
|
||||
@@ -1,372 +0,0 @@
|
||||
"** 01-s1.pdf page 41
|
||||
" s7
|
||||
|
||||
pibreak: " priority interrupt break processing "chain"
|
||||
dac .ac " save interrupt AC
|
||||
"** CROSSED OUT....
|
||||
|
||||
dpsf
|
||||
jmp 1f
|
||||
|
||||
dpcf
|
||||
dprs
|
||||
dac dpstat
|
||||
sma ral
|
||||
jmp 2f
|
||||
dprc
|
||||
dac dpchar
|
||||
-1
|
||||
dac dpread
|
||||
lac dpstat
|
||||
ral
|
||||
2:
|
||||
sma
|
||||
jmp piret
|
||||
-1
|
||||
dac dpwrite
|
||||
jmp piret "** END OF CROSSOUT
|
||||
|
||||
1: clsf " clock overflow (line frequency ticks)?
|
||||
jmp 1f " no
|
||||
|
||||
lpb " load display push buttons
|
||||
dac pbsflgs " save
|
||||
isz s.tim+1 " increment low order tick count
|
||||
skp " no overflow, skip second increment
|
||||
isz s.tim " low order overflowed, increment high order count
|
||||
isz uquant " increment user quantum counter
|
||||
"** written: ttydelay -> ttyd1
|
||||
"** written: ttyrestart -> ttyres1
|
||||
|
||||
" referenced in iread:
|
||||
cnop:
|
||||
nop
|
||||
-1
|
||||
dac 7 " set location 7 to -1
|
||||
clon " enable clock interrupts, reset flag
|
||||
lac ttydelay
|
||||
spa
|
||||
isz ttydelay
|
||||
skp
|
||||
jms ttyrestart
|
||||
lac .dspb "** START CROSSED OUT: written: lac tty
|
||||
sna
|
||||
jmp piret
|
||||
isz .dsptm
|
||||
skp
|
||||
jmp dsprestart
|
||||
sad d3
|
||||
jmp piret
|
||||
isz .dspb
|
||||
jmp piret
|
||||
jmp dsprestart "** END CROSSED OUT
|
||||
|
||||
1: dssf
|
||||
jmp 1f
|
||||
|
||||
-1
|
||||
dac .dskb
|
||||
|
||||
"** 01-s1.pdf page 42
|
||||
|
||||
dsrs
|
||||
dac .dske
|
||||
dscs
|
||||
jmp piret
|
||||
|
||||
1: lds "** BEGIN CROSSED OUT
|
||||
sma ral
|
||||
jmp 1f
|
||||
cdf
|
||||
lac .dspb
|
||||
sna
|
||||
jmp piret
|
||||
tad dm3
|
||||
sna
|
||||
jmp dsprestart
|
||||
dac .dspb
|
||||
jmp piret
|
||||
dsprestart:
|
||||
lac d1
|
||||
dac .dspb
|
||||
lac dspbufp
|
||||
beg
|
||||
-10
|
||||
dac .dsptm
|
||||
jmp piret
|
||||
|
||||
1: sna ral
|
||||
jmp .+3
|
||||
dpcf
|
||||
jmp piret
|
||||
sma
|
||||
jmp 1f
|
||||
lda
|
||||
dac .lpba
|
||||
rlpd
|
||||
jmp piret
|
||||
|
||||
1: ksf " (TTY) keyboard flag set?
|
||||
jmp 1f " no
|
||||
|
||||
lac ttydelay
|
||||
sma
|
||||
isz ttydelay
|
||||
krb " read keyboard buffer
|
||||
dac char " save in char
|
||||
sad o375 " interrupt char ('}'?)
|
||||
jmp intrp1 " yes
|
||||
lac d1
|
||||
jms putchar
|
||||
dzm char
|
||||
lac sfiles+0
|
||||
jms wakeup
|
||||
dac sfiles+0
|
||||
lac char
|
||||
sad o212
|
||||
skp
|
||||
jmp piret
|
||||
lac sfiles+1
|
||||
sma
|
||||
xor o400000
|
||||
dac sfiles+1
|
||||
|
||||
"** 01-s1.pdf page 43
|
||||
|
||||
jms putcr
|
||||
jms ttyrestart
|
||||
jmp piret
|
||||
|
||||
1: tsf
|
||||
jmp 1f
|
||||
|
||||
tcf
|
||||
jms ttyrestart
|
||||
jmp piret
|
||||
|
||||
ttyrestart: 0
|
||||
lac ttydelay
|
||||
spa
|
||||
jmp ttyrestart i
|
||||
lac nttychar
|
||||
dzm nttychar
|
||||
sza
|
||||
jmp 3f
|
||||
isz ttydelay
|
||||
lac d2
|
||||
jms getchar
|
||||
jmp 2f
|
||||
3:
|
||||
tls
|
||||
sad o12
|
||||
jms putcr
|
||||
sad o15
|
||||
skp
|
||||
jmp ttyrestart i
|
||||
lac ttydelay
|
||||
tad o20
|
||||
rcr
|
||||
cma
|
||||
dac ttydelay
|
||||
jmp ttyrestart i
|
||||
2:
|
||||
lac sfiles+1
|
||||
jms wakeup
|
||||
dac sfiles+1
|
||||
jmp ttyrestart i "** written arrow up 2 copies
|
||||
|
||||
"** BEGIN CROSSED OUT
|
||||
1: sck " Graphic-2 keyboard flag set?
|
||||
jmp 1f " no.
|
||||
|
||||
cck " yes: clear flag
|
||||
lck " read character
|
||||
dac char
|
||||
sad o33 " code 33 (ESCAPE?)
|
||||
jmp intrp2 " yes: mark interrupt
|
||||
lac d3
|
||||
jms putchar
|
||||
nop
|
||||
lac sfiles+2
|
||||
jms wakeup
|
||||
dac sfiles+2
|
||||
jmp piret
|
||||
|
||||
1: rsf " paper tape ready?
|
||||
jmp 1f " no
|
||||
|
||||
|
||||
"** 01-s1.pdf page 44
|
||||
|
||||
lac npptchar
|
||||
sna
|
||||
jmp .+5
|
||||
dac char
|
||||
rrb
|
||||
dac npptchar
|
||||
jmp .+3
|
||||
rrb
|
||||
dac char
|
||||
3:
|
||||
lac char
|
||||
sna
|
||||
jmp 2f
|
||||
lac d4
|
||||
jms putchar
|
||||
jmp 3f
|
||||
lac char
|
||||
sad d4
|
||||
jmp 4f
|
||||
2:
|
||||
lac npptchar
|
||||
sna
|
||||
jmp .+4
|
||||
dac char
|
||||
dzm npptchar
|
||||
jmp 3b
|
||||
rsa
|
||||
lac sfiles+3
|
||||
jms wakeup
|
||||
xor o400000
|
||||
dac sfiles+3
|
||||
jmp piret
|
||||
3:
|
||||
lac char
|
||||
dac npptchar
|
||||
4:
|
||||
lac sfiles+3
|
||||
jms wakeup
|
||||
dac sfiles+3
|
||||
jmp piret
|
||||
|
||||
1: psf " paper tape ready?
|
||||
jmp 1f " no
|
||||
|
||||
pcf " clear ptp flag
|
||||
lac d5
|
||||
jms getchar " get next char
|
||||
jmp .+3
|
||||
psa
|
||||
jmp piret
|
||||
lac sfiles+4
|
||||
jms wakeup
|
||||
dac sfiles+4
|
||||
jmp piret
|
||||
|
||||
"** BEGIN CROSSED OUT
|
||||
1: spb " graphic 2 push button flag set?
|
||||
jmp 1f " no
|
||||
|
||||
cpb " clear push button flag
|
||||
lpb " load push button value
|
||||
dac pbsflgs+1
|
||||
|
||||
"** 01-s1.pdf page 45
|
||||
|
||||
and o2000
|
||||
sna
|
||||
jmp piret
|
||||
jms dspinit
|
||||
lac sfiles+6
|
||||
jms wakeup
|
||||
dac sfiles+6
|
||||
cla
|
||||
wbl
|
||||
jmp piret "** END CROSSED OUT
|
||||
|
||||
1: crsf " card reader flag set?
|
||||
jmp 1f " no
|
||||
|
||||
crrb
|
||||
dac crchar
|
||||
-1
|
||||
dac crread
|
||||
jmp piret
|
||||
|
||||
1: crrb " read card reader buffer??
|
||||
|
||||
piret: " return from priority interrupt
|
||||
lac 0 " get LINK/PC
|
||||
ral " restore LINK
|
||||
lac .ac " restore AC
|
||||
ion " reenable interrupts
|
||||
jmp 0 i " return from interrupt
|
||||
|
||||
wakeup: 0
|
||||
dac 9f+t
|
||||
-mnproc
|
||||
dac 9f+t+1
|
||||
lac tadu
|
||||
dac 2f
|
||||
lac dacu
|
||||
dac 2f+1
|
||||
1:
|
||||
lac 9f+t
|
||||
ral
|
||||
dac 9f+t
|
||||
sma
|
||||
jmp 2f+2
|
||||
lac o700000
|
||||
2: tad ..
|
||||
dac ..
|
||||
lac 2b
|
||||
tad d4
|
||||
dac 2b
|
||||
lac 2b+1
|
||||
tad d4
|
||||
dac 2b+1
|
||||
isz 9f+t+1
|
||||
jmp 1b
|
||||
cla
|
||||
jmp wakeup i
|
||||
t = t+2
|
||||
|
||||
putcr: 0
|
||||
lac o15
|
||||
dac nttychar
|
||||
|
||||
"** 01-s1.pdf page 46
|
||||
|
||||
cla
|
||||
jmp putcr i
|
||||
|
||||
intrp1: " here with keyboard interrupt
|
||||
lac d6 " get keyboard special device number
|
||||
dac .int1 " save as interrupt source
|
||||
lac d1
|
||||
jms getchar
|
||||
skp
|
||||
jmp .-3
|
||||
lac d2
|
||||
jms getchar
|
||||
skp
|
||||
jmp .-3
|
||||
lac sfiles+0
|
||||
jms wakeup
|
||||
dac sfiles+0
|
||||
lac sfiles+1
|
||||
jms wakeup
|
||||
dac sfiles+1
|
||||
jms chkint
|
||||
jmp piret
|
||||
jmp 1f
|
||||
intrp2:
|
||||
lac d7
|
||||
dac .int2
|
||||
lac d3
|
||||
jms getchar
|
||||
skp
|
||||
jmp .-3
|
||||
lac sfiles+2
|
||||
jms wakeup
|
||||
dac sfiles+2
|
||||
lac sfiles+6
|
||||
jms wakeup
|
||||
dac sfiles+6
|
||||
jms chkint
|
||||
jmp piret
|
||||
1:
|
||||
lac 0
|
||||
dac 020
|
||||
lac .ac
|
||||
jmp 021
|
||||
@@ -1,238 +0,0 @@
|
||||
"** 01-s1.pdf page 48
|
||||
|
||||
" s8
|
||||
|
||||
" manifests
|
||||
mnproc = 10
|
||||
dspbsz = 270
|
||||
ndskbs = 4
|
||||
|
||||
" flags
|
||||
" interupt flags
|
||||
.insys: 0 " "in system"
|
||||
.int1: 0 " inode for interrupt 1
|
||||
.int2: 0 " inode for interrupt 2
|
||||
.ac: 0 " saved AC from interrupt
|
||||
.savblk: 0 " set by system call, cleared by disk i/o
|
||||
.dsptm: 0 " display restart countdown (10 ticks)
|
||||
.dskb: 0 " set on disk interrupt
|
||||
.dske: 0 " status from disk interrupt
|
||||
|
||||
" 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 " clear all flags
|
||||
ion " enable interrupts
|
||||
clon " clear clock flag
|
||||
law 3072 " initialize display....
|
||||
wcga
|
||||
jms dspinit
|
||||
law dspbuf
|
||||
jms movdsp
|
||||
cla " read system block from disk
|
||||
jms dskio; 06000
|
||||
jms copy; dskbuf; sysdata; ulist-sysdata " copy to system data
|
||||
lac d3 " look for "init" in default directory
|
||||
jms namei; initf
|
||||
jms halt
|
||||
"** 01-s1.pdf page 50
|
||||
jms iget
|
||||
cla
|
||||
jms iread; 4096; 4096 " read in "init"
|
||||
jmp 4096 " start process 1
|
||||
. = 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 " pid generator
|
||||
lu: .=.+4 " user (process) table entry copy
|
||||
sfiles: .=.+10 " wait addresses for special files
|
||||
dpdata:
|
||||
dpstat: .=.+1
|
||||
dpread: .=.+1
|
||||
dpwrite: .=.+1
|
||||
dpchar: .=.+1
|
||||
dspdata:
|
||||
.dspb: .=.+1
|
||||
.lpba: .=.+1 "** 4 written on listing
|
||||
crdata:
|
||||
crread: .=.+1
|
||||
crchar: .=.+1
|
||||
sysdata: " system data 64 words saved to disk
|
||||
s.nxfblk: .=.+1 " pointer to next free block??
|
||||
s.nfblks: .=.+1 " number of free blocks (in fblks?)
|
||||
s.fblks: .=.+10 " cached free block numbers
|
||||
s.uniq: .=.+1 " next unique value
|
||||
s.tim: .=.+2 " (up?)time in 60Hz ticks (low, high)
|
||||
" process table
|
||||
" first word
|
||||
" bits 0:2 -- status
|
||||
" 0: free slot
|
||||
" 1: in/ready
|
||||
" 2: in/notready
|
||||
" 3: out/ready
|
||||
" 4: out/notready??
|
||||
" bits 3:17 -- disk swap address/8
|
||||
" second word: process pid
|
||||
" third word: used for smes/rmes
|
||||
" fourth word: ??
|
||||
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: " "ustruct" (swappable)
|
||||
u.ac: 0 " user AC
|
||||
u.mq: 0 " user MQ
|
||||
u.rq: .=.+9 " user 010-017, user PC
|
||||
u.uid: -1 " user id
|
||||
u.pid: 1 " process id
|
||||
u.cdir: 3 " connected directory (inode number?)
|
||||
u.ulistp: ulist " pointer to process table entry
|
||||
u.swapret: 0 " kernel routine to resume at after swap in
|
||||
u.base: 0 " start of user buffer
|
||||
u.count: 0 " size of user buffer
|
||||
"** 01-s1.pdf page 51
|
||||
u.limit: 0 " end of user buffer
|
||||
u.ofiles: .=.+30 " open files (10 "fnode" entries)
|
||||
u.dspbuf: 0
|
||||
u.intflg: 1
|
||||
.=userdata+64
|
||||
ii: .=.+1 " number of i-node in inode:
|
||||
inode: " disk inode in memory:
|
||||
i.flags: .=.+1 " inode flags
|
||||
" 400000 free?? (checked/toggled by icreat)
|
||||
" 200000 large file
|
||||
" 000040 special device (indicated by inum)?
|
||||
" 000020 directory
|
||||
" 000010 owner read
|
||||
" 000004 owner write
|
||||
" 000002 world read
|
||||
" 000001 world write
|
||||
i.dskps: .=.+7 " disk block pointers (indirect if "large file")
|
||||
i.uid: .=.+1 " owner
|
||||
i.nlks: .=.+1 " link count
|
||||
i.size: .=.+1
|
||||
i.uniq: .=.+1 " unique number
|
||||
.= inode+12
|
||||
di: .=.+1
|
||||
dnode: " directory entry:
|
||||
d.i: .=.+1 " inode number
|
||||
d.name: .=.+4 " name (space padded)
|
||||
d.uniq: .=.+1 " unique number from directory inode
|
||||
. = dnode+8
|
||||
fnode: " open file entry
|
||||
f.flags: .=.+1 " see below
|
||||
f.badd: .=.+1 " offset
|
||||
f.i: 0 " file i-number
|
||||
" f.flags:
|
||||
" 400000 in use
|
||||
" 000002 read
|
||||
" 000001 write
|
||||
@@ -1,115 +0,0 @@
|
||||
"** 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
|
||||
@@ -1,95 +0,0 @@
|
||||
"** 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
|
||||
@@ -1,264 +0,0 @@
|
||||
"** 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
|
||||
Reference in New Issue
Block a user