From 4cafeeed3703a22f02ca9085c1a9dcc39d886657 Mon Sep 17 00:00:00 2001 From: Tom Everett Date: Sat, 5 Mar 2016 16:53:53 -0700 Subject: [PATCH] removed pdp7parse --- pdp7parse/.gitignore | 8 - pdp7parse/README.md | 7 - pdp7parse/generate-sources.sh | 1 - pdp7parse/pom.xml | 58 - .../com/khubla/pdp7parse/antlr4/pdp7.g4 | 289 ---- .../pdp7parse/LabelParseTreeListener.java | 54 - .../java/com/khubla/pdp7parse/Opcode.java | 109 -- .../com/khubla/pdp7parse/PDP7Metadata.java | 24 - .../java/com/khubla/pdp7parse/PDP7Parse.java | 82 - .../java/com/khubla/pdp7parse/PDP7Parser.java | 53 - .../pdp7parse/antlr4/pdp7BaseListener.java | 256 ---- .../khubla/pdp7parse/antlr4/pdp7Lexer.java | 375 ----- .../khubla/pdp7parse/antlr4/pdp7Listener.java | 191 --- .../khubla/pdp7parse/antlr4/pdp7Parser.java | 1353 ----------------- pdp7parse/src/main/java/pdp7.tokens | 211 --- pdp7parse/src/main/java/pdp7Lexer.tokens | 211 --- .../java/com/khubla/pdp7parse/BasicTests.java | 51 - pdp7parse/src/test/resources/adm.s | 586 ------- pdp7parse/src/test/resources/apr.s | 683 --------- pdp7parse/src/test/resources/as.s | 1025 ------------- pdp7parse/src/test/resources/bc.s | 288 ---- pdp7parse/src/test/resources/bi.s | 433 ------ pdp7parse/src/test/resources/cat.s | 151 -- pdp7parse/src/test/resources/chmod.s | 77 - pdp7parse/src/test/resources/chown.s | 76 - pdp7parse/src/test/resources/cp.s | 97 -- pdp7parse/src/test/resources/dmabs.s | 256 ---- pdp7parse/src/test/resources/ds.s | 501 ------ pdp7parse/src/test/resources/dsksav.s | 26 - pdp7parse/src/test/resources/ed1.s | 771 ---------- pdp7parse/src/test/resources/ed2.s | 519 ------- pdp7parse/src/test/resources/init.s | 291 ---- pdp7parse/src/test/resources/s1.s | 209 --- pdp7parse/src/test/resources/s2.s | 344 ----- pdp7parse/src/test/resources/s3.s | 380 ----- pdp7parse/src/test/resources/s4.s | 371 ----- pdp7parse/src/test/resources/s5.s | 291 ---- pdp7parse/src/test/resources/s6.s | 363 ----- pdp7parse/src/test/resources/s7.s | 372 ----- pdp7parse/src/test/resources/s8.s | 238 --- pdp7parse/src/test/resources/s9.s | 115 -- pdp7parse/src/test/resources/sop.s | 95 -- pdp7parse/src/test/resources/sysmap | 264 ---- 43 files changed, 12155 deletions(-) delete mode 100644 pdp7parse/.gitignore delete mode 100644 pdp7parse/README.md delete mode 100644 pdp7parse/generate-sources.sh delete mode 100644 pdp7parse/pom.xml delete mode 100644 pdp7parse/src/main/antlr4/com/khubla/pdp7parse/antlr4/pdp7.g4 delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/LabelParseTreeListener.java delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/Opcode.java delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Metadata.java delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Parse.java delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Parser.java delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7BaseListener.java delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Lexer.java delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Listener.java delete mode 100644 pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Parser.java delete mode 100644 pdp7parse/src/main/java/pdp7.tokens delete mode 100644 pdp7parse/src/main/java/pdp7Lexer.tokens delete mode 100644 pdp7parse/src/test/java/com/khubla/pdp7parse/BasicTests.java delete mode 100644 pdp7parse/src/test/resources/adm.s delete mode 100644 pdp7parse/src/test/resources/apr.s delete mode 100644 pdp7parse/src/test/resources/as.s delete mode 100644 pdp7parse/src/test/resources/bc.s delete mode 100644 pdp7parse/src/test/resources/bi.s delete mode 100644 pdp7parse/src/test/resources/cat.s delete mode 100644 pdp7parse/src/test/resources/chmod.s delete mode 100644 pdp7parse/src/test/resources/chown.s delete mode 100644 pdp7parse/src/test/resources/cp.s delete mode 100644 pdp7parse/src/test/resources/dmabs.s delete mode 100644 pdp7parse/src/test/resources/ds.s delete mode 100644 pdp7parse/src/test/resources/dsksav.s delete mode 100644 pdp7parse/src/test/resources/ed1.s delete mode 100644 pdp7parse/src/test/resources/ed2.s delete mode 100644 pdp7parse/src/test/resources/init.s delete mode 100644 pdp7parse/src/test/resources/s1.s delete mode 100644 pdp7parse/src/test/resources/s2.s delete mode 100644 pdp7parse/src/test/resources/s3.s delete mode 100644 pdp7parse/src/test/resources/s4.s delete mode 100644 pdp7parse/src/test/resources/s5.s delete mode 100644 pdp7parse/src/test/resources/s6.s delete mode 100644 pdp7parse/src/test/resources/s7.s delete mode 100644 pdp7parse/src/test/resources/s8.s delete mode 100644 pdp7parse/src/test/resources/s9.s delete mode 100644 pdp7parse/src/test/resources/sop.s delete mode 100644 pdp7parse/src/test/resources/sysmap diff --git a/pdp7parse/.gitignore b/pdp7parse/.gitignore deleted file mode 100644 index b04c3c2..0000000 --- a/pdp7parse/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/**/*.log -/**/.DS_Store -/**/.project -/**/.classpath -/**/.settings/ -/**/target -/**/test-output -ANTLRv4Lexer.g4 diff --git a/pdp7parse/README.md b/pdp7parse/README.md deleted file mode 100644 index 091723c..0000000 --- a/pdp7parse/README.md +++ /dev/null @@ -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. - diff --git a/pdp7parse/generate-sources.sh b/pdp7parse/generate-sources.sh deleted file mode 100644 index 4fe9b85..0000000 --- a/pdp7parse/generate-sources.sh +++ /dev/null @@ -1 +0,0 @@ -mvn clean antlr4:antlr4 \ No newline at end of file diff --git a/pdp7parse/pom.xml b/pdp7parse/pom.xml deleted file mode 100644 index d44fd62..0000000 --- a/pdp7parse/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - 4.0.0 - com.khubla.pdp7 - pdp7parse - jar - khubla.com PDP7 Parser - 1.0 - - 4.5 - - - - commons-cli - commons-cli - 1.2 - jar - compile - - - org.antlr - antlr4-runtime - ${antlr.version} - jar - compile - - - commons-io - commons-io - 2.4 - - - org.testng - testng - 6.9.6 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - org.antlr - antlr4-maven-plugin - ${antlr.version} - - pdp7.g4 - src/main/java - - - - - diff --git a/pdp7parse/src/main/antlr4/com/khubla/pdp7parse/antlr4/pdp7.g4 b/pdp7parse/src/main/antlr4/com/khubla/pdp7parse/antlr4/pdp7.g4 deleted file mode 100644 index f81cc28..0000000 --- a/pdp7parse/src/main/antlr4/com/khubla/pdp7parse/antlr4/pdp7.g4 +++ /dev/null @@ -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 - ; diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/LabelParseTreeListener.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/LabelParseTreeListener.java deleted file mode 100644 index 9e8143d..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/LabelParseTreeListener.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.khubla.pdp7parse; -/* -* Copyright 2016, Tom Everett -* -* 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 . -*/ - -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 - } -} diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/Opcode.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/Opcode.java deleted file mode 100644 index c449718..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/Opcode.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.khubla.pdp7parse; - -/* - * Copyright 2016, Tom Everett - * - * 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 . - */ -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; -} diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Metadata.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Metadata.java deleted file mode 100644 index 6b9fe10..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Metadata.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.khubla.pdp7parse; - -import java.util.ArrayList; -import java.util.List; - -/* -* Copyright 2016, Tom Everett -* -* 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 . -*/ -public class PDP7Metadata { - public List labels = new ArrayList(); -} diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Parse.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Parse.java deleted file mode 100644 index 2312287..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Parse.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.khubla.pdp7parse; - -/* -* Copyright 2016, Tom Everett -* -* 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 . -*/ -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"; -} \ No newline at end of file diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Parser.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Parser.java deleted file mode 100644 index f57e289..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/PDP7Parser.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.khubla.pdp7parse; -/* -* Copyright 2016, Tom Everett -* -* 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 . -*/ - -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); - } -} diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7BaseListener.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7BaseListener.java deleted file mode 100644 index a0799e6..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7BaseListener.java +++ /dev/null @@ -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} - * - *

The default implementation does nothing.

- */ - @Override public void enterProg(pdp7Parser.ProgContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitProg(pdp7Parser.ProgContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterLine(pdp7Parser.LineContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitLine(pdp7Parser.LineContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterLineeol(pdp7Parser.LineeolContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitLineeol(pdp7Parser.LineeolContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterDeclarations(pdp7Parser.DeclarationsContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitDeclarations(pdp7Parser.DeclarationsContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterDeclaration(pdp7Parser.DeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitDeclaration(pdp7Parser.DeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterInstruction(pdp7Parser.InstructionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitInstruction(pdp7Parser.InstructionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterArgument(pdp7Parser.ArgumentContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitArgument(pdp7Parser.ArgumentContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterAssignment(pdp7Parser.AssignmentContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitAssignment(pdp7Parser.AssignmentContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterSymbol(pdp7Parser.SymbolContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitSymbol(pdp7Parser.SymbolContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterExpression(pdp7Parser.ExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitExpression(pdp7Parser.ExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterMultiplyingExpression(pdp7Parser.MultiplyingExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitMultiplyingExpression(pdp7Parser.MultiplyingExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterAtom(pdp7Parser.AtomContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitAtom(pdp7Parser.AtomContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterString(pdp7Parser.StringContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitString(pdp7Parser.StringContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterEol(pdp7Parser.EolContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitEol(pdp7Parser.EolContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterComment(pdp7Parser.CommentContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitComment(pdp7Parser.CommentContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterLabel(pdp7Parser.LabelContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitLabel(pdp7Parser.LabelContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterVariable(pdp7Parser.VariableContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitVariable(pdp7Parser.VariableContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterOpcode(pdp7Parser.OpcodeContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitOpcode(pdp7Parser.OpcodeContext ctx) { } - - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterEveryRule(ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitEveryRule(ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void visitTerminal(TerminalNode node) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void visitErrorNode(ErrorNode node) { } -} \ No newline at end of file diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Lexer.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Lexer.java deleted file mode 100644 index c089b4c..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Lexer.java +++ /dev/null @@ -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] = ""; - } - } - } - - @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{?}@\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\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); - } - } -} \ No newline at end of file diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Listener.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Listener.java deleted file mode 100644 index e520f8d..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Listener.java +++ /dev/null @@ -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); -} \ No newline at end of file diff --git a/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Parser.java b/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Parser.java deleted file mode 100644 index 2d75001..0000000 --- a/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Parser.java +++ /dev/null @@ -1,1353 +0,0 @@ -// Generated from com/khubla/pdp7parse/antlr4/pdp7.g4 by ANTLR 4.5 -package com.khubla.pdp7parse.antlr4; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.misc.*; -import org.antlr.v4.runtime.tree.*; -import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) -public class pdp7Parser extends Parser { - 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 final int - RULE_prog = 0, RULE_line = 1, RULE_lineeol = 2, RULE_declarations = 3, - RULE_declaration = 4, RULE_instruction = 5, RULE_argument = 6, RULE_assignment = 7, - RULE_symbol = 8, RULE_expression = 9, RULE_multiplyingExpression = 10, - RULE_atom = 11, RULE_string = 12, RULE_eol = 13, RULE_comment = 14, RULE_label = 15, - RULE_variable = 16, RULE_opcode = 17; - public static final String[] ruleNames = { - "prog", "line", "lineeol", "declarations", "declaration", "instruction", - "argument", "assignment", "symbol", "expression", "multiplyingExpression", - "atom", "string", "eol", "comment", "label", "variable", "opcode" - }; - - 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] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - @Override - public String getGrammarFileName() { return "pdp7.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public ATN getATN() { return _ATN; } - - public pdp7Parser(TokenStream input) { - super(input); - _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - public static class ProgContext extends ParserRuleContext { - public TerminalNode EOF() { return getToken(pdp7Parser.EOF, 0); } - public List lineeol() { - return getRuleContexts(LineeolContext.class); - } - public LineeolContext lineeol(int i) { - return getRuleContext(LineeolContext.class,i); - } - public LineContext line() { - return getRuleContext(LineContext.class,0); - } - public ProgContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_prog; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterProg(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitProg(this); - } - } - - public final ProgContext prog() throws RecognitionException { - ProgContext _localctx = new ProgContext(_ctx, getState()); - enterRule(_localctx, 0, RULE_prog); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(37); - _errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - setState(36); - lineeol(); - } - } - break; - default: - throw new NoViableAltException(this); - } - setState(39); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,0,_ctx); - } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); - setState(42); - switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { - case 1: - { - setState(41); - line(); - } - break; - } - setState(44); - match(EOF); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class LineContext extends ParserRuleContext { - public DeclarationsContext declarations() { - return getRuleContext(DeclarationsContext.class,0); - } - public CommentContext comment() { - return getRuleContext(CommentContext.class,0); - } - public LineContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_line; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterLine(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitLine(this); - } - } - - public final LineContext line() throws RecognitionException { - LineContext _localctx = new LineContext(_ctx, getState()); - enterRule(_localctx, 2, RULE_line); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(47); - switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { - case 1: - { - setState(46); - declarations(); - } - break; - } - setState(50); - _la = _input.LA(1); - if (_la==COMMENT) { - { - setState(49); - comment(); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class LineeolContext extends ParserRuleContext { - public LineContext line() { - return getRuleContext(LineContext.class,0); - } - public EolContext eol() { - return getRuleContext(EolContext.class,0); - } - public LineeolContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_lineeol; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterLineeol(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitLineeol(this); - } - } - - public final LineeolContext lineeol() throws RecognitionException { - LineeolContext _localctx = new LineeolContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_lineeol); - try { - enterOuterAlt(_localctx, 1); - { - setState(52); - line(); - setState(53); - eol(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class DeclarationsContext extends ParserRuleContext { - public List declaration() { - return getRuleContexts(DeclarationContext.class); - } - public DeclarationContext declaration(int i) { - return getRuleContext(DeclarationContext.class,i); - } - public DeclarationsContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_declarations; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterDeclarations(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitDeclarations(this); - } - } - - public final DeclarationsContext declarations() throws RecognitionException { - DeclarationsContext _localctx = new DeclarationsContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_declarations); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(55); - declaration(); - setState(60); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==T__0) { - { - { - setState(56); - match(T__0); - setState(57); - declaration(); - } - } - setState(62); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class DeclarationContext extends ParserRuleContext { - public List label() { - return getRuleContexts(LabelContext.class); - } - public LabelContext label(int i) { - return getRuleContext(LabelContext.class,i); - } - public List instruction() { - return getRuleContexts(InstructionContext.class); - } - public InstructionContext instruction(int i) { - return getRuleContext(InstructionContext.class,i); - } - public List assignment() { - return getRuleContexts(AssignmentContext.class); - } - public AssignmentContext assignment(int i) { - return getRuleContext(AssignmentContext.class,i); - } - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public DeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_declaration; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterDeclaration(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitDeclaration(this); - } - } - - public final DeclarationContext declaration() throws RecognitionException { - DeclarationContext _localctx = new DeclarationContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_declaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(66); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==LABEL) { - { - { - setState(63); - label(); - } - } - setState(68); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(74); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41) | (1L << T__42) | (1L << T__43) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48) | (1L << T__49) | (1L << T__50) | (1L << T__51) | (1L << T__52) | (1L << T__53) | (1L << T__54) | (1L << T__55) | (1L << T__56) | (1L << T__57) | (1L << T__58) | (1L << T__59) | (1L << T__60) | (1L << T__61) | (1L << T__62))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__64 - 64)) | (1L << (T__65 - 64)) | (1L << (T__66 - 64)) | (1L << (T__67 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__71 - 64)) | (1L << (T__72 - 64)) | (1L << (T__73 - 64)) | (1L << (T__74 - 64)) | (1L << (T__75 - 64)) | (1L << (T__76 - 64)) | (1L << (T__77 - 64)) | (1L << (T__78 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (T__81 - 64)) | (1L << (T__82 - 64)) | (1L << (T__83 - 64)) | (1L << (T__84 - 64)) | (1L << (T__85 - 64)) | (1L << (T__86 - 64)) | (1L << (T__87 - 64)) | (1L << (T__88 - 64)) | (1L << (T__89 - 64)) | (1L << (T__90 - 64)) | (1L << (T__91 - 64)) | (1L << (T__92 - 64)) | (1L << (T__93 - 64)) | (1L << (LOC - 64)) | (1L << (RELOC - 64)) | (1L << (MINUS - 64)) | (1L << (IDENTIFIER - 64)) | (1L << (NUMERIC_LITERAL - 64)) | (1L << (DECIMAL - 64)) | (1L << (OCTAL - 64)) | (1L << (DECIMAL_MINUS - 64)) | (1L << (STRING - 64)) | (1L << (CHAR - 64)))) != 0)) { - { - setState(72); - switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) { - case 1: - { - setState(69); - instruction(); - } - break; - case 2: - { - setState(70); - assignment(); - } - break; - case 3: - { - setState(71); - expression(); - } - break; - } - } - setState(76); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class InstructionContext extends ParserRuleContext { - public OpcodeContext opcode() { - return getRuleContext(OpcodeContext.class,0); - } - public List argument() { - return getRuleContexts(ArgumentContext.class); - } - public ArgumentContext argument(int i) { - return getRuleContext(ArgumentContext.class,i); - } - public InstructionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_instruction; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterInstruction(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitInstruction(this); - } - } - - public final InstructionContext instruction() throws RecognitionException { - InstructionContext _localctx = new InstructionContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_instruction); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(77); - opcode(); - setState(81); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,8,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(78); - argument(); - } - } - } - setState(83); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,8,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ArgumentContext extends ParserRuleContext { - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ArgumentContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_argument; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterArgument(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitArgument(this); - } - } - - public final ArgumentContext argument() throws RecognitionException { - ArgumentContext _localctx = new ArgumentContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_argument); - try { - enterOuterAlt(_localctx, 1); - { - setState(84); - expression(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AssignmentContext extends ParserRuleContext { - public SymbolContext symbol() { - return getRuleContext(SymbolContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public AssignmentContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_assignment; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterAssignment(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitAssignment(this); - } - } - - public final AssignmentContext assignment() throws RecognitionException { - AssignmentContext _localctx = new AssignmentContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_assignment); - try { - enterOuterAlt(_localctx, 1); - { - setState(86); - symbol(); - setState(87); - match(T__1); - setState(88); - expression(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class SymbolContext extends ParserRuleContext { - public OpcodeContext opcode() { - return getRuleContext(OpcodeContext.class,0); - } - public VariableContext variable() { - return getRuleContext(VariableContext.class,0); - } - public TerminalNode LOC() { return getToken(pdp7Parser.LOC, 0); } - public TerminalNode RELOC() { return getToken(pdp7Parser.RELOC, 0); } - public SymbolContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_symbol; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterSymbol(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitSymbol(this); - } - } - - public final SymbolContext symbol() throws RecognitionException { - SymbolContext _localctx = new SymbolContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_symbol); - try { - setState(94); - switch (_input.LA(1)) { - case T__3: - case T__4: - case T__5: - case T__6: - case T__7: - case T__8: - case T__9: - case T__10: - case T__11: - case T__12: - case T__13: - case T__14: - case T__15: - case T__16: - case T__17: - case T__18: - case T__19: - case T__20: - case T__21: - case T__22: - case T__23: - case T__24: - case T__25: - case T__26: - case T__27: - case T__28: - case T__29: - case T__30: - case T__31: - case T__32: - case T__33: - case T__34: - case T__35: - case T__36: - case T__37: - case T__38: - case T__39: - case T__40: - case T__41: - case T__42: - case T__43: - case T__44: - case T__45: - case T__46: - case T__47: - case T__48: - case T__49: - case T__50: - case T__51: - case T__52: - case T__53: - case T__54: - case T__55: - case T__56: - case T__57: - case T__58: - case T__59: - case T__60: - case T__61: - case T__62: - case T__63: - case T__64: - case T__65: - case T__66: - case T__67: - case T__68: - case T__69: - case T__70: - case T__71: - case T__72: - case T__73: - case T__74: - case T__75: - case T__76: - case T__77: - case T__78: - case T__79: - case T__80: - case T__81: - case T__82: - case T__83: - case T__84: - case T__85: - case T__86: - case T__87: - case T__88: - case T__89: - case T__90: - case T__91: - case T__92: - case T__93: - enterOuterAlt(_localctx, 1); - { - setState(90); - opcode(); - } - break; - case IDENTIFIER: - enterOuterAlt(_localctx, 2); - { - setState(91); - variable(); - } - break; - case LOC: - enterOuterAlt(_localctx, 3); - { - setState(92); - match(LOC); - } - break; - case RELOC: - enterOuterAlt(_localctx, 4); - { - setState(93); - match(RELOC); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ExpressionContext extends ParserRuleContext { - public List multiplyingExpression() { - return getRuleContexts(MultiplyingExpressionContext.class); - } - public MultiplyingExpressionContext multiplyingExpression(int i) { - return getRuleContext(MultiplyingExpressionContext.class,i); - } - public List PLUS() { return getTokens(pdp7Parser.PLUS); } - public TerminalNode PLUS(int i) { - return getToken(pdp7Parser.PLUS, i); - } - public List MINUS() { return getTokens(pdp7Parser.MINUS); } - public TerminalNode MINUS(int i) { - return getToken(pdp7Parser.MINUS, i); - } - public ExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitExpression(this); - } - } - - public final ExpressionContext expression() throws RecognitionException { - ExpressionContext _localctx = new ExpressionContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_expression); - int _la; - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(96); - multiplyingExpression(); - setState(101); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,10,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(97); - _la = _input.LA(1); - if ( !(_la==PLUS || _la==MINUS) ) { - _errHandler.recoverInline(this); - } else { - consume(); - } - setState(98); - multiplyingExpression(); - } - } - } - setState(103); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,10,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class MultiplyingExpressionContext extends ParserRuleContext { - public List atom() { - return getRuleContexts(AtomContext.class); - } - public AtomContext atom(int i) { - return getRuleContext(AtomContext.class,i); - } - public List TIMES() { return getTokens(pdp7Parser.TIMES); } - public TerminalNode TIMES(int i) { - return getToken(pdp7Parser.TIMES, i); - } - public List DIV() { return getTokens(pdp7Parser.DIV); } - public TerminalNode DIV(int i) { - return getToken(pdp7Parser.DIV, i); - } - public MultiplyingExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_multiplyingExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterMultiplyingExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitMultiplyingExpression(this); - } - } - - public final MultiplyingExpressionContext multiplyingExpression() throws RecognitionException { - MultiplyingExpressionContext _localctx = new MultiplyingExpressionContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_multiplyingExpression); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(104); - atom(); - setState(109); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==TIMES || _la==DIV) { - { - { - setState(105); - _la = _input.LA(1); - if ( !(_la==TIMES || _la==DIV) ) { - _errHandler.recoverInline(this); - } else { - consume(); - } - setState(106); - atom(); - } - } - setState(111); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AtomContext extends ParserRuleContext { - public VariableContext variable() { - return getRuleContext(VariableContext.class,0); - } - public TerminalNode LOC() { return getToken(pdp7Parser.LOC, 0); } - public TerminalNode CHAR() { return getToken(pdp7Parser.CHAR, 0); } - public TerminalNode RELOC() { return getToken(pdp7Parser.RELOC, 0); } - public StringContext string() { - return getRuleContext(StringContext.class,0); - } - public TerminalNode DECIMAL() { return getToken(pdp7Parser.DECIMAL, 0); } - public TerminalNode DECIMAL_MINUS() { return getToken(pdp7Parser.DECIMAL_MINUS, 0); } - public TerminalNode OCTAL() { return getToken(pdp7Parser.OCTAL, 0); } - public TerminalNode NUMERIC_LITERAL() { return getToken(pdp7Parser.NUMERIC_LITERAL, 0); } - public AtomContext atom() { - return getRuleContext(AtomContext.class,0); - } - public AtomContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_atom; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterAtom(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitAtom(this); - } - } - - public final AtomContext atom() throws RecognitionException { - AtomContext _localctx = new AtomContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_atom); - try { - setState(123); - switch (_input.LA(1)) { - case IDENTIFIER: - enterOuterAlt(_localctx, 1); - { - setState(112); - variable(); - } - break; - case LOC: - enterOuterAlt(_localctx, 2); - { - setState(113); - match(LOC); - } - break; - case CHAR: - enterOuterAlt(_localctx, 3); - { - setState(114); - match(CHAR); - } - break; - case RELOC: - enterOuterAlt(_localctx, 4); - { - setState(115); - match(RELOC); - } - break; - case STRING: - enterOuterAlt(_localctx, 5); - { - setState(116); - string(); - } - break; - case DECIMAL: - enterOuterAlt(_localctx, 6); - { - setState(117); - match(DECIMAL); - } - break; - case DECIMAL_MINUS: - enterOuterAlt(_localctx, 7); - { - setState(118); - match(DECIMAL_MINUS); - } - break; - case OCTAL: - enterOuterAlt(_localctx, 8); - { - setState(119); - match(OCTAL); - } - break; - case NUMERIC_LITERAL: - enterOuterAlt(_localctx, 9); - { - setState(120); - match(NUMERIC_LITERAL); - } - break; - case MINUS: - enterOuterAlt(_localctx, 10); - { - setState(121); - match(MINUS); - setState(122); - atom(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class StringContext extends ParserRuleContext { - public TerminalNode STRING() { return getToken(pdp7Parser.STRING, 0); } - public List NUMERIC_LITERAL() { return getTokens(pdp7Parser.NUMERIC_LITERAL); } - public TerminalNode NUMERIC_LITERAL(int i) { - return getToken(pdp7Parser.NUMERIC_LITERAL, i); - } - public StringContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_string; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterString(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitString(this); - } - } - - public final StringContext string() throws RecognitionException { - StringContext _localctx = new StringContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_string); - int _la; - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(125); - match(STRING); - setState(129); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,13,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(126); - match(NUMERIC_LITERAL); - } - } - } - setState(131); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,13,_ctx); - } - setState(133); - _la = _input.LA(1); - if (_la==T__2) { - { - setState(132); - match(T__2); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class EolContext extends ParserRuleContext { - public TerminalNode EOL() { return getToken(pdp7Parser.EOL, 0); } - public EolContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_eol; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterEol(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitEol(this); - } - } - - public final EolContext eol() throws RecognitionException { - EolContext _localctx = new EolContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_eol); - try { - enterOuterAlt(_localctx, 1); - { - setState(135); - match(EOL); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class CommentContext extends ParserRuleContext { - public TerminalNode COMMENT() { return getToken(pdp7Parser.COMMENT, 0); } - public CommentContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_comment; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterComment(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitComment(this); - } - } - - public final CommentContext comment() throws RecognitionException { - CommentContext _localctx = new CommentContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_comment); - try { - enterOuterAlt(_localctx, 1); - { - setState(137); - match(COMMENT); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class LabelContext extends ParserRuleContext { - public TerminalNode LABEL() { return getToken(pdp7Parser.LABEL, 0); } - public LabelContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_label; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterLabel(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitLabel(this); - } - } - - public final LabelContext label() throws RecognitionException { - LabelContext _localctx = new LabelContext(_ctx, getState()); - enterRule(_localctx, 30, RULE_label); - try { - enterOuterAlt(_localctx, 1); - { - setState(139); - match(LABEL); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class VariableContext extends ParserRuleContext { - public TerminalNode IDENTIFIER() { return getToken(pdp7Parser.IDENTIFIER, 0); } - public VariableContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_variable; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterVariable(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitVariable(this); - } - } - - public final VariableContext variable() throws RecognitionException { - VariableContext _localctx = new VariableContext(_ctx, getState()); - enterRule(_localctx, 32, RULE_variable); - try { - enterOuterAlt(_localctx, 1); - { - setState(141); - match(IDENTIFIER); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class OpcodeContext extends ParserRuleContext { - public OpcodeContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_opcode; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterOpcode(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitOpcode(this); - } - } - - public final OpcodeContext opcode() throws RecognitionException { - OpcodeContext _localctx = new OpcodeContext(_ctx, getState()); - enterRule(_localctx, 34, RULE_opcode); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(143); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41) | (1L << T__42) | (1L << T__43) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48) | (1L << T__49) | (1L << T__50) | (1L << T__51) | (1L << T__52) | (1L << T__53) | (1L << T__54) | (1L << T__55) | (1L << T__56) | (1L << T__57) | (1L << T__58) | (1L << T__59) | (1L << T__60) | (1L << T__61) | (1L << T__62))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__64 - 64)) | (1L << (T__65 - 64)) | (1L << (T__66 - 64)) | (1L << (T__67 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__71 - 64)) | (1L << (T__72 - 64)) | (1L << (T__73 - 64)) | (1L << (T__74 - 64)) | (1L << (T__75 - 64)) | (1L << (T__76 - 64)) | (1L << (T__77 - 64)) | (1L << (T__78 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (T__81 - 64)) | (1L << (T__82 - 64)) | (1L << (T__83 - 64)) | (1L << (T__84 - 64)) | (1L << (T__85 - 64)) | (1L << (T__86 - 64)) | (1L << (T__87 - 64)) | (1L << (T__88 - 64)) | (1L << (T__89 - 64)) | (1L << (T__90 - 64)) | (1L << (T__91 - 64)) | (1L << (T__92 - 64)) | (1L << (T__93 - 64)))) != 0)) ) { - _errHandler.recoverInline(this); - } else { - consume(); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3q\u0094\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\3\2\6\2(\n\2\r\2\16\2)\3\2\5\2-\n\2\3\2\3\2\3\3\5\3\62\n\3"+ - "\3\3\5\3\65\n\3\3\4\3\4\3\4\3\5\3\5\3\5\7\5=\n\5\f\5\16\5@\13\5\3\6\7"+ - "\6C\n\6\f\6\16\6F\13\6\3\6\3\6\3\6\7\6K\n\6\f\6\16\6N\13\6\3\7\3\7\7\7"+ - "R\n\7\f\7\16\7U\13\7\3\b\3\b\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\5\na\n\n"+ - "\3\13\3\13\3\13\7\13f\n\13\f\13\16\13i\13\13\3\f\3\f\3\f\7\fn\n\f\f\f"+ - "\16\fq\13\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\5\r~\n\r\3\16"+ - "\3\16\7\16\u0082\n\16\f\16\16\16\u0085\13\16\3\16\5\16\u0088\n\16\3\17"+ - "\3\17\3\20\3\20\3\21\3\21\3\22\3\22\3\23\3\23\3\23\2\2\24\2\4\6\b\n\f"+ - "\16\20\22\24\26\30\32\34\36 \"$\2\5\3\2cd\3\2ef\3\2\6`\u009b\2\'\3\2\2"+ - "\2\4\61\3\2\2\2\6\66\3\2\2\2\b9\3\2\2\2\nD\3\2\2\2\fO\3\2\2\2\16V\3\2"+ - "\2\2\20X\3\2\2\2\22`\3\2\2\2\24b\3\2\2\2\26j\3\2\2\2\30}\3\2\2\2\32\177"+ - "\3\2\2\2\34\u0089\3\2\2\2\36\u008b\3\2\2\2 \u008d\3\2\2\2\"\u008f\3\2"+ - "\2\2$\u0091\3\2\2\2&(\5\6\4\2\'&\3\2\2\2()\3\2\2\2)\'\3\2\2\2)*\3\2\2"+ - "\2*,\3\2\2\2+-\5\4\3\2,+\3\2\2\2,-\3\2\2\2-.\3\2\2\2./\7\2\2\3/\3\3\2"+ - "\2\2\60\62\5\b\5\2\61\60\3\2\2\2\61\62\3\2\2\2\62\64\3\2\2\2\63\65\5\36"+ - "\20\2\64\63\3\2\2\2\64\65\3\2\2\2\65\5\3\2\2\2\66\67\5\4\3\2\678\5\34"+ - "\17\28\7\3\2\2\29>\5\n\6\2:;\7\3\2\2;=\5\n\6\2<:\3\2\2\2=@\3\2\2\2><\3"+ - "\2\2\2>?\3\2\2\2?\t\3\2\2\2@>\3\2\2\2AC\5 \21\2BA\3\2\2\2CF\3\2\2\2DB"+ - "\3\2\2\2DE\3\2\2\2EL\3\2\2\2FD\3\2\2\2GK\5\f\7\2HK\5\20\t\2IK\5\24\13"+ - "\2JG\3\2\2\2JH\3\2\2\2JI\3\2\2\2KN\3\2\2\2LJ\3\2\2\2LM\3\2\2\2M\13\3\2"+ - "\2\2NL\3\2\2\2OS\5$\23\2PR\5\16\b\2QP\3\2\2\2RU\3\2\2\2SQ\3\2\2\2ST\3"+ - "\2\2\2T\r\3\2\2\2US\3\2\2\2VW\5\24\13\2W\17\3\2\2\2XY\5\22\n\2YZ\7\4\2"+ - "\2Z[\5\24\13\2[\21\3\2\2\2\\a\5$\23\2]a\5\"\22\2^a\7a\2\2_a\7b\2\2`\\"+ - "\3\2\2\2`]\3\2\2\2`^\3\2\2\2`_\3\2\2\2a\23\3\2\2\2bg\5\26\f\2cd\t\2\2"+ - "\2df\5\26\f\2ec\3\2\2\2fi\3\2\2\2ge\3\2\2\2gh\3\2\2\2h\25\3\2\2\2ig\3"+ - "\2\2\2jo\5\30\r\2kl\t\3\2\2ln\5\30\r\2mk\3\2\2\2nq\3\2\2\2om\3\2\2\2o"+ - "p\3\2\2\2p\27\3\2\2\2qo\3\2\2\2r~\5\"\22\2s~\7a\2\2t~\7n\2\2u~\7b\2\2"+ - "v~\5\32\16\2w~\7j\2\2x~\7l\2\2y~\7k\2\2z~\7i\2\2{|\7d\2\2|~\5\30\r\2}"+ - "r\3\2\2\2}s\3\2\2\2}t\3\2\2\2}u\3\2\2\2}v\3\2\2\2}w\3\2\2\2}x\3\2\2\2"+ - "}y\3\2\2\2}z\3\2\2\2}{\3\2\2\2~\31\3\2\2\2\177\u0083\7m\2\2\u0080\u0082"+ - "\7i\2\2\u0081\u0080\3\2\2\2\u0082\u0085\3\2\2\2\u0083\u0081\3\2\2\2\u0083"+ - "\u0084\3\2\2\2\u0084\u0087\3\2\2\2\u0085\u0083\3\2\2\2\u0086\u0088\7\5"+ - "\2\2\u0087\u0086\3\2\2\2\u0087\u0088\3\2\2\2\u0088\33\3\2\2\2\u0089\u008a"+ - "\7p\2\2\u008a\35\3\2\2\2\u008b\u008c\7o\2\2\u008c\37\3\2\2\2\u008d\u008e"+ - "\7g\2\2\u008e!\3\2\2\2\u008f\u0090\7h\2\2\u0090#\3\2\2\2\u0091\u0092\t"+ - "\4\2\2\u0092%\3\2\2\2\21),\61\64>DJLS`go}\u0083\u0087"; - 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); - } - } -} \ No newline at end of file diff --git a/pdp7parse/src/main/java/pdp7.tokens b/pdp7parse/src/main/java/pdp7.tokens deleted file mode 100644 index ac0ce5d..0000000 --- a/pdp7parse/src/main/java/pdp7.tokens +++ /dev/null @@ -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 diff --git a/pdp7parse/src/main/java/pdp7Lexer.tokens b/pdp7parse/src/main/java/pdp7Lexer.tokens deleted file mode 100644 index ac0ce5d..0000000 --- a/pdp7parse/src/main/java/pdp7Lexer.tokens +++ /dev/null @@ -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 diff --git a/pdp7parse/src/test/java/com/khubla/pdp7parse/BasicTests.java b/pdp7parse/src/test/java/com/khubla/pdp7parse/BasicTests.java deleted file mode 100644 index ade4dea..0000000 --- a/pdp7parse/src/test/java/com/khubla/pdp7parse/BasicTests.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.khubla.pdp7parse; - -/* -* Copyright 2016, Tom Everett -* -* 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 . -*/ -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 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(); - } - } -} diff --git a/pdp7parse/src/test/resources/adm.s b/pdp7parse/src/test/resources/adm.s deleted file mode 100644 index f747395..0000000 --- a/pdp7parse/src/test/resources/adm.s +++ /dev/null @@ -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;;;;012 -m2s = .-m1 -m2: - ;;;;;;;;;;040;;040;;;;;;;;;;;;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;;;;012 -m1s = .-m1 -m2: - ;;;;;;;;;;040;;040;;;;;;;;;;;;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;> " '>' error: past end of memory - dzm dot+1 " start again at zero! - jmp assm1 - -assm3: - lac rand - sad d2 - jmp assm4 " yes - sza - jmp assm6 - lac rator " fetch operator - sza " ":"? - jmp assm6 " no - lac rand+1 - jms betwen; dm1; d10 " numeric and 0..9? - jmp assm6 " no - dac name " yes, save as name - tad fbxp - dac lvrand - lac i lvrand " get fbx entry - dac name+1 " save in second word of name - isz i lvrand " increment fbx entry - lac o146 " get 'f' - dac name+2 " save in third word of name - dzm name+3 " clear fourth word - jms tlookup " look it up - -1 -"** 05-1-4.pdf page 33 - dac fbflg " set fbflg to -1 -assm4: - lac rand+1 - tad d4 - dac lvrand - lac rator " get operator - sza " ':'? - jmp assm5 " no - lac dot " load dot type - dac r " save as r type - lac dot+1 " get dot value - dac r+1 " save as r value - jmp 1f - -assm5: - jms gpair - jms expr -1: - lac r - dac i lvrand - isz lvrand - lac r+1 - dac i lvrand - lac fbflg - sna " fb flag set? - jmp assm1 " no - dzm fbflg " clear fb flag - dzm name+1 - lac o142 " get 'b' - dac name+2 - jms lookup - jmp assm4 - -assm6: - jms error; x> " "x" error -- various errors - jmp assm1 - -init1: 0 " init for pass 1 - lac d1 - sys write; 1f; 2f-1f " output I, newline - dzm passno " clear passno - lac o56040 " load ". " - dac dot-4 - lac o56056 " load ".." - dac cmflx-4 - lac o40040 " pad ". " and ".." names with spaces - dac dot-3 - dac dot-2 - dac dot-1 - dac cmflx-3 - dac cmflx-2 - dac cmflx-1 - dzm iof " clear input fd - jms init - jmp i init1 -1: - 0111012 " I\n -2: - -init2: 0 " start pass 2 - lac d1 -"** 05-1-4.pdf page 34 - dac passno " passno = 1 - sys write; 1f; 2f-1f " output II - jms init - lac o17 - sys creat; 2f " create a.out - dac bfo - sys open; 2f; 0 " open a.out for read too! - dac bfi - dzm bufadd - jms copyz; buf; 64 " clear buffer - jmp i init2 -1: - 0111111;012000 " II\n -2: - 0141056;0157165;0164040;040040 " a.out - -init: 0 " common init for both passes - lac i 017777 - dac narg " save arg count - lac 017777 - tad d1 - dac fname " point to first file name - -1 - dac eofflg - jms ioinit - dzm savchr " clear saved char - dzm comflg " clear line comment flag - lac d1 - dac dot " set "." type to one?? - dzm dot+1 " clear "." value?? - dzm cmflx " set ".." type to zero?? - lac d4096 " set ".." value to 4K - dac cmflx+1 - dzm fbflg " clear f/b flag and array - jms copyz; fbxp: fbx; 10 - jmp i init " return - -finis: - lac iof " close input file - sys close - jms bufwr " flush output buffer - lac bfi " close a.out input fd - sys close - lac bfo " close a.out output fd - sys close - -1 - tad namsiz - cma " get positive count of namelist entries - rcl " multiply by 6 to get words - dac char - rcl - tad char - dac 1f - lac o17 " ?? creat mode bits?? - sys creat; n.out " create "n.out" - dac bfi - sys write; namlst; 1: 0 " write name list - lac bfi - sys close " close n.out - sys exit - -"** 05-1-4.pdf page 35 -n.out: - 0156056;0157165;0164040;040040 " n.out - -process: 0 - lac dot+1 " get "." value - dac lvrand - lac dot " get "." type?? - sad d3 " three (user defined symbol?)? - jmp proc4 " yes, give "." error - sza " zero? - jmp proc1 " no - -1 " yes (".." type) - tad cmflx+1 - cma - tad lvrand " get "." - ".." - dac lvrand - -proc1: - lac lvrand - spa " is relocated value positive? - jmp proc4 " no, give "." error - and o17700 " mask to block - sad bufadd " same block as buffer? - jmp proc2 " yes, same block - jms bufwr " different block, write out current block - jms copyz; buf; 64 " clear buffer - lac lvrand - and o17700 - dac bufadd - dac 1f - lac bfi - sys seek; 1: 0; 0 " seek to current block from file - spa - jmp proc2 - lac bfi - sys read; buf; 64 - -proc2: - lac lvrand " destination address - and o77 " word within block - jms betwen; dm1; maxsto " inside buffer? - dac maxsto " no, increment buffer size - tad bufp " add pointer to buffer - dac lvrand " save buffer pointer - lac r " get r type? - sna " non-zero ("." or label)? - jmp proc3 " no: zero (..) - sad d3 " three (user label)? - jmp proc5 " yes - lac cmflx+1 " get ".." value - tad r+1 " add to r value - dac r+1 - -proc3: - lac r+1 " get r value - dac i lvrand " save in buffer - jmp i process " return - -proc4: - jms error; .> - lac d1 - dac dot " set '.' type to 1 -"** 05-1-4.pdf page 36 - dzm dot+1 " clear dot value - jmp skip - -proc5: - jms error; u> - jmp proc3 - -bufwr: 0 " write current buffer to a.out file - lac bfo - sys seek; bufadd: 0; 0 - isz maxsto - lac bfo - sys write; bufp: buf; maxsto: -1 - -1 - dac maxsto - jmp i bufwr - -number: 0 " print decimal number: append to buffer at index 8 - dac 3f " save number - lac d1000 - dac 2f " save divisor -1: - lac 3f - cll - idiv; 2: 0 - dac 3f - lacq - tad o60 " add ascii '0' - dac i 8 " save char - lac 2b - cll - idiv; 10 - lacq - dac 2b - sza - jmp 1b - jmp i number -3: 0 - - " get character from buffer (two characters per word) - " call with: - " jms getsc; pointer_pointer - " where pointer_pointer refers to a pointer to buffer - " high bit in pointer indicates low char is next -getsc: 0 - lac i getsc " get pointer pointer - dac sctalp " save - isz getsc " skip pointer pointer - lac i sctalp " fetch pointer - dac sctal " save - add o400000 " toggle high bit, increment on wrap - dac i sctalp " save pointer back - ral " rotate high bit into link reg - lac i sctal " load word from buffer - szl " skip if link zero - lrss 9 " link set: get high char from word - and o177 " strip to 7 bits - jmp i getsc " return - - " save characters: word after call is addr of pointer, -count pair - " high bit in pointer used to indicate high/low -putsc: 0 - and o177 " strip character to 7 bits - lmq " save in MQ - lac i putsc " get address of pointer - dac sctalp " save - isz putsc " skip over pointer to pointer -"** 05-1-4.pdf page 37 - lac i sctalp " get pointer - dac sctal " save - add o400000 " toggle pointer sign bit, increment on wrap - dac i sctalp " save pointer - sma cla " skip if minus & clear AC - jmp 1f " AC positive - llss 27 " get char in high 9 bits, zero in low - dac i sctal " store word - lrss 9 " shift char back down - jmp i putsc " return - -1: - lac i sctal " load target word - omq " or in low char from MQ - dac i sctal " save word back - lacq " restore character - jmp i putsc " return - -sctalp: 0 -sctal: 0 - - " test if between two values (low,high] - " call with value in AC - " jms betwen; lowptr; highptr - " skip returns if AC in range - " AC returned unmodified - " NOTE! - " the test appears to be non-inclusive - " on the low side, and inclusive on the high side - -betwen: 0 - dac 2f " save value to test - lac i betwen " load range start addr - dac 3f " save - isz betwen " increment return PC - lac i 3f " load range start - cma " complement - tad 2f " AC = AC - start - 1 - spa " still positive? - jmp 1f " no - lac i betwen " load range end addr - dac 3f " save - isz betwen " skip range high on return - lac i 3f " load range high - cma - tad d1 " negate AC (~AC + 1) - tad 2f " add test value - spa " if not positive, don't skip on return!! -1: - isz betwen " discard "high" (or skip return)! - lac 2f " restore AC - jmp i betwen " return -2: 0 -3: 0 - - " zero a block of memory - " call with: - " jms copyz; ptr; count -copyz: 0 - -1 - tad i copyz " get address-1 - dac 8 " store in first "index register" - isz copyz " skip over address - lac i copyz " load count - cma " get -count - tad d1 - dac 2f " save - isz copyz " skip over count -1: - dzm i 8 " increment index, clear word - isz 2f " increment count, skip if done - jmp 1b " not done, loop - jmp i copyz " done: return -"** 05-1-4.pdf page 38 -2: 0 - -error: 0 - lac passno " get pass number - sza " pass one? - jmp 1f " no, pass two - isz error " pass one: skip error char - jmp i error " return -1: - -1 - tad mesp " get mes-1 - dac 8 " save as index - lac i error " get error - dac i 8 " save in mess - lac o40 " get space - dac i 8 " save in mess - lac rator " get operator - sad d5 " word break (semi, newline)? - jmp 1f " yes - lac savchr " no, get saved char - sad o12 " newline? - jmp 1f " yes - lac lineno " get lineno - jmp 2f -1: - -1 - tad lineno " get lineno -1 -2: - jms number " convert line number to ascii - lac o12 " get newline - dac i 8 " append to mess - -2 - tad mesp - cma - tad 8 - dac 1f - lac d1 - sys write; mesp: mes; 1: 0 - isz error - jmp i error - -skip: - lac rator " get operator - sad d5 " EOL? - jmp assm1 " yes, start from top -1: - jms gchar " loop until ';' or NL seen - sad d5 " EOL? - jmp assm1 " yes, start from top - jmp 1b - -ioinit: 0 - jms copyz; iobuf; 64 " clear iobuf - lac iof - sys read; iobufp: iobuf; 64 " read from input - sna " EOF? - jms nextfil " yes, skip to next file - lac iobufp " load iobuf pointer - dac tal " save - -129 " get -bytecount-1 - dac talc " save as count -"** 05-1-4.pdf page 39 - jmp i ioinit " return - -nextfil: 0 " advance to next file - lac d1 - dac lineno " reset lineno to 1 - lac iof " load input fd - sza " zero? - sys close " no: close -nf1: - lac narg " load arg count - sad d4 " ==4? (done) - skp " yes, skip - jmp 1f " no - dzm eofflg " flag eof (set to zero) - jmp i nextfil " return -1: - tad dm4 " subtract 4 - dac narg " store narg - lac fname " get fname pointer - tad d4 " subtract 4 - dac fname " save fname - sys open; fname: 0; 0 " open fname - dac iof " save fd - sma " open ok? - lac passno " yes, load pass number - sna " open failed: skip or open ok, pass 2 - jmp nextfil i " pass 1, open OK, return. - lac fname " load filename pointer - dac 1f " save for write - lac d1 " stdout - sys write; 1; 0; 4 " output filename - lac iof " load fd - sma " open ok? - jmp 1f " yes, continue - lac d1 - sys write; emes; 2 " output "? \n" - sys exit " quit. -1: - lac d1 - sys write; emes+1; 1 " output newline after filename - jmp i nextfil " return -emes: - 040077;012000 " question mark, space, newline - -gchar: 0 - lac savchr " load saved char - dzm savchr " clear saved char - sza " was there a saved char? - jmp gch3 " yes, process it - lac eofflg " no: get eof flag - sza " seen eof (zero if true) - jmp 1f " no. - lac o12 " yes: get NL - jmp gch3 " process it -1: - isz talc " increment (negative count): is it zero? - skp " non-zero: skip - jms ioinit " count was zero: call ioinit - jms getsc; tal " fetch character - sna " is char non-zero? - jmp gchar+1 " no: char is zero, get another -"** 05-1-4.pdf page 40 - sad o177 " is char 0177 - jmp gchar+1 " yes, ignore it - sad o12 " is char newline? - skp " yes - jmp 1f " no - dzm comflg " saw newline: clear comflg - isz lineno " increment line number -1: - sad o42 " is char '"'? - dac comflg " yes, set comflg - dac char " save char - lac comflg " load comflg - sza " comflg clear? - jmp gchar+1 " no: ignore reset of line - lac char " get char - -gch3: - dac char " save char in char - jms betwen; d0; o200 " legal char? - cla " no, clear - tad lactab " add to "lac labtab+1" - dac .+1 " save as next instruction - lac 0 " get character class in AC - jmp i gchar " return - -gsymb: 0 - jms gchar " get char - dac rator " save class - tad jmpsw1 " add table base instruction - dac 1f " save for later - lac char " what was it? - sad o74 " '<'?? - jmp lqot " yes: process as "left quote" - dac namc " no, save as namc - jms gchar " get another - lac char " what was it? - sad o76 " '>'? - jmp rqot " yes: process "right quote" - dac savchr " no: save as savchr - lac namc " restore first char - dac char " resave as "char" -1: - jmp 0 " jmpsw1[0] + class -jmpsw1: " indexed by character class - jmp .+1 " base instruction (added to class) - jmp i gsymb " 0: ":" return - jmp i gsymb " 1: "=" return - jmp i gsymb " 2: "+" return - jmp i gsymb " 3: "-" return - jmp gs1 " 4: comma, space, tab - jmp i gsymb " 5: EOL (semi, newline) - jmp gs2 " 6: dot, star, letter - jmp gs3 " 7: digits - -badchr: " here with bad char (class 8) - jms error; g> " error "g" -1: - jms gchar " discard until newline - lac char - sad o12 -"** 05-1-4.pdf page 41 - skp - jmp 1b - dac savchr " push newline back - jmp gsymb+1 " restart gsymb - -lqot: " left quote (<) - jms gchar " get another char - lac o40 - dac savchr " put a space in savchr - lac char " get quoted character - alss 9 " shift up 9 bits - jmp 1f " join with right quote - -rqot: " right quote (>) - lac namc " get previous(?) char -1: - dac rand+1 " save value - lac d7 " return as literal - dac rator - jmp i gsymb - -gs1: " here with space, tab, comma - jms gchar " get another char - sad d4 " another space? - jmp gs1 " yes, loop - lac char " no, save for later - dac savchr - jmp i gsymb " return - -gs2: " here with dot, star, letter - lac namep " load name buffer pointer - dac tal1 " save in temp pointer - -7 " load negative char count - dac tal1c " save as temp counter - lac char " restore char - jms putsc; tal1 " save it in name buffer - -gnam1: " here to collect a name - jms gchar - jms betwen; d5; d8 " alphanumeric? - jmp gnam3 " no, done - lac char - jms putsc; tal1 - isz tal1c - jmp gnam1 - -gnam2: " here when 8 characters read, eat the rest - jms gchar " next char - jms betwen; d5; d8 " alphanumeric? - skp " no - jmp gnam2 " yes, loop - lac char - dac savchr " push last char back - jms lookup " look up symbol - jmp i gsymb " return - -gnam3: " here before 8 characters - lac char " push last char back - dac savchr -1: - lac o40 " pad to 8 with spaces -"** 05-1-4.pdf page 42 - jms putsc; tal1 - isz tal1c - jmp 1b - jms lookup - jmp i gsymb - -gs3: " here with digit - dzm rand+1 " clear number - lac char - sad o60 " zero? - jmp 1f " yes - lac d10 " no: process as decimal - jmp 2f -1: - lac d8 " leading zero: process as octal -2: - dac num2 " save radix - -num1: - lac rand+1 " get number - cll " clear link - mul " mutiply by radix -num2: 0 " (radix stored here) - lacq " get multiply result - tad char " add char - tad dm48 " subtract '0' - dac rand+1 " save - jms gchar " get another - sad d7 " digit? - jmp num1 " yes: process - lac char " no: get it - dac savchr " push back - lac rand+1 " get number - jms betwen; dm1; d10 " between 0..9? - jmp i gsymb " no, return - dac name - tad fbxp " make index into "fbx" array - dac name+1 " ???save??? (crushed below) - lac i name+1 " fetch fbx array entry - dac name+1 " save fbx count in name - lac savchr " get break character - sad o146 " was it 'f'? - jmp 1f " yes - sad o142 " 'b'? - skp " yes - jmp i gsymb " not f or b, return - dzm name+1 " 'b': clear loaded fbx entry???? -1: " here with DIGITS[fb] - dac name+2 " save f/b in third word of name - dzm name+3 " clear last word of name - lac d6 " class 6: alpha, dot star - dac rator " save as (ope)rator - jms lookup " lookup (create) symbol entry???? - dzm savchr " clear saved char - jmp i gsymb - - " symbol lookup/creation - " tlookup doesn't create new entries??? -tlookup: 0 - jmp 1f -lookup: 0 - dzm tlookup " NOT a tlookup call -1: -"** 05-1-4.pdf page 43 - -1 - tad namlstp - dac 8 " get namelist ptr in index reg - lac namsiz - dac namc " negative namelist size in namc -lu1: - lac i 8 " get first word of namelist entry - sad name " match name? - jmp 1f " yes - lac d5 " no, skip next 5 words -lu2: - tad 8 - dac 8 - isz namc " at end of list? - jmp lu1 " no, keep going - lac tlookup " yes, reached end - sna " was tlookup? - jmp 2f " no, was lookup - lac fnamep - dac rand+1 " set rand+1 (value?) to fakename - jmp i tlookup " return -2: - lac name " make new entry - dac i 8 " save word one of name - lac 8 - dac rand+1 - lac name+1 - dac i 8 " save word two - lac name+2 - dac i 8 " save word three - lac name+3 - dac i 8 " save word four - lac d3 - dac i 8 " set type(?) to three - dzm i 8 " clear value?? - -1 " decrement namsiz - tad namsiz - dac namsiz - jmp i lookup " return -1: " here when first word matched - lac i 8 - sad name+1 " check second word - jmp 1f " matched, keep going - lac d4 " no match: skip ahead four words - jmp lu2 -1: - lac i 8 - sad name+2 " does third word match? - jmp 1f " yes, keep going - lac d3 " no, skip ahead three words - jmp lu2 -1: - lac i 8 - sad name+3 " final word match? - jmp 1f " yes - lac d2 " no, skip two words - jmp lu2 -1: " name matched - -3 - tad 8 " get next word minus three - dac rand+1 " return as value -"** 05-1-4.pdf page 44 - lac tlookup - sza - jmp i tlookup - jmp i lookup -namep: name - -gpair: 0 - jms gsymb " get a symbol - lac rator " get operator - sad d4 " space tab or comma? - jmp gpair+1 " yes, get another - jms betwen; dm1; d6 " plus, minus, comma, semi? - jmp gp1 " no - dzm rand " clear "rand" - dzm rand+1 - jmp i gpair " return -gp1: - sad d7 " digit?? - lac d4 " yes: switch to space?? - tad dm4 " subtract 4?? - dac rand " save as operand?? - jms gsymb - lac rator - sad d4 " whitespace? - jmp gp2 " yes - jms betwen; dm1; d6 " anything but digit? - skp " no, a digit - jmp i gpair " yes, return - jms error; x> " here with digit: give 'x' error - jmp skip -gp2: " here after whitespace - jms gchar " get next char - jms betwen; d5; d8 " alphanumeric? - jmp gp3 " no - lac char " yes, push back - dac savchr - jmp i gpair -gp3: - lac char " push back break char - dac savchr - jms gsymb - jmp i gpair - -expr: 0 - jms grand - -1 - dac srand -exp5: - lac rand - dac r - lac rand+1 - dac r+1 -exp1: - lac rator - jms betwen; d1; d5 " plus, minus, comma, space, tab or comma? - jmp exp3 " no - dac orator - jms gpair - jms grand - lac orator " get operator back - sad d4 " comma space or tab? -"** 05-1-4.pdf page 45 - jmp exp2 " no - jms oper; rand - jmp exp1 -exp2: - jms pickup - lac r - dac srand - lac r+1 - dac srand+1 - jmp exp5 -exp3: - sad d5 - jmp exp4 - jms error; x> - jmp skip -exp4: - jms pickup - jmp i expr - -pickup: 0 - lac srand - spa - jmp i pickup - lac d4 - jms oper; srand - jmp i pickup - -grand: 0 - lac rand - sad d2 - skp - jmp i grand - lac rand+1 - tad d4 - dac rand+1 - lac i rand+1 - dac rand - isz rand+1 - lac i rand+1 - dac rand+1 - jmp i grand - - " called with - " jms oper; argument -oper: 0 - tad opsw - dac oper1 - -1 - tad i oper " pick up argument - dac 8 " store as index - isz oper " skip argument - lac r - sad d3 - jmp oper2 - lac i 8 - sad d3 - jmp oper2 -oper1: - jmp 0 -opsw: - jmp .-1 - jmp oplus - jmp ominus -"** 05-1-4.pdf page 46 - tad r - dac r - lac r+1 - lmq - lac i 8 - omq - jmp oret -oplus: - tad r - dac r - lac r+1 - tad i 8 - jmp oret -ominus: - cma - tad d1 - tad r - dac r - -1 - tad i 8 - cma - tad r+1 -oret: - dac r+1 - lac r - jms betwen; dm1; d2 - skp - jmp i oper - jms error; r> - lac d1 - dac r - jmp i oper -oper2: - dac r - dzm r+1 - jmp i oper - -d0: 0 -d1: 1 -d4096: 4096 -d2: 2 -d3: 3 -d4: 4 -d5: 5 -d6: 6 -d7: 7 -d8: 8 -o12: d10: 10 -dm1: -1 -o40: 040 -o60: 060 -dm48: -48 -o400000: 0400000 -o177: 0177 -dm4: -4 -o200: 0200 -o42: 042 -o142: 0142 -o40040: 040040 " space, space -o56056: 056056 " ".." -o56040: 056040 " ". " -"** 05-1-4.pdf page 47 -o146: 0146 -o17777: 017777 -d1000: 1000 -o17: 017 -o17700: 017700 -o77: 077 -o74: 074 -o76: 076 - -namsiz: -2 " negative numberof namelist entries -namlstp: namlst " pointer to namelist -fnamep: fakename " pointer to fake namelist entry -lactab: lac .+1 " character (operator) class table (8 unless noted) -8;8;8;8;8;8;8;8 -8;4;5;8;8;8;8;8 " TAB=4 NL=5 -8;8;8;8;8;8;8;8 -8;8;8;8;8;8;8;8 -4;8;8;8;8;8;8;8 " SP=4 -8;8;6;2;4;3;6;8 " *=6 +=2 ,=4 -=3 .=6 -7;7;7;7;7;7;7;7 " digits=7 -7;7;0;5;8;1;8;8 " :=0 ;=5 ==1 -8;6;6;6;6;6;6;6 " A-Z=6 -6;6;6;6;6;6;6;6 -6;6;6;6;6;6;6;6 -6;6;6;8;8;8;8;8 -8;6;6;6;6;6;6;6 " a-z=6 -6;6;6;6;6;6;6;6 -6;6;6;6;6;6;6;6 -6;6;6;8;8;8;8;8 - -fbflg: .=.+1 " f/b label flag -tal: .=.+1 " iobuf pointer -talc: .=.+1 " -bytecount-1 -tal1: .=.+1 " namebuf pointer -tal1c: .=.+1 " -bytecount-1 -narg: .=.+1 " argc -lvrand: .=.+1 " numeric constant, word address -eofflg: .=.+1 " 0 on EOF?? -namc: .=.+1 " saved char, temporary -passno: .=.+1 " 0=pass1, 1=pass2 -char: .=.+1 " current character -savchr: .=.+1 " pushed back char -comflg: .=.+1 " comment flag -rator: .=.+1 " (opo)rator (char type) -orator: .=.+1 " ?? (op)orator -rand: .=.+2 " ?? (ope)rand (type/address pair) -srand: .=.+2 " ?? another operand -r: .=.+2 " ?? yet another?? -name: .=.+4 " buffer for accumulating names -buf: .=.+64 " a.out output buffer -iobuf: .=.+64 " input buffer -fbx: .=.+10 " forward/backward counters -mes: .=.+20 " (error) message buffer -iof: .=.+1 " source file fd -bfi: .=.+1 " a.out input fd -bfo: .=.+1 " a.out output fd -lineno: .=.+1 " source file line number - -fakename: .=.+6 " dummy namelist entry returned by tlookup?? -namlst: " symbol table -.=.+4 " dot name -dot: " dot type, value -.=.+6 " dot dot name -cmflx: " dotdot type, value - " namelist (symbol table) entries are 6 words. - " four words of symbol (space padded) name - " next word is type?? - " 0: initial dotdot type - " 1: initial dot type (reset on error) - " 3: set by "lookup" (user symbol) - " last word is value?? diff --git a/pdp7parse/src/test/resources/bc.s b/pdp7parse/src/test/resources/bc.s deleted file mode 100644 index b857335..0000000 --- a/pdp7parse/src/test/resources/bc.s +++ /dev/null @@ -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;;012 -mpcs = .-mpc -msp: - 012;;012 -msps = .-msp -mas: - 012;;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 diff --git a/pdp7parse/src/test/resources/bi.s b/pdp7parse/src/test/resources/bi.s deleted file mode 100644 index f8abd9d..0000000 --- a/pdp7parse/src/test/resources/bi.s +++ /dev/null @@ -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 \ No newline at end of file diff --git a/pdp7parse/src/test/resources/cat.s b/pdp7parse/src/test/resources/cat.s deleted file mode 100644 index f40fd6c..0000000 --- a/pdp7parse/src/test/resources/cat.s +++ /dev/null @@ -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: ; 040; ;;;;;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 \ No newline at end of file diff --git a/pdp7parse/src/test/resources/ds.s b/pdp7parse/src/test/resources/ds.s deleted file mode 100644 index 2aa0f93..0000000 --- a/pdp7parse/src/test/resources/ds.s +++ /dev/null @@ -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: -
; 040040; 040040; 040040 -dotdot: - 056056; 040040; 040040; 040040 -system: - ;;; 040040 -scrname: - <*s>;;040040;040040 -pass2: - [scan markup] - jmp advanc -1: - ; ; 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 \ No newline at end of file diff --git a/pdp7parse/src/test/resources/ed2.s b/pdp7parse/src/test/resources/ed2.s deleted file mode 100644 index 3345e98..0000000 --- a/pdp7parse/src/test/resources/ed2.s +++ /dev/null @@ -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 diff --git a/pdp7parse/src/test/resources/init.s b/pdp7parse/src/test/resources/init.s deleted file mode 100644 index 69284d4..0000000 --- a/pdp7parse/src/test/resources/init.s +++ /dev/null @@ -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; ;;;;;;<: 040 -m3s = .-m3 -dd: -
;040040;040040;040040 -dir: - 040040;040040;040040;040040 - -ttyin: - ;;;;; 040040 -keybd: - ;;; -displ: - ;;;; 040040;040040;040040 -system: - ;;; 040040 -password: - ;;; - -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 diff --git a/pdp7parse/src/test/resources/s1.s b/pdp7parse/src/test/resources/s1.s deleted file mode 100644 index f50088c..0000000 --- a/pdp7parse/src/test/resources/s1.s +++ /dev/null @@ -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 - diff --git a/pdp7parse/src/test/resources/s2.s b/pdp7parse/src/test/resources/s2.s deleted file mode 100644 index 4006ed5..0000000 --- a/pdp7parse/src/test/resources/s2.s +++ /dev/null @@ -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 diff --git a/pdp7parse/src/test/resources/s3.s b/pdp7parse/src/test/resources/s3.s deleted file mode 100644 index 2947c11..0000000 --- a/pdp7parse/src/test/resources/s3.s +++ /dev/null @@ -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 diff --git a/pdp7parse/src/test/resources/s4.s b/pdp7parse/src/test/resources/s4.s deleted file mode 100644 index 5d37eec..0000000 --- a/pdp7parse/src/test/resources/s4.s +++ /dev/null @@ -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 - " - " - " 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 - diff --git a/pdp7parse/src/test/resources/s5.s b/pdp7parse/src/test/resources/s5.s deleted file mode 100644 index f83f6e8..0000000 --- a/pdp7parse/src/test/resources/s5.s +++ /dev/null @@ -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 - diff --git a/pdp7parse/src/test/resources/s6.s b/pdp7parse/src/test/resources/s6.s deleted file mode 100644 index f1d07be..0000000 --- a/pdp7parse/src/test/resources/s6.s +++ /dev/null @@ -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 diff --git a/pdp7parse/src/test/resources/s7.s b/pdp7parse/src/test/resources/s7.s deleted file mode 100644 index 81034bb..0000000 --- a/pdp7parse/src/test/resources/s7.s +++ /dev/null @@ -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 diff --git a/pdp7parse/src/test/resources/s8.s b/pdp7parse/src/test/resources/s8.s deleted file mode 100644 index afce88c..0000000 --- a/pdp7parse/src/test/resources/s8.s +++ /dev/null @@ -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: - n;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 diff --git a/pdp7parse/src/test/resources/s9.s b/pdp7parse/src/test/resources/s9.s deleted file mode 100644 index 044350a..0000000 --- a/pdp7parse/src/test/resources/s9.s +++ /dev/null @@ -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 diff --git a/pdp7parse/src/test/resources/sop.s b/pdp7parse/src/test/resources/sop.s deleted file mode 100644 index 047a1ba..0000000 --- a/pdp7parse/src/test/resources/sop.s +++ /dev/null @@ -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 diff --git a/pdp7parse/src/test/resources/sysmap b/pdp7parse/src/test/resources/sysmap deleted file mode 100644 index 07bd2e5..0000000 --- a/pdp7parse/src/test/resources/sysmap +++ /dev/null @@ -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