Add assembler and execution logic

Most everything works, but there's one small bug with the execution
involving jumps - still have to figure that one out.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-18 17:44:41 -05:00
parent 0598bd1526
commit b0ef49bc2a
11 changed files with 788 additions and 78 deletions

View File

@@ -7,8 +7,8 @@ SectionDefs -> Vec<SectionDef>:
;
SectionDef -> SectionDef:
'DIR_META' MetaBlock { SectionDef::Meta(MetaSection { values: $2 }) }
| 'DIR_SECTION' Name MaybeSectionOrg DataBlock {
'DIR_META' MetaBlock { SectionDef::Meta(MetaSection { lines: $2 }) }
| 'DIR_SECTION' Name SectionOrg DataBlock {
SectionDef::Data(DataSection {
name: $2,
org: $3,
@@ -27,11 +27,6 @@ MetaLines -> Vec<MetaLine>:
MetaLine -> MetaLine: Name 'COLON' Value { MetaLine { name: $1, value: $3 } };
MaybeSectionOrg -> Option<SectionOrg>:
SectionOrg { Some($1) }
| { None }
;
SectionOrg -> SectionOrg:
Int { SectionOrg::Start($1) }
| Int 'DOTDOT' Int { SectionOrg::StartEnd($1, $3) }