From: Peter Ross Date: Sat, 1 Dec 2012 02:07:05 +0000 (+1100) Subject: core: larger data type to store extended z-pointer value X-Git-Tag: v1.1~22 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=cc901dc34ea36d1085dbe47271e1579f7850a2a4;p=sx%2Fsimavr.git core: larger data type to store extended z-pointer value --- 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?"+":"");