]> git.sur5r.net Git - cc65/commitdiff
Don't hardcode the stack location
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 8 Mar 2001 14:48:00 +0000 (14:48 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 8 Mar 2001 14:48:00 +0000 (14:48 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@609 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/c64/crt0.s
libsrc/c64/read.s

index a6cee8c2237768559c4b4d74d7f300842af20111..397e51bcfb76b36e20b3b624df473f38ade997df 100644 (file)
@@ -8,6 +8,7 @@
        .import         initlib, donelib
                .import         zerobss, push0
        .import         _main
+       .import         __RAM_START__, __RAM_SIZE__     ; Linker generated
 
        .include        "c64.inc"
        .include        "../cbm/cbm.inc"
@@ -85,9 +86,9 @@ L1:   lda     sp,x
                ora     #$06            ; Enable kernal+I/O, disable basic
        sta     $01
 
-       lda     #<$D000
+       lda     #<(__RAM_START__ + __RAM_SIZE__)
        sta     sp
-       lda     #>$D000
+       lda     #>(__RAM_START__ + __RAM_SIZE__)
                sta     sp+1            ; Set argument stack ptr
 
 ; Call module constructors
index 1aa40ad1e36e3b3c59e78e0076f39dc095958730..22d7b1d374e8fa6e2f61f68d467c8f538cde8e6d 100644 (file)
@@ -26,7 +26,10 @@ _read:       jsr     popax           ; get count
 L1:            lda     ptr2
        ora     ptr2+1          ; count zero?
        beq     L9
-       jsr     BASIN
+       dec     ptr2
+       bne     L1a
+       dec     ptr2+1
+L1a:           jsr     BASIN
        ldy     #0
        sta     (ptr1),y        ; save char
        inc     ptr1