14#define INSTRUCTION_COUNT 64
15#define LABEL_CEILING 64
16#define LABEL_IDENTIFIER_SIZE 20
17#define SYMBOL_CEILING 64
237int is_db(
const char *);
238int is_dw(
const char *);
Represents an instruction.
Definition: symbol.h:166
Instruction cmd
Definition: symbol.h:168
int line
Definition: symbol.h:167
int pcount
Definition: symbol.h:169
instruction_format_t * format
Definition: symbol.h:172
Represents a list of labels.
Definition: symbol.h:197
label_t * l
Definition: symbol.h:198
int ceil
Definition: symbol.h:200
int len
Definition: symbol.h:199
Represents a label.
Definition: symbol.h:184
int byte
Definition: symbol.h:186
Represents a symbol with a type, value, and line number.
Definition: symbol.h:225
int ceil
Definition: symbol.h:228
symbol_t * s
Definition: symbol.h:226
int len
Definition: symbol.h:227
Represents a symbol with a type, value, and line number.
Definition: symbol.h:211
uint16_t value
Definition: symbol.h:213
int ln
Definition: symbol.h:214
Symbol type
Definition: symbol.h:212
int is_db(const char *)
Check if given string is a DB identifier.
Definition: symbol.c:216
const char * identifierStrings[]
int is_instruction(const char *)
Check if the given string is an instruction.
Definition: symbol.c:237
int is_label_definition(const char *)
Check if the given string is a label definition.
Definition: symbol.c:255
int populate_labels(char **, int, label_list_t *)
Populate label list from lines.
Definition: symbol.c:350
int build_instruction(instruction_t *, symbol_list_t *, int)
Build an instruction from symbols beginning at idx.
Definition: symbol.c:138
int resolve_labels(symbol_list_t *, label_list_t *)
Get byte indexes of label definitions from completed symbol table.
Definition: symbol.c:397
int is_dw(const char *)
Check if given string is a DW identifier.
Definition: symbol.c:226
Symbol
Represents symbol types.
Definition: symbol.h:106
@ SYM_DW
Definition: symbol.h:116
@ SYM_B
Definition: symbol.h:114
@ SYM_LABEL
Definition: symbol.h:120
@ SYM_STRING
Definition: symbol.h:125
@ SYM_K
Definition: symbol.h:112
@ SYM_INT12
Definition: symbol.h:124
@ SYM_DT
Definition: symbol.h:108
@ SYM_V
Definition: symbol.h:126
@ SYM_F
Definition: symbol.h:113
@ SYM_R
Definition: symbol.h:119
@ SYM_INT
Definition: symbol.h:121
@ SYM_DB
Definition: symbol.h:115
@ SYM_HF
Definition: symbol.h:118
@ SYM_NULL
Definition: symbol.h:107
@ SYM_IP
Definition: symbol.h:111
@ SYM_INT4
Definition: symbol.h:122
@ SYM_LABEL_DEFINITION
Definition: symbol.h:128
@ SYM_I
Definition: symbol.h:110
@ SYM_ST
Definition: symbol.h:109
@ SYM_INT8
Definition: symbol.h:123
@ SYM_INSTRUCTION
Definition: symbol.h:127
@ SYM_DS
Definition: symbol.h:117
instruction_format_t formats[]
Definition: symbol.c:73
int is_register(const char *)
Check if the given string represents a V register.
Definition: symbol.c:295
int substitute_labels(symbol_list_t *, label_list_t *)
Substitute label symbols with their corresponding int value.
Definition: symbol.c:431
const char * instructionStrings[]
Instruction
Represents instruction types.
Definition: symbol.h:68
@ I_XOR
Definition: symbol.h:88
@ I_CALL
Definition: symbol.h:73
@ I_ADD
Definition: symbol.h:77
@ I_AND
Definition: symbol.h:79
@ I_SKP
Definition: symbol.h:86
@ I_SCL
Definition: symbol.h:91
@ I_CLS
Definition: symbol.h:70
@ I_HIGH
Definition: symbol.h:94
@ I_JP
Definition: symbol.h:72
@ I_SCD
Definition: symbol.h:89
@ I_SHL
Definition: symbol.h:83
@ I_RND
Definition: symbol.h:84
@ I_DRW
Definition: symbol.h:85
@ I_NULL
Definition: symbol.h:69
@ I_OR
Definition: symbol.h:78
@ I_SHR
Definition: symbol.h:81
@ I_RET
Definition: symbol.h:71
@ I_LD
Definition: symbol.h:76
@ I_SE
Definition: symbol.h:74
@ I_SUBN
Definition: symbol.h:82
@ I_SNE
Definition: symbol.h:75
@ I_SCR
Definition: symbol.h:90
@ I_EXIT
Definition: symbol.h:92
@ I_SUB
Definition: symbol.h:80
@ I_LOW
Definition: symbol.h:93
@ I_SKNP
Definition: symbol.h:87
symbol_t * next_symbol(symbol_list_t *)
Get the next symbol.
Definition: symbol.c:324
int is_comment(const char *)
Check if the given string is a comment.
Definition: symbol.c:206
int is_reserved_identifier(const char *)
Check if given string is a reserved identifier.
Definition: symbol.c:307
#define LABEL_IDENTIFIER_SIZE
Definition: symbol.h:16
int is_label(const char *, label_list_t *)
Check if given string is a label reference.
Definition: symbol.c:273