diff --git a/src/ca65/macpack/longbranch.mac b/src/ca65/macpack/longbranch.mac index b053202ce..d6f6cde8a 100644 --- a/src/ca65/macpack/longbranch.mac +++ b/src/ca65/macpack/longbranch.mac @@ -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