Fixed issue where all args where 0x00
This commit is contained in:
parent
879b700b64
commit
0b1398ad72
1 changed files with 5 additions and 6 deletions
|
|
@ -77,7 +77,6 @@ pub fn assemble(code: Vec<String>, output: String) {
|
|||
println!("{}", line_split.len() - 1);
|
||||
|
||||
append_hex(&mut output_file, instruction);
|
||||
sleep(Duration::from_millis(1));
|
||||
inc_progress_bar();
|
||||
}
|
||||
|
||||
|
|
@ -87,9 +86,9 @@ pub fn assemble(code: Vec<String>, output: String) {
|
|||
}
|
||||
|
||||
fn append_hex(file: &mut File, instruction: Instruction) {
|
||||
for (field, val) in instruction.iter() {
|
||||
file
|
||||
.write_all(&[*val.downcast_ref::<u8>().unwrap()])
|
||||
.unwrap();
|
||||
}
|
||||
file.write_all(&[instruction.opt_code]).unwrap();
|
||||
file.write_all(&[instruction.arg1]).unwrap();
|
||||
file.write_all(&[instruction.arg2]).unwrap();
|
||||
file.write_all(&[instruction.arg3]).unwrap();
|
||||
file.write_all(&[instruction.arg4]).unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue