Fixed a bug where CMP REG, REG wouldn't get encoded and a disassembler bug related to said CMP bug.

This commit is contained in:
2022-08-29 19:29:34 +00:00
parent 5f437b6869
commit 6c7b8d5356
4 changed files with 26 additions and 16 deletions
+10 -10
View File
@@ -21,19 +21,19 @@ int main(int argc, char* args[]) {
List* list = GenerateTokenList(source_code);
// for(int i = 0; i < list->size; i++) {
// Token* t = (Token*) list->content[i];
for(int i = 0; i < list->size; i++) {
Token* t = (Token*) list->content[i];
// if (t->type == LineEnd) {
// if (i - 1 >= 0 && ((Token*) list->content[i - 1])->type != LineEnd)
// printf("\n");
if (t->type == LineEnd) {
if (i - 1 >= 0 && ((Token*) list->content[i - 1])->type != LineEnd)
printf("\n");
// continue;
// }
continue;
}
// printf("[%i] '%s' [%i] ", t->type, t->lexeme, t->token_class);
// if (t->type == LABEL) printf("* ");
// }
printf("[T: %i][C: %i] '%s' ", t->type, t->token_class, t->lexeme);
if (t->type == LABEL) printf("* ");
}
unsigned char* image = ParseTokens(list);
Disassemble(image);