]> git.sur5r.net Git - cc65/commitdiff
Avoid indirect jmp with unknown vector address.
authorOliver Schmidt <ol.sc@web.de>
Sun, 26 Jan 2014 17:10:01 +0000 (18:10 +0100)
committerOliver Schmidt <ol.sc@web.de>
Sun, 26 Jan 2014 17:10:01 +0000 (18:10 +0100)
libsrc/apple2/crt0.s
libsrc/apple2/exec.s
libsrc/apple2/reboot.s

index 27c44f016dced102309cbe7af2b79a41dfa3a7e5..a140a7249041c74863dc69328d2688e4eb83d24b 100644 (file)
@@ -107,7 +107,7 @@ exit:   ldx     #$02
         txs                     ; Re-init stack pointer
 
         ; We're done
-        jmp     (done)
+        jmp     done
 
         .segment        "INIT"
 
@@ -148,8 +148,8 @@ init:   ldx     #zpspace-1
         ; No BASIC.SYSTEM so quit to ProDOS dispatcher instead
         lda     #<quit
         ldx     #>quit
-        sta     done
-        stx     done+1
+        sta     done+1
+        stx     done+2
         
         ; No BASIC.SYSTEM so use addr of ProDOS system global page
         lda     #<$BF00
@@ -202,8 +202,8 @@ q_param:.byte   $04             ; param_count
 
         .data
 
-        ; Location to jump to when we're done
-done:   .addr   DOSWARM
+        ; Final jump when we're done
+done:   jmp     DOSWARM         ; Potentially patched at runtime
 
         .segment        "ZPSAVE"
 
index 914e10c50e0e70666dcd84ae770ac7d8c3ccf1cb..c486306bbde88873de31b77251d05c5a25e39632 100644 (file)
@@ -161,8 +161,8 @@ setbuf: lda     #$00            ; Low byte
         ; Call loader stub after C libary shutdown
         lda     #<target
         ldx     #>target
-        sta     done
-        stx     done+1
+        sta     done+1
+        stx     done+2
 
         ; Initiate C libary shutdown
         jmp     _exit
index 89c34bdf0f43b1fc1ffbc8e50f8a0a5ea9eb3399..8ee1ba0670fead5e8432a72475f2da272012c2ca 100644 (file)
@@ -16,6 +16,6 @@ initreboot:
         ; Quit to PWRUP
         lda     #<$FAA6
         ldx     #>$FAA6
-        sta     done
-        stx     done+1
+        sta     done+1
+        stx     done+2
         rts