From 52865410d2269e074bb7c41683d023f875b69f19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20M=C3=BChlstrasser?= Date: Wed, 25 Feb 2015 23:48:57 +0100 Subject: [PATCH] Fix wrong expression for top of C stack. Thanks to Greg King for this fix. --- libsrc/osic1p/crt0.s | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libsrc/osic1p/crt0.s b/libsrc/osic1p/crt0.s index 657ee2743..62342c206 100644 --- a/libsrc/osic1p/crt0.s +++ b/libsrc/osic1p/crt0.s @@ -9,6 +9,7 @@ .export __STARTUP__ : absolute = 1 ; Mark as startup .import __RAM_START__, __RAM_SIZE__ ; Linker generated +.import __STACKSIZE__ .import zerobss, initlib, donelib @@ -31,9 +32,9 @@ _init: ldx #$FF ; Initialize stack pointer to $01FF ; --------------------------------------------------------------------------- ; Set cc65 argument stack pointer - lda #<(__RAM_START__ + __RAM_SIZE__) + lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__) sta sp - lda #>(__RAM_START__ + __RAM_SIZE__) + lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__) sta sp+1 ; --------------------------------------------------------------------------- -- 2.39.5