Closed iss000 closed 12 months ago
Eh, this was epic! There 2 bugs one in cpm65 and one in llvm-mos-sdk!
The long story short, although ldx absolute_16bit,y
is fine, stx absolute_16bit,y
is completely illegal for 6502.
It took me whole day to find out the problem with llvm-mos-sdk v.4.x.x vs. v.6.x.x.
Here is it:
v.4.x.x silently compiles it as stx zp,y
and it seams to work.
v.6.x.x silently inserts invalid op code 0x9b
and execution goes to 'BRK' handler.
Interesting is if using explicitly constant for address stx 0x1000,y
llvm-mos gives proper error message. So, I'll open an issue at llvm-mos repo too.
For my builds I'm using the official llvm-mos-sdk releases. While everything works just fine with SDK v.4.0.0:
The newer versions v.6.0.0 and v.6.1.0 produce not working result:
I'm focused on Oric but tested Apple][ and it hangs too.
Maybe this is not an issue of cpm65 but IMHO it should be considered when building.