aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-02-11 05:16:00 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-02-11 05:16:00 +0100
commit0e629025c370ba512c058dc7008e2cc444c87dcb (patch)
treec2afd212db0445074d2d5bbcd9b8b4db84404f6b
parentc7b8c6dcac0d419e696b982baea05a6c31bda79c (diff)
box-drawing chars
-rw-r--r--parse.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/parse.go b/parse.go
index 14180bd..2d57948 100644
--- a/parse.go
+++ b/parse.go
@@ -28,8 +28,8 @@ type Instruction interface {
// Lit is a literal
//
// 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
-// | `-------------------------------------------- value
-// `----------------------------------------------- 1
+// │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴── value
+// └─────────────────────────────────────────────── 1
//
type Lit uint16
@@ -41,8 +41,8 @@ func (v Lit) compile() uint16 { return v.value() | (1 << 15) }
// Jump is an unconditional branch
//
// 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
-// | | | `-------------------------------------- target
-// `----------------------------------------------- 0 0 0
+// │ │ │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴── target
+// └──┴──┴───────────────────────────────────────── 0 0 0
//
type Jump uint16
@@ -54,8 +54,8 @@ func (v Jump) compile() uint16 { return v.value() }
// Cond is a conditional branch
//
// 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
-// | | | `-------------------------------------- target
-// `----------------------------------------------- 0 0 1
+// │ │ │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴── target
+// └──┴──┴───────────────────────────────────────── 0 0 1
//
type Cond uint16
@@ -67,8 +67,8 @@ func (v Cond) compile() uint16 { return v.value() | (1 << 13) }
// Call procedure
//
// 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
-// | | | `-------------------------------------- target
-// `----------------------------------------------- 0 1 0
+// │ │ │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴── target
+// └──┴──┴───────────────────────────────────────── 0 1 0
//
type Call uint16
@@ -80,15 +80,15 @@ func (v Call) compile() uint16 { return v.value() | (2 << 13) }
// ALU instruction
//
// 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
-// | | | | | | | | | | | | | | `----- dstack ±
-// | | | | | | | | | | | | `----------- rstack ±
-// | | | | | | | | | | | `-------------- unused
-// | | | | | | | | | | `----------------- N → [T]
-// | | | | | | | | | `-------------------- T → R
-// | | | | | | | | `----------------------- T → N
-// | | | | `----------------------------------- T'
-// | | | `-------------------------------------- R → PC
-// `----------------------------------------------- 0 1 1
+// │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──┴── dstack ±
+// │ │ │ │ │ │ │ │ │ │ │ │ └──┴──────── rstack ±
+// │ │ │ │ │ │ │ │ │ │ │ └────────────── unused
+// │ │ │ │ │ │ │ │ │ │ └───────────────── N → [T]
+// │ │ │ │ │ │ │ │ │ └──────────────────── T → R
+// │ │ │ │ │ │ │ │ └─────────────────────── T → N
+// │ │ │ │ └──┴──┴──┴────────────────────────── T'
+// │ │ │ └────────────────────────────────────── R → PC
+// └──┴──┴───────────────────────────────────────── 0 1 1
//
type ALU struct {
Opcode uint16