From 21ab0038d184a4ac51f62b607e0ac3f8d58bce40 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Wed, 10 Jan 2018 09:52:39 +0000 Subject: [PATCH] core: Add the overflow special ocode for JIT Merging that changes from the main branch Signed-off-by: Michel Pollet --- simavr/sim/sim_core.c | 4 ++-- simavr/sim/sim_core_jit.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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: -- 2.39.5