diff options
| Commit | 1e75ec0d31f05fb8a87939db0415a63a8a021b18 (patch) | |
|---|---|---|
| Author | 2025-02-14 17:59:01 +0200 | |
| Committer | 2025-02-14 17:59:01 +0200 | |
| Files | 16528f9bdafcbbb9dc3072b626f485a5370068a4 /assembler/src/main.rs | |
| tonkobali-1e75ec0d31f05fb8a87939db0415a63a8a021b18.tar tonkobali-1e75ec0d31f05fb8a87939db0415a63a8a021b18.tar.gz tonkobali-1e75ec0d31f05fb8a87939db0415a63a8a021b18.zip | ||
| Parent | 1a6b9be6c585f7cfc3351b7554179123f7543174 (diff) | |
feat: Execute fib, add dec instruction, fix constants in memory creation
1 files changed, 3 insertions, 2 deletions
| -rw-r--r-- | assembler/src/main.rs | 5 |
diff --git a/assembler/src/main.rs b/assembler/src/main.rs index 630f1a1..3a6dd4a 100644 --- a/assembler/src/main.rs +++ b/assembler/src/main.rs @@ -7,7 +7,8 @@ use std::io::{Write, BufRead, BufReader}; use parser::Program; pub(crate) type Word = i64; -static PROGRAM_START: usize = 2; +static PROGRAM_START: usize = 10; +static PROGRAM_COUNTER: usize = 3; fn main() { let file_path = "./example.s"; @@ -43,7 +44,7 @@ fn main() { /* Machine code gen */ prog.instructions_to_constants(PROGRAM_START); println!("{}", prog); - let binary = prog.to_bytes(PROGRAM_START); + let binary = prog.to_bytes(PROGRAM_START, PROGRAM_COUNTER); let mut out = File::create("program.bin").unwrap(); out.write_all(&binary).unwrap(); |
