Merge pull request #2749 from mrdudz/unbreakmaster

hide the SP symbol from the 4510 and 45GS02
This commit is contained in:
Bob Andrews
2025-06-27 17:45:42 +02:00
committed by GitHub
4 changed files with 26 additions and 1 deletions

View File

@@ -13,10 +13,18 @@
.globalzp tmp1, tmp2, tmp3, tmp4 .globalzp tmp1, tmp2, tmp3, tmp4
.globalzp regbank .globalzp regbank
; FIXME: there must be a less ugly way to do this
.ifp4510
.else
.ifp45GS02
.else
; The following symbol is supplied for compatibility reasons only, it ; The following symbol is supplied for compatibility reasons only, it
; will get removed in future versions. Using it will cause a linker ; will get removed in future versions. Using it will cause a linker
; warning. ; warning.
.globalzp sp .globalzp sp
.endif
.endif
; The size of the register bank ; The size of the register bank

View File

@@ -5,7 +5,15 @@
; linker warning if it is used. Added after renaming "sp" to "c_sp". ; linker warning if it is used. Added after renaming "sp" to "c_sp".
; ;
; FIXME: there must be a less ugly way to do this
.ifp4510
.else
.ifp45GS02
.else
.include "zeropage.inc" .include "zeropage.inc"
.export sp := c_sp .export sp := c_sp
.assert 0, ldwarning, "Symbol 'sp' is deprecated - please use 'c_sp' instead" .assert 0, ldwarning, "Symbol 'sp' is deprecated - please use 'c_sp' instead"
.endif
.endif

View File

@@ -1,7 +1,16 @@
.include "zeropage.inc" .include "zeropage.inc"
; FIXME: there must be a less ugly way to do this
.ifp4510
.else
.ifp45GS02
.else
.proc _func .proc _func
ldy #0 ldy #0
lda (sp),y lda (sp),y
rts rts
.endproc .endproc
.endif
.endif

View File

@@ -1 +1 @@
ld65: Warning: runtime/sp-compat.s:10: Symbol 'sp' is deprecated - please use 'c_sp' instead ld65: Warning: runtime/sp-compat.s:16: Symbol 'sp' is deprecated - please use 'c_sp' instead