aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-02-10 15:36:27 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-02-10 15:36:27 +0100
commit1a21dda59c69685fcc11d81e5fb3178f7220e021 (patch)
treea3201f7f50411048ca205c74be44bea7232ca279
parente54fde7f0bb440d0b718e837231110ed1281c5fd (diff)
...
-rw-r--r--parse.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse.go b/parse.go
index cac3549..c3ef27d 100644
--- a/parse.go
+++ b/parse.go
@@ -68,6 +68,9 @@ type ALU struct {
Ddir int8
}
+// expand 2 bit unsigned to 8 bit signed
+var expand = map[uint16]int8{0: 0, 1: 1, 2: -2, 3: -1}
+
func newALU(v uint16) ALU {
return ALU{
Opcode: (v >> 8) & 15,
@@ -101,9 +104,6 @@ func (v ALU) value() uint16 {
func (v ALU) compile() uint16 { return v.value() | (3 << 13) }
-// expand 2 bit unsigned to 8 bit signed
-var expand = map[uint16]int8{0: 0, 1: 1, 2: -2, 3: -1}
-
const (
opT = iota // 0
opN // 1