davidgiven / cpm65

CP/M for the 6502
BSD 2-Clause "Simplified" License
270 stars 24 forks source link

Dependency on a certain version of llvm-mos #72

Closed iss000 closed 12 months ago

iss000 commented 1 year ago

For my builds I'm using the official llvm-mos-sdk releases. While everything works just fine with SDK v.4.0.0: Screenshot_20231007_192827

The newer versions v.6.0.0 and v.6.1.0 produce not working result: Screenshot_20231007_192540

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.

iss000 commented 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: Screenshot_20231030_112454

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.