]> git.sur5r.net Git - cc65/commitdiff
Fixed a bug and - while doing so - made it somewhat shorter.
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 6 Dec 2000 21:11:06 +0000 (21:11 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 6 Dec 2000 21:11:06 +0000 (21:11 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@563 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/toslong.s

index f26cec121220b3ae3c4cf97a53a9088a994c4123..a65a2cff2127634263543be50341a289babcf3f3 100644 (file)
@@ -24,6 +24,7 @@ tosulong:
        ldy     #3
 .endif
        lda     (sp),y
+toslong1:
        ldy     #1
        sta     (sp),y
        lda     #0              ; Zero extend
@@ -49,14 +50,9 @@ toslong:
        ldy     #3
 .endif
        lda     (sp),y
-       bmi     toslong1
-       ldy     #1
-       sta     (sp),y
-       lda     #$00            ; Positive, high word is zero
-       bne     toslong2
-toslong1:
+       bpl     toslong1        ; Jump if positive, high word is zero
        ldy     #1
        sta     (sp),y
        lda     #$FF
-       bne     toslong2
+       bne     toslong2        ; Branch always