From: Michel Pollet Date: Wed, 10 Jan 2018 09:52:39 +0000 (+0000) Subject: core: Add the overflow special ocode for JIT X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=refs%2Fheads%2Fwip%2Fjit;p=sx%2Fsimavr.git core: Add the overflow special ocode for JIT Merging that changes from the main branch Signed-off-by: Michel Pollet --- diff --git a/simavr/sim/sim_core.c b/simavr/sim/sim_core.c index 23ba093..1143839 100644 --- a/simavr/sim/sim_core.c +++ b/simavr/sim/sim_core.c @@ -1416,11 +1416,11 @@ run_one_again: case 0xf000: { switch (opcode & 0xfe00) { case 0xf100: { /* simavr special opcodes */ - if (opcode == 0xf1f1) { // AVR_OVERFLOW_OPCODE + if (opcode == 0xf1f1) emit { // AVR_OVERFLOW_OPCODE printf("FLASH overflow, soft reset\n"); new_pc = 0; TRACE_JUMP(); - } + } end_emit; } break; case 0xf000: case 0xf200: diff --git a/simavr/sim/sim_core_jit.h b/simavr/sim/sim_core_jit.h index 80d4fe9..4ad7497 100644 --- a/simavr/sim/sim_core_jit.h +++ b/simavr/sim/sim_core_jit.h @@ -872,6 +872,15 @@ jit_generate(opcode, 0+F_OP, case 0xf000: { switch (opcode & 0xfe00) { + case 0xf100: { /* simavr special opcodes */ + if (opcode == 0xf1f1) { // AVR_OVERFLOW_OPCODE +jit_generate(opcode, 0+F_JUMP+F_NO_PC, +"printf(\"FLASH overflow, soft reset\\n\");\n" +"new_pc = 0;\n" +"TRACE_JUMP();\n" +); + } break; + } break; case 0xf000: case 0xf200: case 0xf400: