From: cuz Date: Sat, 10 Jun 2000 16:05:59 +0000 (+0000) Subject: Minor optimization X-Git-Tag: V2.12.0~3466 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6481395a9465ee688d0751e2462929264bd2a3b0;p=cc65 Minor optimization git-svn-id: svn://svn.cc65.org/cc65/trunk@46 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/runtime/lbneg.s b/libsrc/runtime/lbneg.s index cd508e587..9d3bb13b5 100644 --- a/libsrc/runtime/lbneg.s +++ b/libsrc/runtime/lbneg.s @@ -6,17 +6,18 @@ .export bnegeax .import return0, return1 - .importzp sreg + .importzp sreg, tmp1 bnegeax: - cmp #0 - bne L1 - cpx #0 - bne L1 - lda sreg - bne L1 - lda sreg+1 - bne L1 - jmp return1 -L1: jmp return0 + stx tmp1 + ldx #0 ; High byte of result + ora tmp1 + ora sreg + ora sreg+1 + bne @L0 + lda #1 + rts + +@L0: txa ; X is zero + rts