]> git.sur5r.net Git - cc65/commitdiff
Fixed the definition of the long branch macros to avoid "Constant expression
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 16 Aug 2004 10:04:09 +0000 (10:04 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 16 Aug 2004 10:04:09 +0000 (10:04 +0000)
expected" errors when the branch target is outside the local scope.

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

src/ca65/macpack.c

index cc2119901f74f6ba2ea718448422e1c9b861b4ad..8fcf061cf86a1100f01770457eb544cbcbef881d 100644 (file)
@@ -76,7 +76,7 @@ static char MacLongBranch[] =
     "        .if     .match(Target, 0)\n"
     "        bne     *+5\n"
     "        jmp     Target\n"
-    "        .elseif .def(Target) .and ((*+2)-(Target) <= 127)\n"
+    "        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)\n"
     "        beq     Target\n"
     "        .else\n"
     "        bne     *+5\n"
@@ -87,7 +87,7 @@ static char MacLongBranch[] =
     "        .if     .match(Target, 0)\n"
     "        beq     *+5\n"
     "        jmp     Target\n"
-    "        .elseif .def(Target) .and ((*+2)-(Target) <= 127)\n"
+    "        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)\n"
     "        bne     Target\n"
     "        .else\n"
     "        beq     *+5\n"
@@ -98,7 +98,7 @@ static char MacLongBranch[] =
     "        .if     .match(Target, 0)\n"
     "        bpl     *+5\n"
     "        jmp     Target\n"
-    "        .elseif .def(Target) .and ((*+2)-(Target) <= 127)\n"
+    "        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)\n"
     "        bmi     Target\n"
     "        .else\n"
     "        bpl     *+5\n"
@@ -109,7 +109,7 @@ static char MacLongBranch[] =
     "        .if     .match(Target, 0)\n"
     "        bmi     *+5\n"
     "        jmp     Target\n"
-    "        .elseif .def(Target) .and ((*+2)-(Target) <= 127)\n"
+    "        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)\n"
     "        bpl     Target\n"
     "        .else\n"
     "        bmi     *+5\n"
@@ -120,7 +120,7 @@ static char MacLongBranch[] =
     "        .if     .match(Target, 0)\n"
     "        bcc     *+5\n"
     "        jmp     Target\n"
-    "        .elseif .def(Target) .and ((*+2)-(Target) <= 127)\n"
+    "        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)\n"
     "        bcs     Target\n"
     "        .else\n"
     "        bcc     *+5\n"
@@ -131,7 +131,7 @@ static char MacLongBranch[] =
     "        .if     .match(Target, 0)\n"
     "        bcs     *+5\n"
     "        jmp     Target\n"
-    "        .elseif .def(Target) .and ((*+2)-(Target) <= 127)\n"
+    "        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)\n"
     "        bcc     Target\n"
     "        .else\n"
     "        bcs     *+5\n"
@@ -142,7 +142,7 @@ static char MacLongBranch[] =
     "        .if     .match(Target, 0)\n"
     "        bvc     *+5\n"
     "        jmp     Target\n"
-    "        .elseif .def(Target) .and ((*+2)-(Target) <= 127)\n"
+    "        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)\n"
     "        bvs     Target\n"
     "        .else\n"
     "        bvc     *+5\n"
@@ -153,7 +153,7 @@ static char MacLongBranch[] =
     "        .if     .match(Target, 0)\n"
     "        bvs     *+5\n"
     "        jmp     Target\n"
-    "        .elseif .def(Target) .and ((*+2)-(Target) <= 127)\n"
+    "        .elseif .def(Target) .and .const(Target) .and ((*+2)-(Target) <= 127)\n"
     "        bvc     Target\n"
     "        .else\n"
     "        bvs     *+5\n"