Exercise 51: A Tiny Virtual Machine – Part 4: I/O and Debugging

Goals:

  • Implement basic I/O support.
  • Add debugging tools (memory dump, register display).

Topics Covered:

  • Memory-mapped I/O:
    • Write to 0xFF00 triggers console output.
  • Debug commands:
    • Print VM state before halting.
    • Optionally, step-by-step execution.

Bonus: Implement IN and OUT instructions for basic I/O interactivity.