Polling time/date in SpartaDOS 3.2 or X in BASIC. ARGH!


Polling time/date in SpartaDOS 3.2 or X in BASIC. ARGH!

von tschak909 » So 28. Feb 2021, 22:36
I am needing to consistently poll time in BASIC for a patched version of FoReM-26M BBS I am releasing. However, when I try to execute the following inside a USR ADR string, it crashes, why?

```
PLA           ; needed for USR
LDA $D301
PHA
AND $FE
STA $D301
JSR $FFC0
PLA
STA $D301
RTS
```

-Thom

Re: Polling time/date in SpartaDOS 3.2 or X in BASIC. ARGH!

von Dietrich » Di 9. Mär 2021, 18:35
1) Use "AND #$FE" instead of "AND $FE"
2) You are turning off the OS! If you don't disable interrupts or don't have valid NMI and IRQ interrupt routines located at ($FFFA) resp. ($FFFE), the Atari may crash at the next interrupt
3) For "JSR $FFC0" you'll of course need valid code at this address (in the RAM below the OS ROM)