From 50592a5184e701dd09eee024bb773ec57c1cd6bf Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Sat, 26 Apr 2025 14:44:50 +1200 Subject: Allow label references in pinned address calculations This is a relaxation of the rule where a label reference could not be used in any context that could change the length of an assembled program. We implement this in the bytecode stage by naively calculating an initial address for each label as before. If a pinned address is calculated from a label reference, some of the calculated addresses could be incorrect. We then attempt to run the bytecode stage, which will calculate a more accurate address for each label based on how pinned addresses are calculated. If the address of any label was changed by running this stage, we re-run the stage up to three more times until all labels stabilise. If the labels fail to stabilise, we return an error. --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 420bb61..f0de207 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,3 +7,5 @@ pub use types::*; pub use formats::*; pub use assembler::*; + +use log::*; -- cgit v1.2.3-70-g09d2