Require assembler sections to specify where in virtual memory they begin

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-10 18:02:44 -05:00
parent a4a37b5a27
commit 7504b81b2d
4 changed files with 15 additions and 17 deletions

View File

@@ -3,11 +3,11 @@ use crate::vm::{inst::*, reg::Reg};
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SectionBlock {
Data {
org: Option<SectionOrg>,
org: SectionOrg,
body: Vec<Line>,
},
Code {
org: Option<SectionOrg>,
org: SectionOrg,
body: Vec<Line>,
},
Meta {

View File

@@ -82,11 +82,11 @@ SectionOrg: SectionOrg = {
}
Section: SectionBlock = {
"data" <org:SectionOrg?> "{" <body:Line*> "}" => {
"data" <org:SectionOrg> "{" <body:Line*> "}" => {
SectionBlock::Data { org, body }
},
"code" <org:SectionOrg?> "{" <body:Line*> "}" => {
"code" <org:SectionOrg> "{" <body:Line*> "}" => {
SectionBlock::Code { org, body }
},