From a32c50a6bc4e8e23e9f8e3178304fc4c9717aaa6 Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Wed, 7 Mar 2018 20:45:50 +0100 Subject: [PATCH] Optimize deceaxy. --- libsrc/runtime/ldec.s | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/libsrc/runtime/ldec.s b/libsrc/runtime/ldec.s index 53b60095d..ee7ed3fd4 100644 --- a/libsrc/runtime/ldec.s +++ b/libsrc/runtime/ldec.s @@ -1,5 +1,6 @@ ; -; Ullrich von Bassewitz, 29.12.1999 +; Piotr Fusik, 07.03.2018 +; originally by Ullrich von Bassewitz ; ; CC65 runtime: Decrement eax by value in Y ; @@ -11,16 +12,13 @@ deceaxy: sty tmp1 sec sbc tmp1 - sta tmp1 - txa - sbc #0 - tax - lda sreg - sbc #0 - sta sreg - lda sreg+1 - sbc #0 - sta sreg+1 - lda tmp1 - rts + bcs @L9 + dex + cpx #$ff + bne @L9 + dec sreg + cpx sreg + bne @L9 + dec sreg+1 +@L9: rts -- 2.39.5