.. _syntaxreference: ================ Syntax Reference ================ Module file ----------- This is a file with the ``.p8`` suffix, containing *directives* and *code blocks*, described below. The file is a text file wich can also contain: Lines, whitespace, indentation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Line endings are significant because *only one* declaration, statement or other instruction can occur on every line. Other whitespace and line indentation is arbitrary and ignored by the compiler. You can use tabs or spaces as you wish. Source code comments ^^^^^^^^^^^^^^^^^^^^ Everything after a semicolon ``;`` is a comment and is ignored. If the whole line is just a comment, it will be copied into the resulting assembly source code. This makes it easier to understand and relate the generated code. Examples:: counter = 42 ; set the initial value to 42 ; next is the code that... .. _directives: Directives ----------- .. data:: %target Level: module. Global setting, specifies that this module can only work for the given compiler target. If compiled with a different target, compilation is aborted with an error message. .. data:: %output Level: module. Global setting, selects program output type. Default is ``prg``. - type ``raw`` : no header at all, just the raw machine code data - type ``prg`` : C64 program (with load address header) .. data:: %launcher Level: module. Global setting, selects the program launcher stub to use. Only relevant when using the ``prg`` output type. Defaults to ``basic``. - type ``basic`` : add a tiny C64 BASIC program, whith a SYS statement calling into the machine code - type ``none`` : no launcher logic is added at all .. data:: %zeropage