]> git.sur5r.net Git - cc65/commitdiff
Fixed an error in the macro package that prevented the macros to work
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 17 Jul 2012 18:30:05 +0000 (18:30 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 17 Jul 2012 18:30:05 +0000 (18:30 +0000)
correctly. The short forms of the jumps were never choosen. The error was
introduced with release 3176 in 2004(!) and reported by thefox.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5787 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/macpack/longbranch.mac

index b053202cea4c9e052049e5b2bef1f821f9ca85b4..d6f6cde8a875f8a74dd6b4911fa71c7676645fdb 100644 (file)
@@ -2,7 +2,7 @@
         .if     .match(Target, 0)
         bne     *+5
         jmp     Target
-        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)
+        .elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
                 beq     Target
         .else
                 bne     *+5
@@ -13,7 +13,7 @@
         .if     .match(Target, 0)
                 beq     *+5
                 jmp     Target
-        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)
+        .elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
                 bne     Target
         .else
                 beq     *+5
@@ -24,7 +24,7 @@
         .if     .match(Target, 0)
                 bpl     *+5
                 jmp     Target
-        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)
+        .elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
                 bmi     Target
         .else
                 bpl     *+5
@@ -35,7 +35,7 @@
         .if     .match(Target, 0)
                 bmi     *+5
                 jmp     Target
-        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)
+        .elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
                 bpl     Target
         .else
                 bmi     *+5
@@ -46,7 +46,7 @@
         .if     .match(Target, 0)
                 bcc     *+5
                 jmp     Target
-        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)
+        .elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
                 bcs     Target
         .else
                 bcc     *+5
@@ -57,7 +57,7 @@
         .if     .match(Target, 0)
                 bcs     *+5
                 jmp     Target
-        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)
+        .elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
                 bcc     Target
         .else
                 bcs     *+5
@@ -68,7 +68,7 @@
         .if     .match(Target, 0)
                 bvc     *+5
                 jmp     Target
-        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)
+        .elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
                 bvs     Target
         .else
                 bvc     *+5
@@ -79,7 +79,7 @@
         .if     .match(Target, 0)
                 bvs     *+5
                 jmp     Target
-        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)
+        .elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
                 bvc     Target
         .else
                 bvs     *+5