]> git.sur5r.net Git - cc65/commitdiff
Minor optimization
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 10 Jun 2000 16:05:59 +0000 (16:05 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 10 Jun 2000 16:05:59 +0000 (16:05 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@46 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/lbneg.s

index cd508e5873dcdd9c8d23ec9fc2041bba2ebe52a0..9d3bb13b590960504ad346fd3b9d7cd9ee5d3e9e 100644 (file)
@@ -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