Add .REFTO as an alias to .REFERTO. Update the docs related to it.

This commit is contained in:
Evgeny Vrublevsky 2021-04-28 21:38:23 +03:00 committed by greg-king5
parent 50a58e7706
commit 8e02f8f5ec
2 changed files with 16 additions and 2 deletions

View File

@ -3765,7 +3765,7 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".BYTE" name=".BYTE"
See: <tt><ref id=".POPSEG" name=".POPSEG"></tt>
<sect1><tt>.REFERTO</tt><label id=".REFERTO"><p>
<sect1><tt>.REFERTO, .REFTO</tt><label id=".REFERTO"><p>
Mark a symbol as referenced.
@ -3779,11 +3779,24 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".BYTE" name=".BYTE"
Example:
<tscreen><verb>
.ifref NegateValue ; If this subroutine is used
NegateValue: ; Define it
lda #0
sec
sbc Value
.ifref ResetValue ; If the ResetValue is also used
jmp SetValue ; Jump over it
.else
.refto SetValue ; Ensure that SetValue will be included
.endif
.endif
.ifref ResetValue ; If this subroutine is used
ResetValue: ; Define it
lda #0 ; Set a default value
.referto SetValue ; Ensure that SetValue will be included
.refto SetValue ; Ensure that SetValue will be included
.endif
.ifref SetValue ; If this or previous subroutine is used
SetValue:
sta Value

View File

@ -272,6 +272,7 @@ struct DotKeyword {
{ ".REF", TOK_REFERENCED },
{ ".REFERENCED", TOK_REFERENCED },
{ ".REFERTO", TOK_REFERTO },
{ ".REFTO", TOK_REFERTO },
{ ".RELOC", TOK_RELOC },
{ ".REPEAT", TOK_REPEAT },
{ ".RES", TOK_RES },