-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assembler label low/high byte immediate
- Loading branch information
1 parent
1d76188
commit fae3771
Showing
13 changed files
with
297 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "Linker.h" | ||
|
||
Linker::Linker(Errors* errors) | ||
: mErrors(errors), mSections(nullptr), mReferences(nullptr), mObjects(nullptr) | ||
{ | ||
|
||
} | ||
|
||
Linker::~Linker(void) | ||
{ | ||
|
||
} | ||
|
||
int Linker::AddSection(const Ident* section, int start, int size) | ||
{ | ||
return 0; | ||
} | ||
|
||
void Linker::AddSectionData(const Ident* section, int id, const uint8* data, int size) | ||
{ | ||
|
||
} | ||
|
||
uint8* Linker::AddSectionSpace(const Ident* section, int id, int size) | ||
{ | ||
return nullptr; | ||
} | ||
|
||
void Linker::AddReference(const LinkerReference& ref) | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#pragma once | ||
|
||
#include "MachineTypes.h" | ||
#include "Ident.h" | ||
#include "Array.h" | ||
#include "Errors.h" | ||
|
||
struct LinkerReference | ||
{ | ||
int mSection, mID, mOffset; | ||
int mRefSection, mRefID, mRefOffset; | ||
bool mLowByte, mHighByte; | ||
}; | ||
|
||
struct LinkerSection | ||
{ | ||
const Ident* mIdent; | ||
int mID; | ||
int mStart, mSize; | ||
}; | ||
|
||
struct LinkerObject | ||
{ | ||
const Ident* mIdent; | ||
int mID; | ||
int mSize; | ||
uint8* mData; | ||
}; | ||
|
||
class Linker | ||
{ | ||
public: | ||
Linker(Errors * errors); | ||
~Linker(void); | ||
|
||
int AddSection(const Ident* section, int start, int size); | ||
void AddSectionData(const Ident* section, int id, const uint8* data, int size); | ||
uint8 * AddSectionSpace(const Ident* section, int id, int size); | ||
void AddReference(const LinkerReference& ref); | ||
|
||
GrowingArray<LinkerReference*> mReferences; | ||
GrowingArray<LinkerSection*> mSections; | ||
GrowingArray<LinkerObject*> mObjects; | ||
|
||
void Link(void); | ||
protected: | ||
Errors* mErrors; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.