From 6481395a9465ee688d0751e2462929264bd2a3b0 Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 10 Jun 2000 16:05:59 +0000 Subject: [PATCH] Minor optimization git-svn-id: svn://svn.cc65.org/cc65/trunk@46 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/runtime/lbneg.s | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) 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