aboutsummaryrefslogtreecommitdiff
path: root/core.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-02-12 05:41:05 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-02-12 05:41:05 +0100
commitfa6932b65a14f2c74ab61541b8f5cd3b5d44e535 (patch)
tree1c37e3ed36dc6b2a2fcb6f1089bc052d0e37ceb2 /core.go
parentfc3d8ccb1f808cab660750fe4a136e7dd384d36b (diff)
...
Diffstat (limited to 'core.go')
-rw-r--r--core.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/core.go b/core.go
index 72aab2c..624d4b3 100644
--- a/core.go
+++ b/core.go
@@ -99,21 +99,21 @@ func (c *Core) readAt(addr uint16) uint16 {
// Run evaluates content of memory
func (c *Core) Run() {
for {
- ins := c.Decode()
- err := c.Evaluate(ins)
+ ins := c.Fetch()
+ err := c.Execute(ins)
if err == ErrStop {
return
}
}
}
-// Decode instruction at current program counter position
-func (c *Core) Decode() Instruction {
+// Fetch instruction at current program counter position
+func (c *Core) Fetch() Instruction {
return Decode(c.memory[c.pc])
}
-// Evaluate instruction
-func (c *Core) Evaluate(ins Instruction) error {
+// Execute instruction
+func (c *Core) Execute(ins Instruction) error {
c.pc++
switch v := ins.(type) {
case Literal: