From 0bac28d96f752cb6a49e30d517511c4a3a8f632c Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 24 Mar 2001 15:57:32 +0000 Subject: [PATCH] decspX will no longer save a git-svn-id: svn://svn.cc65.org/cc65/trunk@662 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/strdup.s | 16 ++++++++++------ libsrc/runtime/lpush.s | 16 ++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/libsrc/common/strdup.s b/libsrc/common/strdup.s index fa2d289c4..ed49ba485 100644 --- a/libsrc/common/strdup.s +++ b/libsrc/common/strdup.s @@ -18,18 +18,22 @@ _strdup: ; Since we need some place to store the intermediate results, allocate a ; stack frame. To make this somewhat more efficient, create the stackframe ; as needed for the final call to the memcpy function. - + + pha ; decsp will destroy A (but not X) jsr decsp4 ; Target/source ; Store the pointer into the source slot - ldy #0 - sta (sp),y - iny - pha + ldy #1 txa sta (sp),y - pla + pla +.ifpc02 + sta (sp) +.else + dey + sta (sp),y +.endif ; Get length of S (which is still in a/x) diff --git a/libsrc/runtime/lpush.s b/libsrc/runtime/lpush.s index 7724f499b..6b7312a4a 100644 --- a/libsrc/runtime/lpush.s +++ b/libsrc/runtime/lpush.s @@ -16,19 +16,19 @@ push0ax: sty sreg sty sreg+1 pusheax: + pha ; decsp will destroy A (but not X) jsr decsp4 - pha - ldy #0 - sta (sp),y - iny - txa + ldy #3 + lda sreg+1 sta (sp),y - iny + dey lda sreg sta (sp),y - iny - lda sreg+1 + dey + txa sta (sp),y + dey pla + sta (sp),y rts -- 2.39.5