Commit Graph

12 Commits

Author SHA1 Message Date
Bradford Lamson-Scribner
67416900b4 internal/vm: update Appleone and all it’s a handlers to VM with vm handler 2020-06-04 20:47:35 -06:00
Bradford Lamson-Scribner
b7a3ec4a6c internal/vm/{cpu,exec_funcs,opcodes,vm}: rename op -> operation for clarity (I hope), also general refactors 2020-05-31 22:50:07 -06:00
Bradford Lamson-Scribner
2a17dda142 internal/vm/{cpu,mem,opcodes,vm}: stick to using byte instead of uint8
I can never decide on these things but I generally
prefer using `byte` in go.
2020-05-31 21:47:05 -06:00
Bradford Lamson-Scribner
01bb2379ce internal/vm/{exec_funcs,opcodes,vm}: update design around opcode addr and operand fetching
Refactor:
`(o op) getAddr` -> `(a *Appleone) getAddr`
`(o op) getOperand` `(a *Appleone) getOperand`

This makes way more sense to me and has been bothering me for a while.
2020-05-31 21:41:47 -06:00
Bradford Lamson-Scribner
e5709ad58b Internal/vm/{exec_funcs,opcodes}: missed one, add exec func for BCS opcode 2020-05-31 21:34:48 -06:00
Bradford Lamson-Scribner
a9a3ae5c0a internal/vm/{exec_funcs,opcodes,vm}: implement the rest of the opcode exec funcs 2020-05-31 21:32:00 -06:00
Bradford Lamson-Scribner
ca699a78af internal/vm/{exec_funcs,opcodes,vm}: add support for executing LDX, LDY, and ADC 2020-05-31 09:59:58 -06:00
Bradford Lamson-Scribner
da70e2cfe3 internal/vm/{exec_funcs,opcodes}: add support for executing DEY, DEX, TAY, TAX opcodes 2020-05-31 09:41:57 -06:00
Bradford Lamson-Scribner
00cec5678e internal/vm/{exec_funcs,opcodes}: add support for executing INX 2020-05-31 08:59:09 -06:00
Bradford Lamson-Scribner
35bdeac2c8 internal/vm/{exec_funcs,opcodes}: handle INX instruction execution 2020-05-30 17:14:13 -06:00
Bradford Lamson-Scribner
8d6a0f8fd3 internal/vm: start playing with op executions
So far the pattern feels a tiny bit weird but also has been nice to work
with. As you can see, the op now contains it’s instruction execution func
which can be called directly from the op.
2020-05-30 17:06:36 -06:00
Bradford Lamson-Scribner
cdca8f735d internal/vm: add the first few opcode handlers
Still a little iffy on the code design, although this seems like it
could be a desirable pattern. This way I would have to write an opcode
handler for all the cases and register it to the “op”. That way step
calls are super simple from Appleone’s point of view -> get the operation
and that operation has everything needed to execute on the vm.
2020-05-30 11:03:58 -06:00