From 563aaeba479496cff81ba6a6cb73983650d57e22 Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Fri, 17 Nov 2017 15:54:50 +0000 Subject: [PATCH] Remove low/high byte operators until I've thought about it more. --- doc/SixtyPical.md | 2 +- src/sixtypical/model.py | 1 + src/sixtypical/parser.py | 11 +---------- tests/SixtyPical Execution.md | 21 --------------------- tests/SixtyPical Syntax.md | 10 ---------- 5 files changed, 3 insertions(+), 42 deletions(-) diff --git a/doc/SixtyPical.md b/doc/SixtyPical.md index 0272e7a..35e20f8 100644 --- a/doc/SixtyPical.md +++ b/doc/SixtyPical.md @@ -400,7 +400,7 @@ Grammar Constrnt::= ["inputs" LocExprs] ["outputs" LocExprs] ["trashes" LocExprs]. Routine ::= "routine" Ident Constraints (Block | "@" LitWord). LocExprs::= LocExpr {"," LocExpr}. - LocExpr ::= Register | Flag | Literal | ("<" | ">") Ident. + LocExpr ::= Register | Flag | Literal | Ident. Register::= "a" | "x" | "y". Flag ::= "c" | "z" | "n" | "v". Literal ::= LitByte | LitWord. diff --git a/src/sixtypical/model.py b/src/sixtypical/model.py index 5a60382..e509e95 100644 --- a/src/sixtypical/model.py +++ b/src/sixtypical/model.py @@ -95,6 +95,7 @@ class PartRef(Ref): height=0 = low byte, height=1 = high byte. + NOTE: Not actually used yet. Might require more thought before it's usable. """ def __init__(self, ref, height): assert isinstance(ref, Ref) diff --git a/src/sixtypical/parser.py b/src/sixtypical/parser.py index e296e60..a2b3b9f 100644 --- a/src/sixtypical/parser.py +++ b/src/sixtypical/parser.py @@ -4,7 +4,7 @@ from sixtypical.ast import Program, Defn, Routine, Block, Instr from sixtypical.model import ( TYPE_BIT, TYPE_BYTE, TYPE_BYTE_TABLE, TYPE_WORD, TYPE_WORD_TABLE, RoutineType, VectorType, ExecutableType, - LocationRef, ConstantRef, PartRef + LocationRef, ConstantRef ) from sixtypical.scanner import Scanner @@ -142,16 +142,7 @@ class Parser(object): self.scanner.scan() return loc else: - op = None - if self.scanner.consume('<'): - op = '<' - elif self.scanner.consume('>'): - op = '>' loc = self.lookup(self.scanner.token) - if op == '<': - loc = PartRef(loc, 0) - elif op == '>': - loc = PartRef(loc, 1) self.scanner.scan() return loc diff --git a/tests/SixtyPical Execution.md b/tests/SixtyPical Execution.md index 25284f2..696a8dc 100644 --- a/tests/SixtyPical Execution.md +++ b/tests/SixtyPical Execution.md @@ -435,27 +435,6 @@ Copy word to word. = y: 0 = z: 0 -Load and store low byte, high byte of word. - - | word foo : 511 - | - | routine main { - | ld x, foo - | ld a, 2 - | st a, foo - | } - = a: 1 - = c: 0 - = foo: 258 - = n: 0 - = v: 0 - = x: 255 - = y: 1 - = z: 0 - Indirect call. | vector foo outputs x trashes z, n diff --git a/tests/SixtyPical Syntax.md b/tests/SixtyPical Syntax.md index 6b5126e..ad68ae7 100644 --- a/tests/SixtyPical Syntax.md +++ b/tests/SixtyPical Syntax.md @@ -164,16 +164,6 @@ User-defined locations of other types. | } = ok -Referencing low and high byte of a word. - - | word r1 - | - | routine main { - | ld x, r1 - | } - = ok - Can't access an undeclared memory location. | routine main {