From: cuz Date: Thu, 8 Mar 2001 14:48:00 +0000 (+0000) Subject: Don't hardcode the stack location X-Git-Tag: V2.12.0~2945 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=22b55ae7fed5262fa3f038240b2dfb7e4109156c;p=cc65 Don't hardcode the stack location git-svn-id: svn://svn.cc65.org/cc65/trunk@609 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/c64/crt0.s b/libsrc/c64/crt0.s index a6cee8c22..397e51bcf 100644 --- a/libsrc/c64/crt0.s +++ b/libsrc/c64/crt0.s @@ -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 diff --git a/libsrc/c64/read.s b/libsrc/c64/read.s index 1aa40ad1e..22d7b1d37 100644 --- a/libsrc/c64/read.s +++ b/libsrc/c64/read.s @@ -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