From 204cc03fc831701248cc3f77e4da59e031405322 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sat, 26 Jan 2019 23:28:28 +0100 Subject: [PATCH] doc --- docs/source/programming.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/source/programming.rst b/docs/source/programming.rst index 256da85ec..4c4d6362a 100644 --- a/docs/source/programming.rst +++ b/docs/source/programming.rst @@ -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 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. -You'll have to restructure your gotos in the code (place target labels closer to the branch) -if you run into this type of assembler error. +Thankfully the ``64tass`` assembler that is used has the option to automatically +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. This allows you to write a conditional jump or block execution directly acting on the current values of the CPU's status register bits.