Commit Graph

7 Commits

Author SHA1 Message Date
bff9220fb1 Extend how interrupts are reported to the main execution loop
Some things that were previously hard VM-level errors are now handled by
interrupts. While this is relatively easy to handle, I was wanting a
little more structure for the error types - so, errors that should
invoke an interrupt are passed along in their own structure in a
VmError::Interrupt variant. If an error is raised during the tick()
phase of execution that would cause an interrupt, that interrupt is
intercepted and the VM continues.

The State::interrupt() function also will catch double faults and triple
faults, with a triple fault being its own variant in the VmError
structure (so it cannot be intercepted as an interrupt by accident).

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-03-12 16:56:20 -04:00
28edfb6933 Remove dollar sign ($) from front of number tokens
Number tokens with a dollar sign are kind of cumbersome and don't really
serve a purpose, so I'm removing them.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-03-10 15:59:36 -04:00
551bd2c3f4 Add initial register states to meta section; remove entry directive
It makes sense to allow users to set the initial register values. This
allows someone to e.g. enable interrupts once the VM has started, or set
the initial stack pointer value.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-03-10 12:18:31 -04:00
9e82663b2a Rename tests/call.asm -> tests/test_call.asm
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-03-09 18:24:19 -04:00
cd95011e7b Add function call test
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-02-26 10:19:26 -05:00
bc4f59ecad Add bitwise tests, squash all arithmetic tests into test_arithmetic
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-02-25 14:10:21 -05:00
362590292a Add some integration tests and runner
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-02-25 13:48:03 -05:00