add single_step function (#62)

Co-authored-by: Sam M W <you@example.com>
This commit is contained in:
omarandlorraine 2023-03-26 23:27:44 +01:00 committed by GitHub
parent fdf71425d3
commit 61b8dfe1f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -415,6 +415,12 @@ impl CPU {
};
}
pub fn single_step(&mut self) {
if let Some(decoded_instr) = self.fetch_next_and_decode() {
self.execute_instruction(decoded_instr);
}
}
pub fn run(&mut self) {
while let Some(decoded_instr) = self.fetch_next_and_decode() {
self.execute_instruction(decoded_instr);