Still need to add debugging in instruction
execution, and perhaps add a better VM
constructor for debugging, that can still
allow for toggling the debug mode in the
middle of execution.
---
Debugging inside the CPU would involve passing around the debug flag
and the stderr lock into the CPU module, which seems simple enough,
but might get unhandy, especially since StderrLock has an associated
lifetime, which might propagate some complexity.
I'm not exactly pursuing raw performance with this VM, but I somewhat worry
about the implications of the extra function call and branching on every
small operation. Perhaps we could elide debugging in release builds?
Mmmm, I think I'd rather do `VM::new(args.debug)` than this.
Just have the func signature be `pub new(debug: bool)` and *maybe* have a
`pub with_debug()` which just aliases to `new(true)`? Not sure.
You probably didn't want that, but that `Result` over there actually comes
from `crossterm`. I assume your LSP imported it for you or something.
You should be using `std::io::Result`, and revert the import back to `use
crossterm::terminal`.