Started implementing the debugger.
This commit is contained in:
@@ -41,6 +41,7 @@ struct t_constant {
|
||||
|
||||
static byte* code; // [MAX_CODE_SIZE];
|
||||
static word codepos = 0;
|
||||
static word lines[32768];
|
||||
|
||||
static t_label known_labels[MAX_LABELS];
|
||||
static int num_known_labels = 0;
|
||||
@@ -85,11 +86,14 @@ static void int_to_string(int value, char* label) {
|
||||
/****************************************************************************************/
|
||||
|
||||
static void emmit(const byte value) {
|
||||
lines[codepos] = tkn_get_line();
|
||||
code[codepos++] = value;
|
||||
}
|
||||
|
||||
static void emmit_w(const word value) {
|
||||
lines[codepos] = tkn_get_line();
|
||||
code[codepos++] = value & 255;
|
||||
lines[codepos] = tkn_get_line();
|
||||
code[codepos++] = value >> 8;
|
||||
}
|
||||
|
||||
@@ -865,6 +869,7 @@ void parser_parse(const char* buffer, byte* mem) {
|
||||
|
||||
const int parser_get_codesize() { return codepos; }
|
||||
const int parser_get_memory_usage() { return num_variables; }
|
||||
unsigned short* parser_get_lines() { return lines; }
|
||||
|
||||
void parser_register_external_function(const char* name, const int num_parameters) {
|
||||
strcpy(external_functions[num_external_functions].name, name);
|
||||
|
||||
Reference in New Issue
Block a user