If I have more than 127 instructions between a BEQ and the corresponding label, it doesn't work:
What is the general workaround here? I came up with this:
Is this the way to go? Or are there other ways?
Code:
TestFunction:
LDX #$00
BEQ TestFunctionEnd
; Put this command here 128 times:
INX
TestFunctionEnd:
RTS
LDX #$00
BEQ TestFunctionEnd
; Put this command here 128 times:
INX
TestFunctionEnd:
RTS
Quote:
Error: Range error (128 not in [-128..127])
What is the general workaround here? I came up with this:
Code:
TestFunction:
LDX #$00
BNE ConditionNotMet
JMP TestFunctionEnd
ConditionNotMet:
; Put this command here 128 times:
INX
TestFunctionEnd:
RTS
LDX #$00
BNE ConditionNotMet
JMP TestFunctionEnd
ConditionNotMet:
; Put this command here 128 times:
INX
TestFunctionEnd:
RTS
Is this the way to go? Or are there other ways?