Modified how registers and opcodes are represented. This commit is a bit buggy but doesn't crash and burn at least. I just wanted the new structs push out before making a bigger mess of things as I try to organize this all.
This commit is contained in:
+7
-7
@@ -9,11 +9,11 @@ void ProcessDirective(List*);
|
||||
void ProcessVariableDeclaration(List*);
|
||||
|
||||
void ParseTokens(List* tokens) {
|
||||
for(int i = 0; i < tokens->size; i++) {
|
||||
if (((Token *) tokens->content[i])->type == TK_Directive){
|
||||
ProcessDirective(tokens);
|
||||
}
|
||||
}
|
||||
// for(int i = 0; i < tokens->size; i++) {
|
||||
// if (((Token *) tokens->content[i])->type == TK_Directive){
|
||||
// ProcessDirective(tokens);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
void ProcessDirective(List* tokens) {
|
||||
@@ -26,11 +26,11 @@ void ProcessDirective(List* tokens) {
|
||||
|
||||
if (strcmp(".org", directive->value) == 0) {
|
||||
Token* address_start = (Token*) tokens->content[1];
|
||||
if (address_start->type == TK_Number) {
|
||||
if (address_start->type == NUMBER) {
|
||||
long address = strtol(address_start->value, NULL, 10);
|
||||
printf("Address starting at '%ld'\n", address);
|
||||
}
|
||||
else if (address_start->type == TK_Hex) {
|
||||
else if (address_start->type == HEX) {
|
||||
long address = strtol(address_start->value, NULL, 16);
|
||||
printf("Setting address to '%ld'\n", address);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user