1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-10-03 20:55:36 +00:00
millfork/doc/lang/functions.md
Karol Stasiak 0ca1be0c00 Tons of things:
– changed `inline` to `macro`
– added support for parameters for macros written in Millfork
– added `inline`, `noinline`, `register` hints
– added <<<< operator
– pointer dereference expressions are now supported more widely
– C64 library fixes
– added `-O1` command line option as an alias for `-O`
2018-02-01 22:39:38 +01:00

1.4 KiB
Raw Blame History

Function definitions

Syntax:

[<modifiers>] <return_type> <name> ( <params> ) [@ <address>] { <body> }

asm <return_type> <name> ( <params> ) @ <address> extern

  • <modifiers>: zero or more of the following:

  • <return_type> is a valid return type, see Types

  • <params> is a comma-separated list of parameters, in form type name. Allowed types are the same as for local variables.

  • <address> is a constant expression that defines where in the memory the function is or will be located.

  • extern is a keyword than marks functions that are not defined in the current program, but are likely to be available at certain address in memory. Such functions should be marked as written in assembly and should have their parameters passed through registers.

  • <body> is a newline-separated list of either Millfork or assembly statements