Require assembler sections to specify where in virtual memory they begin
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 }
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user