Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the main execution loop for the virtual machine. #6

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Conversation

yezzfusl
Copy link
Owner

@yezzfusl yezzfusl commented Aug 6, 2024

  1. In src/main.rs:
  • Added a simple program to demonstrate the VM's functionality.
  • Created instances of IOController and MemoryManagementUnit.
  • Loaded the program into the CPU's memory and started execution.
  1. In src/cpu.rs:
  • Implemented the load_program method to load a program into memory.
  • Created the main run method that executes the fetch-decode-execute cycle until the CPU is halted.
  • Modified the decode_and_execute method to fetch operands for each instruction.
  • Added a halted flag and a HALT instruction to stop execution.
  • Implemented a print_registers method for debugging.
  • Updated all instruction methods to take two operands.
  • Added a comprehensive test that runs a small program in the VM.

@yezzfusl yezzfusl self-assigned this Aug 6, 2024
Copy link
Owner Author

@yezzfusl yezzfusl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main execution loop is effectively implemented, tying together the CPU emulator, memory management, and I/O operations.

@yezzfusl yezzfusl merged commit ea1fc23 into main Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant