More likely the address given to fetch was not aligned: static void fetch(void) { const ucell *aaddr = (ucell *)cell2pointer(POP()); PUSH(read_ucell(aaddr)); }
Here QEMU can help, enable DEBUG_PCALL in target-sparc/op_helper.c and recompile. Then run QEMU with -d int and /tmp/qemu.log will contain the register dump at the time of the exception.
I enabled DEBUG_PCALL as well as DEBUG_UNALIGNED in target-sparc/op_helper.c. Output for qemu was:
0 > boot cdrom [sparc64] Booting file 'cdrom' with parameters '' Not a bootable ELF image Not a Linux kernel image Not a bootable a.out image Loading FCode image... Loaded 7420 bytes entry point is 0x4000 Evaluating FCode... Unaligned access to 0x0000000000000014 from 0x00000000ffd10d9c Unhandled Exception 0x0000000000000034 PC = 0x00000000ffd10de4 NPC = 0x00000000ffd10de8 Stopping execution
and /tmp/qemu.log contains this at the end:
Search PC... 4550: Unaligned Memory Access (v=0034) pc=00000000ffd10de4 npc=00000000ffd10de8 SP=00000000fff10cd1 pc: 00000000ffd10de4 npc: 00000000ffd10de8 General Registers: %g0: 0000000000000000 %g1: 00000000000000b8 %g2: 0000000000000014 %g3: 00000000ffee3d50 %g4: 00000000ffee3000 %g5: 0000000000000041 %g6: 0000000000000000 %g7: 0000000000000000 Current Register Window: %o0: 000000000000003f %o1: 00000000ffe130f0 %o2: 0000000000000018 %o3: 00000000ffee3000 %o4: 00000000ffee3c00 %o5: 0000000000000210 %o6: 00000000fff10cd1 %o7: 00000000ffd0f068 %l0: 00000000ffee3000 %l1: 0000000000000000 %l2: 00000000ffee3000 %l3: 0000000000000000 %l4: 000000000000001a %l5: 0000000000000000 %l6: 0000000000000000 %l7: 0000000000000000 %i0: 00000000ffe1ac30 %i1: 0000000000000200 %i2: 00000000ffe00000 %i3: 0000000000000000 %i4: ffffffffffffffff %i5: 0000000000000018 %i6: 00000000fff10d91 %i7: 00000000ffd126f8
Floating Point Registers: %f00: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f04: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f08: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f12: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f16: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f20: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f24: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 %f28: 000000000.000000 000000000.000000 000000000.000000 000000000.000000 pstate: 0x00000016 ccr: 0x44 asi: 0x00 tl: 0 fprs: 0 cansave: 6 canrestore: 0 otherwin: 0 wstate 0 cleanwin 7 cwp 4 fsr: 0x00000000
-Nick
-------- This e-mail may contain confidential and privileged material for the sole use of the intended recipient. If this email is not intended for you, or you are not responsible for the delivery of this message to the intended recipient, please note that this message may contain SEAKR Engineering (SEAKR) Privileged/Proprietary Information. In such a case, you are strictly prohibited from downloading, photocopying, distributing or otherwise using this message, its contents or attachments in any way. If you have received this message in error, please notify us immediately by replying to this e-mail and delete the message from your mailbox. Information contained in this message that does not relate to the business of SEAKR is neither endorsed by nor attributable to SEAKR.