]> git.sur5r.net Git - cc65/commitdiff
take __RESERVED_MEMORY__ from linker script into account when setting
authorcpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 7 Aug 2005 15:48:32 +0000 (15:48 +0000)
committercpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 7 Aug 2005 15:48:32 +0000 (15:48 +0000)
upper memory limit

git-svn-id: svn://svn.cc65.org/cc65/trunk@3569 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/atari/crt0.s

index 83b49334169f27a91267b66227c8ddd0106dcce0..f930f470ca5236562bccc74a23a2b38ebeb0905a 100644 (file)
@@ -16,6 +16,7 @@
                .import         zerobss, pushax
        .import         _main, __filetab, getfd
        .import         __LOWCODE_LOAD__, __BSS_LOAD__
+       .import         __RESERVED_MEMORY__
 .ifdef DYNAMIC_DD
        .import         __getdefdev
 .endif
@@ -68,10 +69,13 @@ L1: lda     sp,x
        lda     APPMHI+1
        sta     appmsav+1
 
+       sec
        lda     MEMTOP
+       sbc     #<__RESERVED_MEMORY__
        sta     APPMHI                  ; initialize our APPMHI value
-       ldx     MEMTOP+1
-       stx     APPMHI+1
+       lda     MEMTOP+1
+       sbc     #>__RESERVED_MEMORY__
+       sta     APPMHI+1
 
 ; Call module constructors