added returning & more asm instructions
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::ir::Symbol;
|
||||
use crate::ir::{IRLProgram, Symbol};
|
||||
|
||||
pub fn create_program<I: Instr>(
|
||||
fns: Vec<(Vec<I>, Symbol)>,
|
||||
ro_data: Vec<(Vec<u8>, Symbol)>,
|
||||
start: Option<Symbol>,
|
||||
program: &IRLProgram,
|
||||
) -> (Vec<u8>, Option<Addr>) {
|
||||
let mut data = Vec::new();
|
||||
let mut sym_table = SymTable::new(fns.len() + ro_data.len());
|
||||
@@ -36,6 +37,16 @@ pub fn create_program<I: Instr>(
|
||||
}
|
||||
}
|
||||
}
|
||||
for (s, f) in program.fns() {
|
||||
println!(
|
||||
"{}: {:?}",
|
||||
f.name,
|
||||
sym_table.get(*s).map(|a| {
|
||||
let pos = a.0 + 0x1000 + 0x40 + 0x38;
|
||||
format!("0x{:x}", pos)
|
||||
})
|
||||
);
|
||||
}
|
||||
assert!(missing.is_empty());
|
||||
(
|
||||
data,
|
||||
|
||||
Reference in New Issue
Block a user