This feels like a trainwreck but eh. Changed the way the opcodes are managed. Hopefully this is the right direction when I add support for multiple ASM files.

This commit is contained in:
2022-09-01 18:46:59 +00:00
parent 13f8ff194b
commit 7004fff659
7 changed files with 230 additions and 129 deletions
+30 -1
View File
@@ -1,6 +1,7 @@
#ifndef PARSER_H
#define PARSER_H
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "list.h"
@@ -9,6 +10,34 @@
#define HIGHMEMORY 65535 //64KiB - 1 AKA 0xFFFF
unsigned char* ParseTokens(List*);
typedef struct {
Token* token;
//unsigned char terminatingByte;
int address;
int resolved;
} Symbol;
typedef struct {
TokenType Mnemonic;
TokenClass ParameterOneType;
TokenClass ParameterTwoType;
union {
uint16_t Constant;
Symbol* Address;
} ParameterOne;
union {
uint16_t Constant;
Symbol* Address;
} ParameterTwo;
} IROpcode;
typedef struct {
List* Opcodes;
List* SymbolsTable;
} IRState;
IRState* ParseTokens(List*);
#endif