From 857c4ef452b98da124e4ef0739fb5286422710b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Henrik=20Sk=C3=A5rstedt?= Date: Sat, 11 Jan 2020 13:16:34 -0800 Subject: [PATCH] Adding a doc for eval functions. --- docs/eval_functions.md | 47 ++++++++++++++++++++++++++++++++++++++++++ docs/readme.md | 12 +++++++++++ 2 files changed, 59 insertions(+) create mode 100644 docs/eval_functions.md diff --git a/docs/eval_functions.md b/docs/eval_functions.md new file mode 100644 index 0000000..2e85423 --- /dev/null +++ b/docs/eval_functions.md @@ -0,0 +1,47 @@ +# Eval Functions + +Eval Functions are used like symbols in expressions but are always followed by parenthesis with optional arguments. + +### DEFINED, DEF + + .if .def(symbol) + .endif + +Evaluates to 1 if the symbol has been defined or 0 if it has not been encountered to this point in the current assembly. + +### REFERENCED + + .if .referenced(symbol) + .endif + +Evaluates to 1 if the symbol has been referenced in the current assembly, the symbol should be defined at this point. + +### BLANK + + .if .blank() + .endif + +Evaluates to 1 if the contents within the parenthesis is empty, primarily for use within macros. + +### CONST + + if .const(symbol) + .endif + +Evaluates to 1 if the symbol has been declared CONST, the symbol should be defined at this point. + +### SIZEOF + + STRUCT Module { + word Init + word Update + word Shutdown + } + + ds SIZEOF( Module ) + +Returns the byte size of a given struct. + +### TRIGSIN + +Not implemented, experimental math feature, currently returns 0 diff --git a/docs/readme.md b/docs/readme.md index e3e6e34..e3746b1 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -37,12 +37,24 @@ result. ## Command Line Options +Controls the assembler for the entire file + See [Command Line Options](command_line_options.md) ## Directives +Controls the assembler on a line basis + See [Directives](directives.md) +## Eval Functions + +Functions that returns values for use in expressions. + +See [Eval Functions](eval_functions.md) + ## Macro examples +Some info about the included example x65macro.i file. + See [Macro Samples](macro_samples.md) \ No newline at end of file