14#define INSTRUCTION_COUNT 64
15#define LABEL_CEILING 64
16#define LABEL_IDENTIFIER_SIZE 20
17#define SYMBOL_CEILING 64
45#define S_JP_V0 "JP V0,"
239int is_db(
const char*);
240int is_ds(
const char*);
241int is_dw(
const char*);
Represents an instruction.
Definition: symbol.h:168
Instruction cmd
Definition: symbol.h:170
int line
Definition: symbol.h:169
int pcount
Definition: symbol.h:171
instruction_format_t * format
Definition: symbol.h:174
Represents a list of labels.
Definition: symbol.h:199
label_t * l
Definition: symbol.h:200
int ceil
Definition: symbol.h:202
int len
Definition: symbol.h:201
Represents a label.
Definition: symbol.h:186
int byte
Definition: symbol.h:188
Represents a symbol with a type, value, and line number.
Definition: symbol.h:227
int ceil
Definition: symbol.h:230
symbol_t * s
Definition: symbol.h:228
int len
Definition: symbol.h:229
Represents a symbol with a type, value, and line number.
Definition: symbol.h:213
uint16_t value
Definition: symbol.h:215
int ln
Definition: symbol.h:216
Symbol type
Definition: symbol.h:214
int is_db(const char *)
Check if given string is a DB identifier.
Definition: symbol.c:165
int is_label(const char *, const label_list_t *)
Check if given string is a label reference.
Definition: symbol.c:233
int is_instruction(const char *)
Check if the given string is an instruction.
Definition: symbol.c:193
int is_label_definition(const char *)
Check if the given string is a label definition.
Definition: symbol.c:209
int build_instruction(instruction_t *, symbol_list_t *, int)
Build an instruction from symbols beginning at idx.
Definition: symbol.c:140
int is_ds(const char *)
Check if given string is a DS identifier.
Definition: symbol.c:174
int resolve_labels(symbol_list_t *, label_list_t *)
Get byte indexes of label definitions from completed symbol table.
Definition: symbol.c:393
int is_dw(const char *)
Check if given string is a DW identifier.
Definition: symbol.c:183
const char * c8_identifierStrings[]
Definition: symbol.c:21
Symbol
Represents symbol types.
Definition: symbol.h:108
@ SYM_DW
Definition: symbol.h:118
@ SYM_B
Definition: symbol.h:116
@ SYM_LABEL
Definition: symbol.h:122
@ SYM_STRING
Definition: symbol.h:127
@ SYM_K
Definition: symbol.h:114
@ SYM_INT12
Definition: symbol.h:126
@ SYM_DT
Definition: symbol.h:110
@ SYM_V
Definition: symbol.h:128
@ SYM_F
Definition: symbol.h:115
@ SYM_R
Definition: symbol.h:121
@ SYM_INT
Definition: symbol.h:123
@ SYM_DB
Definition: symbol.h:117
@ SYM_HF
Definition: symbol.h:120
@ SYM_NULL
Definition: symbol.h:109
@ SYM_IP
Definition: symbol.h:113
@ SYM_INT4
Definition: symbol.h:124
@ SYM_LABEL_DEFINITION
Definition: symbol.h:130
@ SYM_I
Definition: symbol.h:112
@ SYM_ST
Definition: symbol.h:111
@ SYM_INT8
Definition: symbol.h:125
@ SYM_INSTRUCTION
Definition: symbol.h:129
@ SYM_DS
Definition: symbol.h:119
int shift(uint16_t)
Find the bits needed to shift to OR a parameter into an instruction.
Definition: symbol.c:619
instruction_format_t formats[]
Definition: symbol.c:74
int is_register(const char *)
Check if the given string represents a V register.
Definition: symbol.c:258
const char * c8_instructionStrings[]
Definition: symbol.c:41
int substitute_labels(symbol_list_t *, label_list_t *)
Substitute label symbols with their corresponding int value.
Definition: symbol.c:432
Instruction
Represents instruction types.
Definition: symbol.h:69
@ I_XOR
Definition: symbol.h:89
@ I_CALL
Definition: symbol.h:74
@ I_ADD
Definition: symbol.h:78
@ I_AND
Definition: symbol.h:80
@ I_SKP
Definition: symbol.h:87
@ I_SCL
Definition: symbol.h:92
@ I_JP_V0
Definition: symbol.h:96
@ I_CLS
Definition: symbol.h:71
@ I_HIGH
Definition: symbol.h:95
@ I_JP
Definition: symbol.h:73
@ I_SCD
Definition: symbol.h:90
@ I_SHL
Definition: symbol.h:84
@ I_RND
Definition: symbol.h:85
@ I_DRW
Definition: symbol.h:86
@ I_NULL
Definition: symbol.h:70
@ I_OR
Definition: symbol.h:79
@ I_SHR
Definition: symbol.h:82
@ I_RET
Definition: symbol.h:72
@ I_LD
Definition: symbol.h:77
@ I_SE
Definition: symbol.h:75
@ I_SUBN
Definition: symbol.h:83
@ I_SNE
Definition: symbol.h:76
@ I_SCR
Definition: symbol.h:91
@ I_EXIT
Definition: symbol.h:93
@ I_SUB
Definition: symbol.h:81
@ I_LOW
Definition: symbol.h:94
@ I_SKNP
Definition: symbol.h:88
symbol_t * next_symbol(symbol_list_t *)
Get the next symbol.
Definition: symbol.c:296
int is_comment(const char *)
Check if the given string is a comment.
Definition: symbol.c:156
int populate_labels(label_list_t *)
Populate label list from lines.
Definition: symbol.c:330
int is_reserved_identifier(const char *)
Check if given string is a reserved identifier.
Definition: symbol.c:272
#define LABEL_IDENTIFIER_SIZE
Definition: symbol.h:16