diff --git a/asminc/zeropage.inc b/asminc/zeropage.inc index 2d4b144db..8d508fc5a 100644 --- a/asminc/zeropage.inc +++ b/asminc/zeropage.inc @@ -13,10 +13,18 @@ .globalzp tmp1, tmp2, tmp3, tmp4 .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 ; will get removed in future versions. Using it will cause a linker ; warning. .globalzp sp +.endif +.endif ; The size of the register bank diff --git a/libsrc/runtime/sp-compat.s b/libsrc/runtime/sp-compat.s index 797fef47b..77972212f 100644 --- a/libsrc/runtime/sp-compat.s +++ b/libsrc/runtime/sp-compat.s @@ -5,7 +5,15 @@ ; 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" .export sp := c_sp .assert 0, ldwarning, "Symbol 'sp' is deprecated - please use 'c_sp' instead" +.endif +.endif diff --git a/test/asm/listing/080-sp-compat.s b/test/asm/listing/080-sp-compat.s index 8c22a71d3..54c48e8c3 100644 --- a/test/asm/listing/080-sp-compat.s +++ b/test/asm/listing/080-sp-compat.s @@ -1,7 +1,16 @@ .include "zeropage.inc" +; FIXME: there must be a less ugly way to do this +.ifp4510 +.else +.ifp45GS02 +.else + .proc _func ldy #0 lda (sp),y rts .endproc + +.endif +.endif diff --git a/test/asm/listing/ref/080-sp-compat.ld65err2-ref b/test/asm/listing/ref/080-sp-compat.ld65err2-ref index fe2611088..78935d2b3 100644 --- a/test/asm/listing/ref/080-sp-compat.ld65err2-ref +++ b/test/asm/listing/ref/080-sp-compat.ld65err2-ref @@ -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