]> git.sur5r.net Git - cc65/commitdiff
Squeeze two cycles out of the abs() function
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 10 Oct 2003 17:59:00 +0000 (17:59 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 10 Oct 2003 17:59:00 +0000 (17:59 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2508 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/common/abs.s

index 89161ab59d104c6d8748843b7b6684ff00932909..273ec1c9a83ae80e27c47c38f3d65862b9081b0c 100644 (file)
@@ -7,8 +7,7 @@
        .export         _abs
        .import         negax
 
-_abs:  dex
-       inx                     ; test hi byte
+_abs:  cpx     #$00            ; test hi byte
        bpl     L1
        jmp     negax           ; Negate if negative
 L1:    rts