fixed a lot of bugs with the emulator, instruction set and assembler

This commit is contained in:
2025-06-19 01:57:36 +01:00
parent e281bc2d1d
commit 6b58a17f03
13 changed files with 209 additions and 47 deletions
+8 -2
View File
@@ -11,7 +11,7 @@ use common::prelude::Instruction;
use crate::{
codegen::codegen,
expand::expand_pseudo_ops,
model::{Node, Symbol, Token, TokenType},
model::{Node, Opcode, Symbol, Token, TokenType},
parser::{Parser, Program},
resolver::{create_sections, resolve_dependencies, resolve_symbols},
};
@@ -78,7 +78,13 @@ fn prepare_dependency(
"{:20} {:20}",
"Expanding PseudoInstructions", filename
));
let nodes = expand_pseudo_ops(nodes, file_hash)?;
let mut nodes = expand_pseudo_ops(nodes, file_hash)?;
// add a section instruction
nodes.insert(
0,
node!(None, Opcode::Segment, Token::Immediate(file_hash as u32)),
);
for n in nodes.iter() {
println!("{}", n);