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/parser/code_gen.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, 2 insertions, 1 deletions
| -rw-r--r-- | assembler/src/parser/code_gen.rs | 3 |
diff --git a/assembler/src/parser/code_gen.rs b/assembler/src/parser/code_gen.rs index 1c5b95a..ec4a2d2 100644 --- a/assembler/src/parser/code_gen.rs +++ b/assembler/src/parser/code_gen.rs @@ -50,9 +50,10 @@ impl Program { self.instructions.clear(); } - pub(crate) fn to_bytes(self, absolute_start: usize) -> Vec<u8> { + pub(crate) fn to_bytes(self, absolute_start: usize, pc: usize) -> Vec<u8> { let mut res = Vec::new(); res.resize(absolute_start, Default::default()); + res[pc] = self.constants[0]; res.extend(self.constants); res .into_iter() |
