Small additions and fixes in instructions
I added two instructions: cmp_r and nop.
cmp_r is simply register-to-register comparation.
nop is an instruction to explicitly do nothing. A sort of padding.
I also added a third default interrupt: “Math Error”. It is raised when division by zero is attempted.
Further changes
I changed a couple of things in the interrupt handling. I made sure when an interrupt is manually raised, the PC is incremented beforehand, so it won’t loop, and I made sure that calls to undefined interrupts aren’t actually executed but instantly return.
Next time?
Next time I’m doing (hopefully) a final pre-1.0 cleanup. I’ll be catching some possible crashes to make sure they’re CPU faults instead of emulator crashes and I’ll add a way to switch from Big to Little Endian to make sure everything is reachable in memory.
What’s below?
The screenshot below is my handleInterrupt() function.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.