From d492aa8271f9fb02351b1144733508194df67746 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 23 Oct 2024 12:54:14 +0200 Subject: Re-work the support on labels, variables and jumps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As a way to firstly adapt on the latest changes from the parser since 184c39579227 ("Re-work the parser from scratch"), the assembler had to leave out some features on 16114b2ca358 ("Adapt the assembler to the changes on the parser"). This commit reintroduces support for settings labels, variables and referencing them, while also providing a more robust implementation at that. Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/mapping.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/xixanta/src/mapping.rs') diff --git a/lib/xixanta/src/mapping.rs b/lib/xixanta/src/mapping.rs index 9d313a5..238f39d 100644 --- a/lib/xixanta/src/mapping.rs +++ b/lib/xixanta/src/mapping.rs @@ -1,34 +1,46 @@ +use crate::assembler::Bundle; + lazy_static! { pub static ref EMPTY: Vec = vec![Segment { name: String::from("CODE"), start: 0x0000, size: 0xFFFF, + offset: 0, fill: None, + bundles: vec![], }]; pub static ref NROM: Vec = vec![ Segment { name: String::from("HEADER"), start: 0x0000, size: 0x0010, + offset: 0, fill: Some(0x00), + bundles: vec![], }, Segment { name: String::from("VECTORS"), start: 0xFFFA, size: 0x0006, + offset: 0, fill: Some(0x00), + bundles: vec![], }, Segment { name: String::from("CODE"), start: 0x8000, size: 0x7FFA, + offset: 0, fill: Some(0x00), + bundles: vec![], }, Segment { name: String::from("CHARS"), start: 0x0000, size: 0x2000, + offset: 0, fill: Some(0x00), + bundles: vec![], } ]; } @@ -38,7 +50,9 @@ pub struct Segment { pub name: String, pub start: u16, pub size: usize, + pub offset: usize, pub fill: Option, + pub bundles: Vec, } /* TODO -- cgit v1.2.3