aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-02-12 05:39:36 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-02-12 05:39:36 +0100
commitfc3d8ccb1f808cab660750fe4a136e7dd384d36b (patch)
treecf242d7cb647db4d330103a78eb781392f06e14a
parentc0727804dd12084f49d043046e564c5583d6860f (diff)
full words
-rw-r--r--core.go8
-rw-r--r--core_test.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/core.go b/core.go
index df89425..72aab2c 100644
--- a/core.go
+++ b/core.go
@@ -100,20 +100,20 @@ func (c *Core) readAt(addr uint16) uint16 {
func (c *Core) Run() {
for {
ins := c.Decode()
- err := c.Eval(ins)
+ err := c.Evaluate(ins)
if err == ErrStop {
return
}
}
}
-// Decode instruction
+// Decode instruction at current program counter position
func (c *Core) Decode() Instruction {
return Decode(c.memory[c.pc])
}
-// Eval instruction
-func (c *Core) Eval(ins Instruction) error {
+// Evaluate instruction
+func (c *Core) Evaluate(ins Instruction) error {
c.pc++
switch v := ins.(type) {
case Literal:
diff --git a/core_test.go b/core_test.go
index e263136..22c4fdb 100644
--- a/core_test.go
+++ b/core_test.go
@@ -120,7 +120,7 @@ func TestEval(t *testing.T) {
t.Run(fmt.Sprint(tc.ins), func(t *testing.T) {
state := New(&mocConsole{})
for _, ins := range tc.ins {
- state.Eval(ins)
+ state.Evaluate(ins)
}
cmp(t, *state, tc.end)
})