ca65 jsr/jmp/rts will not promote to jsl/jml/rtl by default, but can still be enabled with new feature long_jsr_jmp_rts

This commit is contained in:
bbbradsmith
2023-02-21 04:00:34 -05:00
parent d0f17ba602
commit ccf3994e3b
6 changed files with 79 additions and 9 deletions

View File

@@ -183,7 +183,7 @@ Here is a description of all the command line options:
Enable an emulation feature. This is identical as using <tt/.FEATURE/
in the source with two exceptions: Feature names must be lower case, and
each feature must be specified by using an extra <tt/--feature/ option,
each feature must be specified by using a separate <tt/--feature/ option,
comma separated lists are not allowed.
See the discussion of the <tt><ref id=".FEATURE" name=".FEATURE"></tt>
@@ -2825,6 +2825,23 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".CHARMAP" name=".CH
overridden. When using this feature, you may also get into trouble if
later versions of the assembler define new keywords starting with a dot.
<tag><tt>long_jsr_jmp_rts</tt><label id="long_jsr_jmp_rts"></tag>
Affects 65816 mode only.
Allows <tt>jsr</tt> and <tt>jmp</tt> to produce long jumps if the target
address has been previously declared in a <tt>far</tt> segment,
or imported as <tt>far</tt>.
Otherwise <tt>jsl</tt> and <tt>jml</tt> must be used instead.
Also allows <tt><ref id=".SMART" name=".SMART"></tt> to convert <tt>rts</tt>
to a long return <tt>rtl</tt> when the enclosing scope or memory model
indicates returning from a <tt>far</tt> procedure.
This permits compatibility with the old behavior of this assembler, or other
assemblers which similarly allowed <tt>jsr</tt> and <tt>jmp</tt> to be used
this way.
<tag><tt>loose_char_term</tt><label id="loose_char_term"></tag>
Accept single quotes as well as double quotes as terminators for char
@@ -3994,7 +4011,9 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".BYTE" name=".BYTE"
the assembler cannot trace the execution flow this may lead to false
results in some cases. If in doubt, use the <tt/.Inn/ and <tt/.Ann/
instructions to tell the assembler about the current settings.
<item>In 65816 mode, replace a <tt/RTS/ instruction by <tt/RTL/ if it is
<item>In 65816 mode, if the <tt><ref id="long_jsr_jmp_rts"
name="long_jsr_jmp_rts"></tt> feature is enabled,
smart mode will replace a <tt/RTS/ instruction by <tt/RTL/ if it is
used within a procedure declared as <tt/far/, or if the procedure has
no explicit address specification, but it is <tt/far/ because of the
memory model used.