1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-06-07 06:29:32 +00:00

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

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

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.

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)

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

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

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 {