Started rethinking how this machine should behave. Updated and refactoring some things with a few new ideas.

This commit is contained in:
2023-02-23 22:22:07 -06:00
parent 9a602824b6
commit 1b246e90bc
8 changed files with 68 additions and 193 deletions
+6 -7
View File
@@ -67,7 +67,7 @@ List* GenerateTokenList(const char* source) {
Line++;
}
break;
case '.': //directive like ".org" or ".db"
case '.': //directive like ".include" or ".db"
token = ParseDirective();
if (token) AddListItem(token, tokens);
break;
@@ -191,17 +191,16 @@ Token* ParseDirective(void) {
return token;
}
else if (strcmp(directive, ".org") == 0) {
fprintf(stderr, "[Warning] Org is not a supported directive.\n");
free(directive);
free(token);
IgnoreLine();
return NULL;
else if (strcmp(directive, ".include") == 0) {
token->Value.Directive = Include;
return token;
}
fprintf(stderr, "[Error] Unknown assembler directive '%s'\n", directive);
free(directive);
free(token);
IgnoreLine();