neilsf / xc-basic3

A BASIC cross compiler for MOS 6502-based machines
MIT License
44 stars 5 forks source link

Ability to set and clear the CPU's IRQ flag #216

Closed neilsf closed 1 year ago

neilsf commented 2 years ago

XC=BASIC version 2.x offered a way to set and clear the CPU's IRQ flag using the commands DISABLEIRQ and ENABLEIRQ. Version 3.1 uses a different approach to interrupts, it can only enable or disable serving specific interrupts but it lacks the ability to turn interrupts on and off completely.

JJFlash-IT commented 2 years ago

We are discussing this on the Fb group, I was going to comment here that reserving more words for doing something that is practically already possible with the existing functionality (* INTERRUPT OFF/ON commands) wouldn't be the best thing, and you reached the same conclusion :)

If there could be a way to use SYSTEM INTERRUPT OFF/ON to just disable/enable the system IRQ without installing the custom IRQ routine, the compiled program would be shorter (no routine and no runtime-library variables needed).

neilsf commented 1 year ago

Closing this as SYSTEM INTERRUPT OFF effectively turns off interrupts.