Merge pull request #21 from bsekisser/sim_core_eicall_eijmp_bugfix
authorMichel Pollet <buserror+git@gmail.com>
Sun, 7 Jul 2013 20:56:15 +0000 (13:56 -0700)
committerMichel Pollet <buserror+git@gmail.com>
Sun, 7 Jul 2013 20:56:15 +0000 (13:56 -0700)
sim_core.c: extended data type to 32 bits for eicall/eijmp instruction.

simavr/sim/sim_core.c

index 6db0b87..03d46ff 100644 (file)
@@ -846,7 +846,7 @@ avr_flashaddr_t avr_run_one(avr_t * avr)
                                        int p = opcode & 0x100;
                                        if (e && !avr->eind)
                                                _avr_invalid_opcode(avr);
-                                       uint16_t z = avr->data[R_ZL] | (avr->data[R_ZH] << 8);
+                                       uint32_t z = avr->data[R_ZL] | (avr->data[R_ZH] << 8);
                                        if (e)
                                                z |= avr->data[avr->eind] << 16;
                                        STATE("%si%s Z[%04x]\n", e?"e":"", p?"call":"jmp", z << 1);