3. Function Mode and Asm Mode

Kick assembler has two modes for executing directives. ‘Function Mode’ is used when the directive is placed inside a function or .define directive, otherwise ‘Asm Mode’ is used. ‘Function Mode’ is executed fast but is restricted to script commands only (.var, .const, .for, etc.), while ‘Asm Mode’ can handle all directives and records the side effects as described in previous section. All evaluation starts in ‘Asm Mode’ and enters ‘Function Mode’ if you get inside the body a function or .define directive. This means that at some point there is always a directive that records the result of the evaluation.