hoglet67 / PiTubeDirect

Bare-metal Raspberry Pi project that attaches to the Acorn TUBE interface and emulates many BBC Micro Co Processors
GNU General Public License v3.0
187 stars 23 forks source link

JIT 6502: BRK in 6502 IRQ leaks 17 words of FIQ stack #125

Closed hoglet67 closed 1 year ago

hoglet67 commented 3 years ago

The following programs hangs after ~7740 iterations:

10 *FX 14,4
20 ON ERROR RUN
30 I%=I%+1
40 PRINT I%
50 *WIBBLE
>I%=0
>RUN
1
2
...
7742
<hangs>

This is due to a known ARM FIQ stack leak of 17 words when a tube error occurs (a BRK in the 6502 IRQ handler).

hoglet67 commented 3 years ago

Work arounds: