mirror of
https://github.com/irmen/prog8.git
synced 2025-02-19 11:31:07 +00:00
doc
This commit is contained in:
parent
953cf9a335
commit
204cc03fc8
@ -373,8 +373,11 @@ rather than having fixed gotos or subroutine calls::
|
|||||||
Conditional jumps (``if condition goto label``) are compiled using 6502's branching instructions (such as ``bne`` and ``bcc``) so
|
Conditional jumps (``if condition goto label``) are compiled using 6502's branching instructions (such as ``bne`` and ``bcc``) so
|
||||||
the rather strict limit on how *far* it can jump applies. The compiler itself can't figure this
|
the rather strict limit on how *far* it can jump applies. The compiler itself can't figure this
|
||||||
out unfortunately, so it is entirely possible to create code that cannot be assembled successfully.
|
out unfortunately, so it is entirely possible to create code that cannot be assembled successfully.
|
||||||
You'll have to restructure your gotos in the code (place target labels closer to the branch)
|
Thankfully the ``64tass`` assembler that is used has the option to automatically
|
||||||
if you run into this type of assembler error.
|
convert such branches to their opposite + a normal jmp. This is slower and takes up more space
|
||||||
|
and you will get warning printed if this happens. You may then want to restructure your branches (place target labels closer to the branch,
|
||||||
|
or reduce code complexity).
|
||||||
|
|
||||||
|
|
||||||
There is a special form of the if-statement that immediately translates into one of the 6502's branching instructions.
|
There is a special form of the if-statement that immediately translates into one of the 6502's branching instructions.
|
||||||
This allows you to write a conditional jump or block execution directly acting on the current values of the CPU's status register bits.
|
This allows you to write a conditional jump or block execution directly acting on the current values of the CPU's status register bits.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user