From: Piotr Fusik Date: Wed, 7 Mar 2018 19:45:50 +0000 (+0100) Subject: Optimize deceaxy. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a32c50a6bc4e8e23e9f8e3178304fc4c9717aaa6;p=cc65 Optimize deceaxy. --- 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