changeset 16:d5ae140d19d4

Make sure DP is set correcting during IRQ handling Since DP may have been modified arbitrarily when an IRQ occurs, force it back to 0 before running the IRQ handler, notably the keyboard code. By being able to rely on DP being set correctly, the code size and execution time are both improved somewhat.
author William Astle <lost@l-w.ca>
date Sun, 06 Nov 2022 15:00:27 -0700
parents 686b600a62ee
children f86967c0bc73
files src/lwbasic.s
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lwbasic.s	Sun Nov 06 14:57:32 2022 -0700
+++ b/src/lwbasic.s	Sun Nov 06 15:00:27 2022 -0700
@@ -452,6 +452,8 @@
                 endc
                 rti
 irqhandler0     lda PIA0.DB                     ; clear VSYNC flag
+                clra                            ; make sure DP is pointing to the right place
+                tfr a,dp
                 bsr keyb_read                   ; go handle the keyboard
                 rti
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;