aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-01-09 02:02:39 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-01-09 02:02:39 +0100
commit305db0e2b7f725a640bf8fc8f81576208c678976 (patch)
tree2336b961a2e1f53dd4d651718da36a1cabd66407
parent2d52bd93a5f796e73a49aaccbd95ea707b18065d (diff)
...
-rw-r--r--eval.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/eval.go b/eval.go
index 8ec9e1e..70426da 100644
--- a/eval.go
+++ b/eval.go
@@ -51,7 +51,9 @@ func (j1 *J1) LoadFile(fname string) error {
// Eval evaluates content of memory
func (j1 *J1) Eval() {
for !j1.done {
- j1.eval(Decode(j1.memory[j1.pc]))
+ ins := Decode(j1.memory[j1.pc])
+ //fmt.Printf("%v\n%v", ins, j1)
+ j1.eval(ins)
}
}
@@ -90,7 +92,6 @@ func (j1 *J1) readAt(addr uint16) uint16 {
}
func (j1 *J1) eval(ins Instruction) {
- //fmt.Printf("%v\n%v", ins, j1)
j1.pc++
switch v := ins.(type) {
case Lit: