Commit cc901dc34ea36d1085dbe47271e1579f7850a2a4
authorPeter Ross <pross@xvid.org>
Sat, 1 Dec 2012 02:07:05 +0000 (13:07 +1100)
committerJakob Gruber <jakob.gruber@gmail.com>
Mon, 6 May 2013 16:32:34 +0000 (18:32 +0200)
simavr/sim/sim_core.c

index 5e7e2c8f86342a1e42a031f848d46efabf5f2165..6db0b87469456ee3373dad0633cd381e92562293 100644 (file)
@@ -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?"+":"");