1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-15 17:30:06 +00:00

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> 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. Mark a symbol as referenced.
@ -3779,11 +3779,24 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".BYTE" name=".BYTE"
Example: Example:
<tscreen><verb> <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 .ifref ResetValue ; If this subroutine is used
ResetValue: ; Define it ResetValue: ; Define it
lda #0 ; Set a default value lda #0 ; Set a default value
.referto SetValue ; Ensure that SetValue will be included .refto SetValue ; Ensure that SetValue will be included
.endif .endif
.ifref SetValue ; If this or previous subroutine is used .ifref SetValue ; If this or previous subroutine is used
SetValue: SetValue:
sta Value sta Value

View File

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