Page 2 of 2
Re: Bug in 6502 BRK.
Posted: Fri Jan 02, 2026 1:21 pm
by orac81
Thats interesting, thanks. So this problem shouldn't occur with the CBM machines as they dont use NMIs in the normal OS.
Perhaps the C128 problem above is caused by some other bug? For example, I recall there is some problem using decimal mode on the v20, because the IRQ rom routine doesn't handle it properly. The machines definitely have other bugs.
Re: Bug in 6502 BRK.
Posted: Fri Jan 02, 2026 7:23 pm
by BigDumbDinosaur
Thats interesting, thanks. So this problem shouldn't occur with the CBM machines as they dont use NMIs in the normal OS.
The pseudo-RS-232 routines in the VIC-20, C-64 and C-128 use NMIs. In other words, if you are using a modem, you are using NMIs.
Re: Bug in 6502 BRK.
Posted: Sat Jan 03, 2026 10:47 am
by orac81
Yes, you are right, forgot about rs232, although I built the Maplin userport level converter kit back in the day. Hardly ever used on CBMs since its software driven, 5 volt only, CPU intensive and very slow. 2400 baud was unreliable on the c64 because of NMI conflicts with VIC2 "bad lines", unless you disable the screen.
It would have made more sense to use the V20/C64 ROM space for a mc monitor, and put the rs232 software as a util on the free 1541 disk, a disk was supplied with the modem anyway.
Most CBM devices (like printers) use IEC serial.
Anyway, sounds like IRQ/BRK work together fine, just check the break flag. Not sure its a very profitable way to call code, I wonder what compiler/tool was used on the AttackUfo code, written around 1979ish..
Re: Bug in 6502 BRK.
Posted: Sat Jan 03, 2026 9:07 pm
by 6502inside
Do any early 6502 Forth compilers use this BRK method to save memory?
Dunno about Forth, but Aresco FOCAL on the KIM-1 does use BRK as a software interrupt rather heavily.