This commit is contained in:
mrdudz
2025-06-23 17:09:06 +02:00
parent 4863a3e29b
commit 5fc15a7a60
204 changed files with 915 additions and 912 deletions

View File

@@ -17,7 +17,7 @@
.constructor initstkchk, 25
.import __STACKSIZE__ ; Linker defined
.import pusha0, _exit
.importzp sp
.importzp c_sp
; Use macros for better readability
.macpack generic
@@ -32,11 +32,11 @@
.proc initstkchk
lda sp
lda c_sp
sta initialsp
sub #<__STACKSIZE__
sta lowwater
lda sp+1
lda c_sp+1
sta initialsp+1
sbc #>__STACKSIZE__
.if (.cpu .bitand ::CPU_ISET_65SC02)
@@ -70,7 +70,7 @@ cstkchk:
; Check the high byte of the software stack
@L0: lda lowwater+1
cmp sp+1
cmp c_sp+1
bcs @L1
rts
@@ -78,7 +78,7 @@ cstkchk:
@L1: bne CStackOverflow
lda lowwater
cmp sp
cmp c_sp
bcs CStackOverflow
Done: rts
@@ -87,9 +87,9 @@ Done: rts
CStackOverflow:
lda initialsp
sta sp
sta c_sp
lda initialsp+1
sta sp+1
sta c_sp+1
; Generic abort entry. We should output a diagnostic here, but this is
; difficult, since we're operating at a lower level here.