]> git.sur5r.net Git - cc65/commitdiff
Don't presume the stack size to be a multiple of pages.
authorOliver Schmidt <ol.sc@web.de>
Thu, 10 Mar 2016 09:07:09 +0000 (10:07 +0100)
committerOliver Schmidt <ol.sc@web.de>
Thu, 10 Mar 2016 09:07:09 +0000 (10:07 +0100)
libsrc/supervision/crt0.s

index d78bfeab53b2203daeea89afe5a7f01125d40b01..6c12878681d3748640caf5fcb5a2a7c87719ab01 100644 (file)
@@ -31,9 +31,10 @@ reset:
         ; Initialize data.
         jsr     copydata
 
-        lda     #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
-        sta     sp+1            ; Set argument stack ptr
-        stz     sp              ; #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+        lda     #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+        ldx     #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+        sta     sp
+        stx     sp+1            ; Set argument stack ptr
         jsr     initlib
         jsr     _main
 _exit:  jsr     donelib