If I use the sample code: *((WORD huge *)0xf1236) = 10; The assembly code generated is: mov r4,#10 exts #fh,#1 mov dpp0:0x1236,r4 When this code executes within a class b trap handler, the memory location being written appears to be 0x01236, but if I execute the same code outside of a trap, the memory location changed is 0xf1236. Is there a C167 issue that anyone is aware of which could cause the segment override to fail in trap routines?
Thanks for the suggestion. It doesn't make any difference. I have sent a copy of code and screen shot to hitex, the emulator people. I'm wondering if the problem is related to a context switch that happens when entering the trap b routine. To work around the problem, I save the trap stack information in an sdata structure, and replace the return address on the stack with a pointer to a routine which copies from sdata to the desired address and does a srst. This works ok, so the issue is something related to being in a trap. In fact, the variable is in hdata0, but within the trap routine, it wants to use page mode addressing. It actually writes to dpp3:0x3328 which turns out to be 0:0xf328 in absolute addressing. It completely disreguards the exts request.