mirror of
https://github.com/danbee/8080
synced 2025-03-04 08:39:07 +00:00
Working with opcode in separate function
This commit is contained in:
parent
9b62cdc774
commit
3b7c42ceec
@ -1,6 +1,6 @@
|
|||||||
use std::io::{self, Read};
|
use std::io::{self, Read};
|
||||||
|
|
||||||
fn opcode(input: &Vec<u8>, counter: &usize) -> usize {
|
fn opcode(input: &Vec<u8>, counter: usize) -> usize {
|
||||||
let size: usize;
|
let size: usize;
|
||||||
|
|
||||||
let opcode = input[counter];
|
let opcode = input[counter];
|
||||||
@ -50,7 +50,7 @@ fn main() {
|
|||||||
|
|
||||||
while counter < input.len() {
|
while counter < input.len() {
|
||||||
// get the instruction
|
// get the instruction
|
||||||
oplength = opcode(&input, &counter);
|
oplength = opcode(&input, counter);
|
||||||
counter += oplength;
|
counter += oplength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user