diff --git a/main/gbc/gbc_trans.h b/main/gbc/gbc_trans.h index b21209c75..5a776ed95 100644 --- a/main/gbc/gbc_trans.h +++ b/main/gbc/gbc_trans.h @@ -173,7 +173,7 @@ int TRANS_loop_local(bool allow_arg); void TRANS_expression(bool check); void TRANS_ignore_expression(void); -bool TRANS_popify_last(void); +bool TRANS_popify_last(bool no_conv); void TRANS_reference(void); bool TRANS_affectation(bool dup); void TRANS_operation(short op, short nparam, bool output, PATTERN previous); diff --git a/main/gbc/gbc_trans_ctrl.c b/main/gbc/gbc_trans_ctrl.c index 0abc6d40e..95c6972ce 100644 --- a/main/gbc/gbc_trans_ctrl.c +++ b/main/gbc/gbc_trans_ctrl.c @@ -1009,7 +1009,7 @@ void TRANS_for(void) TRANS_expression(FALSE); - CODE_pop_local(local); + CODE_pop_local_noref(local); control_check_loop_var(local); @@ -1032,9 +1032,6 @@ void TRANS_for(void) CODE_push_number(downto ? -1 : 1); } - /*CODE_pop_ctrl(current_ctrl->local + 1); - CODE_pop_ctrl(current_ctrl->local);*/ - if (!PATTERN_is_newline(*JOB->current)) THROW(E_UNEXPECTED, READ_get_pattern(JOB->current)); @@ -1043,17 +1040,10 @@ void TRANS_for(void) control_set_value(CODE_get_current_pos()); - /* - current = JOB->current; - JOB->current = loop_var; - TRANS_expression(FALSE); - JOB->current = current; - */ - control_add_current_pos(); CODE_jump_next(); - CODE_pop_local(local); + CODE_pop_local_noref(local); } diff --git a/main/gbc/gbc_trans_expr.c b/main/gbc/gbc_trans_expr.c index a5acd461f..2b7684b66 100644 --- a/main/gbc/gbc_trans_expr.c +++ b/main/gbc/gbc_trans_expr.c @@ -720,7 +720,7 @@ static void trans_expr_from_tree(TRANS_TREE *tree, int count) } else if (PATTERN_is(pattern, RS_AT)) { - if (TRANS_popify_last()) + if (TRANS_popify_last(FALSE)) THROW("This expression cannot be passed by reference"); } else if (PATTERN_is(pattern, RS_COMMA)) @@ -981,9 +981,9 @@ TYPE TRANS_variable_get_type() } -bool TRANS_popify_last() +bool TRANS_popify_last(bool no_conv) { - if (!CODE_popify_last()) + if (!CODE_popify_last(no_conv)) return TRUE; if (_last_symbol_used) @@ -1001,7 +1001,15 @@ bool TRANS_popify_last() void TRANS_reference(void) { TRANS_expression(FALSE); - if (TRANS_popify_last()) + if (TRANS_popify_last(FALSE)) + THROW("Invalid assignment"); +} + + +void TRANS_reference_type(TYPE type) +{ + TRANS_expression(FALSE); + if (TRANS_popify_last(TYPE_get_id(_last_type) == TYPE_get_id(type))) THROW("Invalid assignment"); } @@ -1123,7 +1131,7 @@ bool TRANS_affectation(bool dup) trans_operation(op, 1, NULL_PATTERN); else*/ trans_operation(op, 2, NULL_PATTERN); - pop_type(); + _last_type = pop_type(); } } @@ -1139,7 +1147,7 @@ bool TRANS_affectation(bool dup) } JOB->current = left; - TRANS_reference(); + TRANS_reference_type(_last_type); if (!PATTERN_is_newline(*JOB->current)) THROW(E_SYNTAX); diff --git a/main/gbx/gbx_eval.c b/main/gbx/gbx_eval.c index 1c638bf8c..d3d891509 100644 --- a/main/gbx/gbx_eval.c +++ b/main/gbx/gbx_eval.c @@ -50,6 +50,8 @@ static void EVAL_enter() OP = NULL; CP = &EVAL->exec_class; + EXEC_check_bytecode(); + //AP = ARCH_from_class(CP); EP = NULL; diff --git a/main/gbx/gbx_exec.c b/main/gbx/gbx_exec.c index 663003f27..89637e7ff 100644 --- a/main/gbx/gbx_exec.c +++ b/main/gbx/gbx_exec.c @@ -109,6 +109,8 @@ void EXEC_init(void) ERROR_warning("CPU is big endian"); DATE_init(); + + EXEC_init_bytecode_check(); } @@ -506,6 +508,7 @@ void EXEC_enter(void) PC = func->code; OP = object; CP = class; + EXEC_check_bytecode(); EP = NULL; GP = NULL; @@ -608,6 +611,7 @@ void EXEC_enter_quick(void) PC = func->code; OP = object; CP = class; + EXEC_check_bytecode(); EP = NULL; GP = NULL; diff --git a/main/gbx/gbx_exec.h b/main/gbx/gbx_exec.h index 6a0144207..970c47cd9 100644 --- a/main/gbx/gbx_exec.h +++ b/main/gbx/gbx_exec.h @@ -169,6 +169,8 @@ void EXEC_enter_quick(void); void EXEC_leave_keep(); void EXEC_leave_drop(); void EXEC_loop(void); +void EXEC_init_bytecode_check(void); +void EXEC_check_bytecode(void); #define EXEC_object_2(_val, _pclass, _pobject) \ ({ \ diff --git a/main/gbx/gbx_exec_loop.c b/main/gbx/gbx_exec_loop.c index f1f4fa805..ebf7b8514 100644 --- a/main/gbx/gbx_exec_loop.c +++ b/main/gbx/gbx_exec_loop.c @@ -203,28 +203,51 @@ const void *EXEC_subr_table[] = VALUE_class_read_inline(class, value, addr, ctype, ref); }*/ -static void _switch_bytecode(bool not_3_18, const void *jump_table[], const void *jump_table_3_18_AXXX[], const void *jump_table_3_18_FXXX[]) +static const void **_sb_jump_table; +static const void **_sb_jump_table_3_18_AXXX; +static const void **_sb_jump_table_3_18_FXXX; +static bool _sb_not_3_18 = FALSE; + +void EXEC_init_bytecode_check() +{ + ushort opcode = C_RETURN + 3; + PC = &opcode; + EXEC_loop(); +} + +void EXEC_check_bytecode() { int i; - if (not_3_18) + if (!CP) + return; + + //fprintf(stderr, "EXEC_check_bytecode: %s / %d\n", CP->name, CP->not_3_18); + + if (CP->not_3_18 == _sb_not_3_18) + return; + + _sb_not_3_18 = !_sb_not_3_18; + //fprintf(stderr, "switch bytecode to %s\n", _sb_not_3_18 ? "< 3.18" : "3.18"); + + if (_sb_not_3_18) { for (i = 0xA1; i <= 0xAE; i++) - jump_table[i] = jump_table[0xA0]; + _sb_jump_table[i] = _sb_jump_table[0xA0]; for (i = 0xF1; i <= 0xFE; i++) - jump_table[i] = jump_table[0xF0]; + _sb_jump_table[i] = _sb_jump_table[0xF0]; } else { for(i = 1; i <= 14; i++) { - jump_table[0xA0 + i] = jump_table_3_18_AXXX[i]; - jump_table[0xF0 + i] = jump_table_3_18_FXXX[i]; + _sb_jump_table[0xA0 + i] = _sb_jump_table_3_18_AXXX[i]; + _sb_jump_table[0xF0 + i] = _sb_jump_table_3_18_FXXX[i]; } } } -static void _pop_ctrl(int ind) +INLINE static void _pop_ctrl(int ind) { VALUE *val = &BP[ind]; RELEASE(val); @@ -266,6 +289,70 @@ NOINLINE static void _pop_optional(int ind) POP(); } +NOINLINE static void _push_me(ushort code) +{ + if (GET_UX() & 1) + { + if (DEBUG_info) + { + if (DEBUG_info->op) + { + SP->_object.class = DEBUG_info->cp; + SP->_object.object = DEBUG_info->op; + } + else if (DEBUG_info->cp) + { + SP->type = T_CLASS; + SP->_class.class = DEBUG_info->cp; + } + } + else + VALUE_null(SP); + } + else + { + if (OP) + { + SP->_object.class = CP; + SP->_object.object = OP; + } + /*else if (CP->auto_create) + { + OP = EXEC_auto_create(CP, FALSE); + SP->_object.class = CP; + SP->_object.object = OP; + OP = NULL; + }*/ + else + { + SP->type = T_CLASS; + SP->_class.class = CP; + } + } + + if (GET_UX() & 2) + { + // The used class must be in the stack, because it is tested by exec_push && exec_pop + if (OP) + { + SP->_object.class = SP->_object.class->parent; + SP->_object.super = EXEC_super; + } + else + { + SP->_class.class = SP->_class.class->parent; + SP->_class.super = EXEC_super; + } + + EXEC_super = SP; + + //fprintf(stderr, "%s\n", DEBUG_get_current_position()); + //BREAKPOINT(); + } + + PUSH(); +} + void EXEC_loop(void) { static const void *jump_table[256] = @@ -521,10 +608,10 @@ void EXEC_loop(void) /* F8 PUSH QUICK */ &&_PUSH_QUICK, /* F9 PUSH QUICK */ &&_POP_LOCAL_NOREF, /* FA PUSH QUICK */ &&_POP_PARAM_NOREF, - /* FB PUSH QUICK */ &&_PUSH_QUICK, - /* FC PUSH QUICK */ &&_PUSH_QUICK, + /* FB PUSH QUICK */ &&_POP_LOCAL_FAST, + /* FC PUSH QUICK */ &&_POP_PARAM_FAST, /* FD PUSH QUICK */ &&_PUSH_QUICK, - /* FE PUSH QUICK */ &&_PUSH_QUICK, + /* FE PUSH QUICK */ &&_JUMP_NEXT_INTEGER, /* FF PUSH QUICK */ &&_PUSH_QUICK }; @@ -559,27 +646,19 @@ void EXEC_loop(void) /* F8 PUSH QUICK */ &&_PUSH_QUICK, /* F9 PUSH QUICK */ &&_POP_LOCAL_NOREF, /* FA PUSH QUICK */ &&_POP_PARAM_NOREF, - /* FB PUSH QUICK */ &&_PUSH_QUICK, - /* FC PUSH QUICK */ &&_PUSH_QUICK, + /* FB PUSH QUICK */ &&_POP_LOCAL_FAST, + /* FC PUSH QUICK */ &&_POP_PARAM_FAST, /* FD PUSH QUICK */ &&_PUSH_QUICK, - /* FE PUSH QUICK */ &&_PUSH_QUICK, + /* FE PUSH QUICK */ &&_JUMP_NEXT_INTEGER, /* FF PUSH QUICK */ &&_PUSH_QUICK }; - static bool not_3_18 = FALSE; - int NO_WARNING(ind); ushort code; VALUE *NO_WARNING(val); _CHECK_BYTECODE: - if (CP->not_3_18 != not_3_18) - { - not_3_18 = !not_3_18; - _switch_bytecode(not_3_18, jump_table, jump_table_3_18_AXXX, jump_table_3_18_FXXX); - } - goto _MAIN; /*-----------------------------------------------*/ @@ -605,11 +684,11 @@ _MAIN: #if DEBUG_PCODE DEBUG_where(); - fprintf(stderr, "[%4d] ", (int)(intptr_t)(SP - (VALUE *)STACK_base)); - if (*PC >> 8) + fprintf(stderr, "[%4d %ld] ", (int)(intptr_t)(SP - (VALUE *)STACK_base), SP - PP); + if (*PC >> 8 && FP) PCODE_dump(stderr, PC - FP->code, PC); else - fprintf(stderr, "\n"); + fprintf(stderr, "?\n"); fflush(stderr); #endif @@ -651,8 +730,8 @@ _NEXT: #if DEBUG_PCODE DEBUG_where(); - fprintf(stderr, "[%4d] ", (int)(intptr_t)(SP - (VALUE *)STACK_base)); - if (*PC >> 8) + fprintf(stderr, "[%4d %ld] ", (int)(intptr_t)(SP - (VALUE *)STACK_base), SP - PP); + if (*PC >> 8 && FP) PCODE_dump(stderr, PC - FP->code, PC); else fprintf(stderr, "\n"); @@ -755,6 +834,13 @@ _POP_LOCAL_NOREF: goto _NEXT; +_POP_LOCAL_FAST: + + SP--; + BP[GET_XX()] = *SP; + + goto _NEXT; + /*-----------------------------------------------*/ _POP_PARAM: @@ -774,6 +860,13 @@ _POP_PARAM_NOREF: *val = *SP; goto _NEXT; +_POP_PARAM_FAST: + + SP--; + PP[GET_XX()] = *SP; + + goto _NEXT; + /*-----------------------------------------------*/ _POP_CTRL: @@ -835,66 +928,7 @@ _PUSH_CHAR: _PUSH_ME: - if (GET_UX() & 1) - { - if (DEBUG_info) - { - if (DEBUG_info->op) - { - SP->_object.class = DEBUG_info->cp; - SP->_object.object = DEBUG_info->op; - } - else if (DEBUG_info->cp) - { - SP->type = T_CLASS; - SP->_class.class = DEBUG_info->cp; - } - } - else - VALUE_null(SP); - } - else - { - if (OP) - { - SP->_object.class = CP; - SP->_object.object = OP; - } - /*else if (CP->auto_create) - { - OP = EXEC_auto_create(CP, FALSE); - SP->_object.class = CP; - SP->_object.object = OP; - OP = NULL; - }*/ - else - { - SP->type = T_CLASS; - SP->_class.class = CP; - } - } - - if (GET_UX() & 2) - { - // The used class must be in the stack, because it is tested by exec_push && exec_pop - if (OP) - { - SP->_object.class = SP->_object.class->parent; - SP->_object.super = EXEC_super; - } - else - { - SP->_class.class = SP->_class.class->parent; - SP->_class.super = EXEC_super; - } - - EXEC_super = SP; - - //fprintf(stderr, "%s\n", DEBUG_get_current_position()); - //BREAKPOINT(); - } - - PUSH(); + _push_me(code); goto _NEXT; /*-----------------------------------------------*/ @@ -1109,7 +1143,7 @@ _JUMP_IF_FALSE: _RETURN: { - static const void *return_jump[] = { &&__RETURN_GOSUB, &&__RETURN_VALUE, &&__RETURN_VOID }; + static const void *return_jump[] = { &&__RETURN_GOSUB, &&__RETURN_VALUE, &&__RETURN_VOID, &&__INIT_BYTECODE_CHECK }; goto *return_jump[GET_UX()]; @@ -1151,10 +1185,17 @@ _RETURN: EXEC_leave_keep(); - if (PC == NULL) + if (!PC) return; goto _NEXT; + + __INIT_BYTECODE_CHECK: + + _sb_jump_table = jump_table; + _sb_jump_table_3_18_AXXX = jump_table_3_18_AXXX; + _sb_jump_table_3_18_FXXX = jump_table_3_18_FXXX; + return; } /*-----------------------------------------------*/ @@ -1562,38 +1603,63 @@ _JUMP_FIRST: VALUE_conv(&SP[-2], type); - _pop_ctrl(ind + 1); /* modifie val ! */ + _pop_ctrl(ind + 1); _pop_ctrl(ind); - //val = &BP[PC[3] & 0xFF]; // loop mode is stored in the inc type. It must be strictly lower than T_STRING - if (type == T_INTEGER && inc->_integer.value > 0) - type = 1; - - inc->type = type; - - PC++; - - if (type <= T_INTEGER) + if (type == T_INTEGER && inc->_integer.value == 1 && !CP->not_3_18) { - if (inc->_integer.value < 0) - goto _JN_INTEGER_TEST_DEC; - else - goto _JN_INTEGER_TEST_INC; + PC++; + *PC = C_JUMP_NEXT_INTEGER | ind; + goto _JN_INTEGER_TEST_INC; + } + else + { + if (type == T_INTEGER && inc->_integer.value > 0) + type = 1; + + inc->type = type; + + PC++; + *PC |= ind; + + if (type <= T_INTEGER) + { + if (inc->_integer.value < 0) + goto _JN_INTEGER_TEST_DEC; + else + goto _JN_INTEGER_TEST_INC; + } + else if (type == T_LONG) + goto _JN_LONG_TEST; + else if (type == T_SINGLE) + goto _JN_SINGLE_TEST; + else //if (type == T_FLOAT) + goto _JN_FLOAT_TEST; } - else if (type == T_LONG) - goto _JN_LONG_TEST; - else if (type == T_SINGLE) - goto _JN_SINGLE_TEST; - else //if (type == T_FLOAT) - goto _JN_FLOAT_TEST; /*-----------------------------------------------*/ +_JUMP_NEXT_INTEGER: + + end = &BP[GET_XX()]; + val = &BP[PC[2] & 0xFF]; + + val->_integer.value++; + + if (val->_integer.value <= end->_integer.value) + PC += 3; + else + PC += (signed short)PC[1] + 2; + + goto _MAIN; + +/*-----------------------------------------------*/ + _JUMP_NEXT: - end = &BP[PC[-1] & 0xFF]; + end = &BP[GET_XX()]; inc = end + 1; val = &BP[PC[2] & 0xFF]; diff --git a/main/gbx/gbx_jit.c b/main/gbx/gbx_jit.c index 044a7bab4..84a76d528 100644 --- a/main/gbx/gbx_jit.c +++ b/main/gbx/gbx_jit.c @@ -294,6 +294,7 @@ bool JIT_exec(bool ret_on_stack) STACK_push_frame(&EXEC_current, func->stack_usage); CP = class; + EXEC_check_bytecode(); OP = object; FP = func; EC = NULL; diff --git a/main/gbx/gbx_stack.h b/main/gbx/gbx_stack.h index 5af72be5f..1fefae0b2 100644 --- a/main/gbx/gbx_stack.h +++ b/main/gbx/gbx_stack.h @@ -127,6 +127,7 @@ STACK_CONTEXT *STACK_get_frame(uint frame); STACK_frame++; \ STACK_frame_count--; \ STACK_limit += sizeof(STACK_CONTEXT); \ + EXEC_check_bytecode(); \ }) #define STACK_enable_for_eval() STACK_limit += STACK_FOR_EVAL * sizeof(VALUE) diff --git a/main/gbx/gbx_stream.c b/main/gbx/gbx_stream.c index 660ea3b1b..97ceba83e 100644 --- a/main/gbx/gbx_stream.c +++ b/main/gbx/gbx_stream.c @@ -1524,6 +1524,10 @@ void STREAM_read_type(STREAM *stream, TYPE type, VALUE *value) break; + case T_NULL: + + break; + default: THROW_SERIAL(); @@ -1695,6 +1699,10 @@ void STREAM_write_type(STREAM *stream, TYPE type, VALUE *value) } break; + case T_NULL: + + break; + default: THROW_SERIAL(); diff --git a/main/lib/eval/eval_trans_expr.c b/main/lib/eval/eval_trans_expr.c index 6f3f33abc..c8343c7eb 100644 --- a/main/lib/eval/eval_trans_expr.c +++ b/main/lib/eval/eval_trans_expr.c @@ -483,7 +483,7 @@ void TRANS_reference(void) { TRANS_expression(); - if (!CODE_popify_last()) + if (!CODE_popify_last(FALSE)) THROW("Invalid assignment"); EVAL->assign_code = EVAL->code[EVAL->ncode - 1]; diff --git a/main/lib/jit/jit_body.c b/main/lib/jit/jit_body.c index 1f4d5a45c..68341517f 100644 --- a/main/lib/jit/jit_body.c +++ b/main/lib/jit/jit_body.c @@ -2879,8 +2879,8 @@ bool JIT_translate_body(FUNCTION *func, int ind) /* F8 PUSH QUICK */ &&_PUSH_QUICK, /* F9 PUSH QUICK */ &&_POP_LOCAL_NOREF, /* FA PUSH QUICK */ &&_POP_PARAM_NOREF, - /* FB PUSH QUICK */ &&_PUSH_QUICK, - /* FC PUSH QUICK */ &&_PUSH_QUICK, + /* F9 PUSH QUICK */ &&_POP_LOCAL_FAST, + /* FA PUSH QUICK */ &&_POP_PARAM_FAST, /* FD PUSH QUICK */ &&_PUSH_QUICK, /* FE PUSH QUICK */ &&_PUSH_QUICK, /* FF PUSH QUICK */ &&_PUSH_QUICK @@ -2985,6 +2985,7 @@ _POP_LOCAL: goto _MAIN; _POP_LOCAL_NOREF: +_POP_LOCAL_FAST: if (class->not_3_18) goto _PUSH_QUICK; @@ -3020,6 +3021,7 @@ _POP_PARAM: goto _MAIN; _POP_PARAM_NOREF: +_POP_PARAM_FAST: if (class->not_3_18) goto _PUSH_QUICK; diff --git a/main/share/gb_code.h b/main/share/gb_code.h index bff105903..229ff001c 100644 --- a/main/share/gb_code.h +++ b/main/share/gb_code.h @@ -43,7 +43,7 @@ EXTERN unsigned char CODE_disabled; void CODE_begin_function(void); void CODE_end_function(void); -bool CODE_popify_last(void); +bool CODE_popify_last(bool no_conv); #else @@ -58,7 +58,7 @@ void CODE_begin_function(FUNCTION *func); void CODE_end_function(FUNCTION *func); FUNCTION *CODE_set_function(FUNCTION *func); -bool CODE_popify_last(void); +bool CODE_popify_last(bool no_conv); bool CODE_check_statement_last(void); bool CODE_check_pop_local_last(short *local); bool CODE_check_jump_not(void); @@ -71,6 +71,7 @@ bool CODE_check_ismissing(void); //void CODE_break(void); void CODE_pop_local(short num); +void CODE_pop_local_noref(short num); //void CODE_pop_param(short num); void CODE_pop_global(short global, bool is_static); void CODE_pop_symbol(short symbol); diff --git a/main/share/gb_code_temp.h b/main/share/gb_code_temp.h index 7169fd7ea..13bedaf66 100644 --- a/main/share/gb_code_temp.h +++ b/main/share/gb_code_temp.h @@ -254,7 +254,7 @@ static ushort *get_last_code2() return &cur_func->code[cur_func->last_code2]; } -bool CODE_popify_last(void) +bool CODE_popify_last(bool no_conv) { /* #ifdef DEBUG @@ -272,43 +272,33 @@ bool CODE_popify_last(void) op = *last_code & 0xFF00; - if ((op >= C_PUSH_LOCAL && op <= C_PUSH_UNKNOWN) || op == C_PUSH_LOCAL_NOREF || op == C_PUSH_PARAM_NOREF) + if ((op >= C_PUSH_LOCAL && op <= C_PUSH_UNKNOWN)) { *last_code += 0x0800; - use_stack(-2); - #ifdef DEBUG - printf("Popify Last\n"); - #endif - return TRUE; } - - if ((op & 0xF000) == C_PUSH_DYNAMIC) + else if (op == C_PUSH_LOCAL_NOREF) + { + if (no_conv) + *last_code = C_POP_LOCAL_FAST | (*last_code & 0xFF); + else + *last_code = C_POP_LOCAL_NOREF | (*last_code & 0xFF); + } + else if (op == C_PUSH_PARAM_NOREF) + { + if (no_conv) + *last_code = C_POP_PARAM_FAST | (*last_code & 0xFF); + else + *last_code = C_POP_PARAM_NOREF | (*last_code & 0xFF); + } + else if ((op & 0xF000) == C_PUSH_DYNAMIC) { *last_code += 0x1000; - use_stack(-2); - #ifdef DEBUG - printf("Popify Last\n"); - #endif - return TRUE; } + else + return FALSE; - /* - if (*last_code == (C_PUSH_MISC | CPM_LAST)) - { - *last_code = C_PUSH_MISC | CPM_POP_LAST; - use_stack(-2); - return TRUE; - } - */ - /* - if (op == C_CALL) - { - *last_code = C_CALL_POP | (*last_code & 0xFF); - return TRUE; - } - */ - - return FALSE; + use_stack(-2); + return TRUE; } @@ -539,6 +529,30 @@ void CODE_pop_local(short num) write_ZZxx(C_POP_PARAM, num); } +void CODE_pop_local_noref(short num) +{ + if (COMP_version < 0x03180000) + { + CODE_pop_local(num); + return; + } + + LAST_CODE; + + use_stack(-1); + + #ifdef DEBUG + if (num >= 0) + printf("POP LOCAL NOREF #%d\n", num); + else + printf("POP PARAM NOREF #%d\n", (-1) - num); + #endif + if (num >= 0) + write_ZZxx(C_POP_LOCAL_NOREF, num); + else + write_ZZxx(C_POP_PARAM_NOREF, num); +} + void CODE_pop_ctrl(short num) { diff --git a/main/share/gb_pcode.h b/main/share/gb_pcode.h index abccbcf09..766310bd4 100644 --- a/main/share/gb_pcode.h +++ b/main/share/gb_pcode.h @@ -36,6 +36,9 @@ #define C_POP_VARIABLE 0xF600 #define C_POP_LOCAL_NOREF 0xF900 #define C_POP_PARAM_NOREF 0xFA00 +#define C_POP_LOCAL_FAST 0xFB00 +#define C_POP_PARAM_FAST 0xFC00 +#define C_JUMP_NEXT_INTEGER 0xFE00 #define C_PUSH_CONST 0xE000 diff --git a/main/share/gb_pcode_temp.h b/main/share/gb_pcode_temp.h index 98f85a1fa..8607c34ab 100644 --- a/main/share/gb_pcode_temp.h +++ b/main/share/gb_pcode_temp.h @@ -164,6 +164,14 @@ short PCODE_dump(FILE *out, ushort addr, PCODE *code) fprintf(out, "POP PARAM NOREF %d", (char)(op & 0xFF)); break; + case C_POP_LOCAL_FAST: + fprintf(out, "POP LOCAL FAST %d", (op & 0xFF)); + break; + + case C_POP_PARAM_FAST: + fprintf(out, "POP PARAM FAST %d", (char)(op & 0xFF)); + break; + default: fprintf(out, "PUSH QUICK %d", (short)value); } @@ -246,6 +254,14 @@ short PCODE_dump(FILE *out, ushort addr, PCODE *code) fprintf(out, "POP PARAM NOREF %d", (char)(op & 0xFF)); break; + case C_POP_LOCAL_FAST: + fprintf(out, "POP LOCAL FAST %d", (op & 0xFF)); + break; + + case C_POP_PARAM_FAST: + fprintf(out, "POP PARAM FAST %d", (char)(op & 0xFF)); + break; + default: fprintf(out, "PUSH QUICK %d", (short)value); }