Now that we reduce the size of the RAM memory area by the stacksize in the linker configuration we need to add the stacksize to end of the RAM area when setting the initial stack pointer in the startup code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4822 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -8,7 +8,8 @@
|
|||||||
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
||||||
.import initlib, donelib
|
.import initlib, donelib
|
||||||
.import callmain, zerobss
|
.import callmain, zerobss
|
||||||
.import __RAM_START__, __RAM_SIZE__, __BSS_LOAD__
|
.import __RAM_START__, __RAM_SIZE__
|
||||||
|
.import __BSS_LOAD__, __STACKSIZE__
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "atmos.inc"
|
.include "atmos.inc"
|
||||||
@@ -60,9 +61,9 @@ L1: lda sp,x
|
|||||||
tsx
|
tsx
|
||||||
stx spsave ; save system stk ptr
|
stx spsave ; save system stk ptr
|
||||||
|
|
||||||
lda #<(__RAM_START__ + __RAM_SIZE__)
|
lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp
|
sta sp
|
||||||
lda #>(__RAM_START__ + __RAM_SIZE__)
|
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp+1 ; Set argument stack ptr
|
sta sp+1 ; Set argument stack ptr
|
||||||
|
|
||||||
; Call module constructors
|
; Call module constructors
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
.import push0, callmain
|
.import push0, callmain
|
||||||
.import RESTOR, BSOUT, CLRCH
|
.import RESTOR, BSOUT, CLRCH
|
||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__
|
.import __RAM_START__, __RAM_SIZE__, __STACKSIZE__
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "c128.inc"
|
.include "c128.inc"
|
||||||
@@ -77,9 +77,9 @@ L1: lda sp,x
|
|||||||
tsx
|
tsx
|
||||||
stx spsave ; Save the system stack pointer
|
stx spsave ; Save the system stack pointer
|
||||||
|
|
||||||
lda #<(__RAM_START__ + __RAM_SIZE__)
|
lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp
|
sta sp
|
||||||
lda #>(__RAM_START__ + __RAM_SIZE__)
|
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp+1 ; Set argument stack ptr
|
sta sp+1 ; Set argument stack ptr
|
||||||
|
|
||||||
; If we have IRQ functions, chain our stub into the IRQ vector
|
; If we have IRQ functions, chain our stub into the IRQ vector
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
.import RESTOR, BSOUT, CLRCH
|
.import RESTOR, BSOUT, CLRCH
|
||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
||||||
|
.import __STACKSIZE__ ; Linker generated
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
@@ -71,9 +72,9 @@ L1: lda sp,x
|
|||||||
tsx
|
tsx
|
||||||
stx spsave ; Save the system stack ptr
|
stx spsave ; Save the system stack ptr
|
||||||
|
|
||||||
lda #<(__RAM_START__ + __RAM_SIZE__)
|
lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp
|
sta sp
|
||||||
lda #>(__RAM_START__ + __RAM_SIZE__)
|
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp+1 ; Set argument stack ptr
|
sta sp+1 ; Set argument stack ptr
|
||||||
|
|
||||||
; If we have IRQ functions, chain our stub into the IRQ vector
|
; If we have IRQ functions, chain our stub into the IRQ vector
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
||||||
|
|
||||||
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
||||||
|
.import __STACKSIZE__ ; Linker generated
|
||||||
.import initlib, donelib
|
.import initlib, donelib
|
||||||
.import callmain
|
.import callmain
|
||||||
.import zerobss
|
.import zerobss
|
||||||
@@ -25,9 +26,9 @@
|
|||||||
|
|
||||||
; Setup stack
|
; Setup stack
|
||||||
|
|
||||||
lda #<(__RAM_START__ + __RAM_SIZE__)
|
lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp
|
sta sp
|
||||||
lda #>(__RAM_START__ + __RAM_SIZE__)
|
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp+1 ; Set argument stack ptr
|
sta sp+1 ; Set argument stack ptr
|
||||||
|
|
||||||
; Call module constructors
|
; Call module constructors
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
.import _main
|
.import _main
|
||||||
.import __BSS_LOAD__
|
.import __BSS_LOAD__
|
||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__
|
.import __RAM_START__, __RAM_SIZE__, __STACKSIZE__
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "extzp.inc"
|
.include "extzp.inc"
|
||||||
@@ -94,9 +94,9 @@ MikeyInitData: .byte $9e,$18,$68,$1f,$00,$00,$00,$00,$00,$ff,$1a,$1b,$04,$0d,$2
|
|||||||
|
|
||||||
; setup the stack
|
; setup the stack
|
||||||
|
|
||||||
lda #<(__RAM_START__ + __RAM_SIZE__)
|
lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp
|
sta sp
|
||||||
lda #>(__RAM_START__ + __RAM_SIZE__)
|
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp+1
|
sta sp+1
|
||||||
|
|
||||||
; Init Mickey
|
; Init Mickey
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
.import RESTOR, BSOUT, CLRCH
|
.import RESTOR, BSOUT, CLRCH
|
||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
||||||
|
.import __STACKSIZE__ ; Linker generated
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "vic20.inc"
|
.include "vic20.inc"
|
||||||
@@ -59,9 +60,9 @@ L1: lda sp,x
|
|||||||
tsx
|
tsx
|
||||||
stx spsave ; Save the system stack ptr
|
stx spsave ; Save the system stack ptr
|
||||||
|
|
||||||
lda #<(__RAM_START__ + __RAM_SIZE__)
|
lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp
|
sta sp
|
||||||
lda #>(__RAM_START__ + __RAM_SIZE__)
|
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp+1 ; Set argument stack ptr
|
sta sp+1 ; Set argument stack ptr
|
||||||
|
|
||||||
; If we have IRQ functions, chain our stub into the IRQ vector
|
; If we have IRQ functions, chain our stub into the IRQ vector
|
||||||
|
|||||||
Reference in New Issue
Block a user