Remove low/high byte operators until I've thought about it more.

This commit is contained in:
Chris Pressey committed 2017-11-17 15:54:50 +00:00
1 parent c26d4d7759
commit 563aaeba47
5 files changed
+3 -42

No files matched your search

+1 -1
View File
@@ -400,7 +400,7 @@ Grammar
Constrnt::= ["inputs" LocExprs] ["outputs" LocExprs] ["trashes" LocExprs].
Routine ::= "routine" Ident<new> 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.
+1
View File
@@ -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)
+1 -10
View File
@@ -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
-21
View File
@@ -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 y, >foo
| ld a, 2
| st a, <foo
| ld a, 1
| 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
-10
View File
@@ -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
| ld y, >r1
| }
= ok
Can't access an undeclared memory location.
| routine main {