.. _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, saved in UTF-8 encoding, which 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 on a line 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. Everything surrounded with ``/*`` and ``*/``, this can span multiple lines, is a block-comment and is ignored. This block comment is experimental for now: it may change or even be removed again in a future compiler version. Examples:: counter = 42 ; set the initial value to 42 ; next is the code that... /* this is all ignored */ .. _directives: Directives ----------- .. 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, with a SYS statement calling into the machine code - type ``none`` : no launcher logic is added at all .. data:: %zeropage