$WW,1$$FG,5$$TX+CX,"Compiler Directives"$$FG$

The compiler looks-ahead a token most of the time, so you might throw an extra semicolon after the directive if it's not taking affect right away.

$FG,2$#include ""$FG$ 	There is no angle bracket <> form of this directive.
$FG,2$#exe {}$FG$		Will execute code at compile-time and can be used to insert code into the stream being compiled using $LK,"StreamPrint",A="MN:StreamPrint"$().
$FG,2$#define$FG$		Define string const
$FG,2$#assert$FG$		Print a warning during compilation if an expression is not true. 
$FG,2$#if$FG$		Include code if an expresion is true.
$FG,2$#else
#endif
#ifdef,#ifndef	$FG$Include code if a sym is defined.
$FG,2$#ifaot,#ifjit	$FG$Include code if in $FG,2$AOT$FG$ compiler mode.
$FG,2$defined()$FG$	Is a function that can be used in expressions.
$FG,2$#help_index$FG$, $FG,2$#help_file$FG$ See $LK,"Help System",A="FI:::/Doc/HelpSystem.TXT"$.
$HL,1$$WW,0$
#define __DATE__ #exe{StreamPrint("\"%D\"",Now);}
#define __TIME__ #exe{StreamPrint("\"%T\"",Now);}
#define __LINE__ #exe{StreamPrint("%d",Fs->last_lex->lex_include_stk->line_num);}
#define __DEPTH__ #exe{StreamPrint("%d",Fs->last_lex->lex_include_stk->depth);}
#define __FILE__ #exe{StreamPrint("\"%s\"",Fs->last_lex->lex_include_stk->full_name);}
#define __DIR__  #exe{StreamDir;}
$HL,0$$WW,1$
See $LK,"::/Demo/Directives.CPP"$, $LK,"Scoping and Linkages",A="FI:::/Doc/ImportExports.TXT"$, and $LK,"preprocessor",A="FF:::/Compiler/Lex.CPP,KW_DEFINE"$.


$FG,5$$TX+CX,"Compiler Options"$$FG$

Use $LK,"Option",A="MN:Option"$().  You might need to do $FG,2$#exe {Option();}$FG$.

$LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$ without this option, global vars are placed in the code heap which is limited to 2 Gig.  In $FG,2$AOT$FG$ modules, global vars take-up room in the $FG,2$.BIN$FG$ file, so you might want to use this option, instead.  You might wish to turn it on and off around specific vars.  A disadvantage of data heap global vars in $FG,2$AOT$FG$ modules is they can't be initialized.

$LK,"OPTf_EXTERNS_TO_IMPORTS",A="MN:OPTf_EXTERNS_TO_IMPORTS"$ and $LK,"OPTf_KEEP_PRIVATE",A="MN:OPTf_KEEP_PRIVATE"$ are strange options, you'll never need.  They're to allow the same header file for $FG,2$Kernel$FG$ to act as $FG,2$extern$FG$s when compiling itself and $FG,2$import$FG$s when compiled by $FG,2$AOT$FG$ modules.

$LK,"OPTf_WARN_UNUSED_VAR",A="MN:OPTf_WARN_UNUSED_VAR"$	warning if unused var.  It is applied to functions.

$LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$		warning if parenthesis are not needed.

$LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$	warning if dup local var type statements.

$LK,"OPTf_NO_REG_VAR",A="MN:OPTf_NO_REG_VAR"$ forces all function local vars to the stk not regs.  Applied to functions.

$LK,"OPTf_NO_BUILTIN_CONST",A="MN:OPTf_NO_BUILTIN_CONST"$ Disable 10-byte float consts for , log2_10, log10_2, loge_2.  Applied to functions.


$FG,5$$TX+CX,"Assembler Directives"$$FG$

See $LK,"::/Compiler/OpCodes.TXT"$ for opcodes.  They're not standard.  Some invalid instructions are not flagged and some valid instructions are not implemented. 16-bit asm support is limited.

Here are example instruction formats:
$HL,1$	ADD	RAX,I64 FS:DISP[RSI+RDI*8]
$HL,0$$HL,1$	ADD	RAX,I64 [DISP]
$HL,0$
$FG,2$$$$FG$ Current compiler output pos (instruction ptr).  Even works in HolyC expressions.

$FG,2$$$$FG$ works in $FG,2$class$FG$es.
  $FG,2$class MyFun
  {
    $$=-16;
    I64 local1;
    I64 local2;
    $$=$$+256;
    I64 crazy;
  };$FG$

$FG,4$LABEL$FG,2$::
$FG$  Defines an exported glbl label.

$FG,4$LABEL$FG,2$:
$FG$  Defines an non-exported glbl label.

$FG,2$@@$FG,4$LABEL$FG,2$:
$FG$  Defines a local label with scope valid between two global labels.

$FG,2$DU8$FG$, $FG,2$DU16$FG$, $FG,2$DU32$FG$, $FG,2$DU64$FG$
  Define BYTE, WORD, DWORD or QWORD. Can be used with $FG,2$DUP()$FG$ and ASCII strings.  For your convenience, the ASCII strings do not have terminating zeros.  Define cmds must end with a semicolon.

$FG,2$USE16$FG$, $FG,2$USE32$FG$, $FG,2$USE64$FG$

$FG,2$IMPORT$FG$ $FG,4$sym1name$FG$, $FG,4$sym2name$FG$;

$FG,2$LIST$FG$, $FG,2$NOLIST$FG$

$FG,2$ALIGN$FG$ $FG,4$num$FG$, $FG,4$fill_byte$FG$
  Align to $FG,4$num$FG$ boundary and fill with $FG,4$fill_byte$FG$.

$FG,2$MODULE_ORG$FG$ $FG,4$num$FG$
  Set code addr for JIT or set module $LK,"Load",A="MN:Load"$() addr -- has 16-byte $LK,"CBinFile",A="MN:CBinFile"$ header and patch table trailing.

$FG,2$BINFILE$FG,4$ "FileName.BIN"$FG$;

See $LK,"::/Demo/Asm/AsmAndC1.CPP"$, $LK,"::/Demo/Asm/AsmAndC2.CPP"$ and $LK,"::/Demo/Asm/AsmAndC3.CPP"$.
