From d2999d9e7ed53727a15bd3cdc637378c4e44f946 Mon Sep 17 00:00:00 2001 From: cuz Date: Mon, 16 Aug 2004 10:04:09 +0000 Subject: [PATCH] Fixed the definition of the long branch macros to avoid "Constant expression 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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ca65/macpack.c b/src/ca65/macpack.c index cc2119901..8fcf061cf 100644 --- a/src/ca65/macpack.c +++ b/src/ca65/macpack.c @@ -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" -- 2.39.5