From 6cbd32b49d6a7503e38c824a01e2c306d9dc4c64 Mon Sep 17 00:00:00 2001 From: cuz Date: Mon, 27 Nov 2000 23:37:53 +0000 Subject: [PATCH] Some more 6502 code git-svn-id: svn://svn.cc65.org/cc65/trunk@485 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/runtime/incsp2.s | 4 ++++ libsrc/runtime/sub.s | 15 ++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/libsrc/runtime/incsp2.s b/libsrc/runtime/incsp2.s index 959294326..9893bebdc 100644 --- a/libsrc/runtime/incsp2.s +++ b/libsrc/runtime/incsp2.s @@ -14,8 +14,12 @@ ldy #1 lda (sp),y ; get hi byte tax ; into x +.ifpc02 + lda (sp) ; get lo byte +.else dey lda (sp),y ; get lo byte +.endif .endproc diff --git a/libsrc/runtime/sub.s b/libsrc/runtime/sub.s index 9108b2710..1cefd9ac7 100644 --- a/libsrc/runtime/sub.s +++ b/libsrc/runtime/sub.s @@ -5,7 +5,7 @@ ; .export tossuba0, tossubax - .import addysp1 + .import addysp1 .importzp sp, ptr1 ; @@ -15,14 +15,19 @@ tossuba0: ldx #0 tossubax: - ldy #0 sta ptr1 stx ptr1+1 - lda (sp),y ; lo byte - sec +.ifpc02 + lda (sp),y ; Get lo byte + ldy #1 ; Hi index +.else + ldy #0 + lda (sp),y ; Lo byte + iny ; Hi index +.endif + sec sbc ptr1 sta ptr1 ; save lo byte - iny lda (sp),y sbc ptr1+1 tax -- 2.39.5