From cc901dc34ea36d1085dbe47271e1579f7850a2a4 Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Sat, 1 Dec 2012 13:07:05 +1100 Subject: [PATCH] core: larger data type to store extended z-pointer value --- simavr/sim/sim_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simavr/sim/sim_core.c b/simavr/sim/sim_core.c index 5e7e2c8..6db0b87 100644 --- a/simavr/sim/sim_core.c +++ b/simavr/sim/sim_core.c @@ -918,7 +918,7 @@ avr_flashaddr_t avr_run_one(avr_t * avr) case 0x9007: { // ELPM Extended Load Program Memory 1001 000d dddd 01oo if (!avr->rampz) _avr_invalid_opcode(avr); - uint16_t z = avr->data[R_ZL] | (avr->data[R_ZH] << 8) | (avr->data[avr->rampz] << 16); + uint32_t z = avr->data[R_ZL] | (avr->data[R_ZH] << 8) | (avr->data[avr->rampz] << 16); uint8_t r = (opcode >> 4) & 0x1f; int op = opcode & 3; STATE("elpm %s, (Z[%02x:%04x]%s)\n", avr_regname(r), z >> 16, z&0xffff, opcode?"+":""); -- 2.39.5