1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-29 17:56:21 +00:00

Document the .tcount function

git-svn-id: svn://svn.cc65.org/cc65/trunk@152 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-07-15 10:42:20 +00:00
parent 359a89d0bf
commit 4a0b4e86d4

View File

@ -377,20 +377,22 @@ Available operators sorted by precedence:
Op Description Precedence Op Description Precedence
------------------------------------------------------------------- -------------------------------------------------------------------
.CONCAT Builtin function 0
.LEFT Builtin function 0
.MID Builtin function 0
.RIGHT Builtin function 0
.STRING Builtin function 0
* Builtin pseudo variable (r/o) 1 * Builtin pseudo variable (r/o) 1
.BLANK Builtin function 1 .BLANK Builtin function 1
.CONCAT Builtin function 1
.CONST Builtin function 1 .CONST Builtin function 1
.CPU Builtin pseudo variable (r/o) 1 .CPU Builtin pseudo variable (r/o) 1
.DEFINED Builtin function 1 .DEFINED Builtin function 1
.LEFT Builtin function 1
.MATCH Builtin function 1 .MATCH Builtin function 1
.MID Builtin function 1 .TCOUNT Builtin function 1
.XMATCH Builtin function 1 .XMATCH Builtin function 1
.PARAMCOUNT Builtin pseudo variable (r/o) 1 .PARAMCOUNT Builtin pseudo variable (r/o) 1
.REFERENCED Builtin function 1 .REFERENCED Builtin function 1
.RIGHT Builtin function 1
.STRING Builtin function 1
:: Global namespace override 1 :: Global namespace override 1
+ Unary plus 1 + Unary plus 1
- Unary minus 1 - Unary minus 1
@ -1700,10 +1702,33 @@ Here's a list of all control commands and a description, what they do:
Example: Example:
; Emulate other assemblers: ; Emulate other assemblers:
.macro section name .macro section name
.segment .string(name) .segment .string(name)
.endmacro .endmacro
.TCOUNT
Builtin function. The function accepts a token list in braces. The
function result is the number of tokens given as argument.
Example:
The ldax macro accepts the '#' token to denote immidiate addressing
(as with the normal 6502 instructions). To translate it into two
separate 8 bit load instructions, the '#' token has to get stripped
from the argument:
.macro ldax arg
.if (.match (.mid (0, 1, arg), #))
; ldax called with immidiate operand
lda #<(.right (.tcount (arg)-1, arg))
ldx #>(.right (.tcount (arg)-1, arg))
.else
...
.endif
.endmacro
.WORD .WORD