<aname="l3"></a>* See </span><ahref="https://tomawezome.github.io/ZealOS/Doc/CompilerOverview.DD.html#l1"><spanclass=cF4>::/Doc/CompilerOverview.DD</span></a><spanclass=cF0>.
<aname="l5"></a>* See </span><ahref="https://tomawezome.github.io/ZealOS/Doc/ScopingLinkage.DD.html#l1"><spanclass=cF4>Scoping and Linkage</span></a><spanclass=cF0> for details on </span><spanclass=cF2>extern</span><spanclass=cF0>, </span><spanclass=cF2>import</span><spanclass=cF0>, </span><spanclass=cF2>_extern</span><spanclass=cF0>, </span><spanclass=cF2>_import</span><spanclass=cF0>, etc.
<aname="l7"></a>* Built-in types include </span><spanclass=cF2>I0, I8, I16, I32, I64</span><spanclass=cF0> for signed 0-8 byte ints and </span><spanclass=cF2>U0, U8, U16, U32, U64</span><spanclass=cF0> for unsigned 0-8 byte ints and </span><spanclass=cF2>
<aname="l8"></a>F64</span><spanclass=cF0> for 8 byte floats.
<aname="l36"></a>* A char const all alone is sent to </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KeyDev.CC.html#l23"><spanclass=cF4>PutChars</span></a><spanclass=cF0>(). A string with or without args is sent to </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/StrPrint.CC.html#l1110"><spanclass=cF4>Print</span></a><spanclass=cF0>(). An empty string literal
<aname="l57"></a>* When dealing with function addresses such as for callbacks, precede the name with "</span><spanclass=cF2>&</span><spanclass=cF0>".
<aname="l59"></a>* Type casting is postfix. To typecast int or F64, use </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelB.HH.html#l92"><spanclass=cF4>ToI64</span></a><spanclass=cF0>(), </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelB.HH.html#l90"><spanclass=cF4>ToBool</span></a><spanclass=cF0>() or </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelB.HH.html#l91"><spanclass=cF4>ToF64</span></a><spanclass=cF0>(). (ZealOS follows normal C float<-->int
<aname="l60"></a>conversion, but sometimes you want to override. These functions are better than multiplying by "1.0" to convert to float.)
<aname="l61"></a>
<aname="l62"></a>* There is no </span><spanclass=cF2>main()</span><spanclass=cF0> function. Any code outside of functions gets executed upon start-up, in order.
<aname="l63"></a>
<aname="l64"></a>* There are no bit fields, but there are </span><spanclass=cF4><u>bit access</u></span><spanclass=cF0> routines and you can access bytes or words within any int. See </span><spanclass=cF4>
<aname="l65"></a></span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l103"><spanclass=cF4>I64 declaration</span></a><spanclass=cF0>. A class can be accessed as a whole are subints, if you put a type in front of the </span><spanclass=cF2>class</span><spanclass=cF0> declaration.
<aname="l80"></a>* Variable arg count functions (</span><spanclass=cF2>...</span><spanclass=cF0>) can access their args with built-in variables similar to '</span><spanclass=cF2>this</span><spanclass=cF0>' in C++. They are '</span><spanclass=cF2>I64
<aname="l81"></a>argc</span><spanclass=cF0>' and '</span><spanclass=cF2>I64 argv[]</span><spanclass=cF0>'.
<aname="l101"></a></span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrBitMap.CC.html#l1084"><spanclass=cF4>GrPutS</span></a><spanclass=cF2>(dc, x, y, buf); //Plot string at x,y pixels. GrPutS is not public.
<aname="l117"></a>* if you know a switch stmt will not exceed the lowest or highest case values. </span><spanclass=cF2>switch []</span><spanclass=cF0> is a little faster because it doesn't
<aname="l118"></a>check.
<aname="l119"></a>
<aname="l120"></a>* </span><spanclass=cF2>switch</span><spanclass=cF0> statements always use a jump table. Don't use them with cases with really big, sparse ranges.
<aname="l121"></a>
<aname="l122"></a>* Allows ranges like "</span><spanclass=cF2>case 4...7:</span><spanclass=cF0>" in </span><spanclass=cF2>switch</span><spanclass=cF0> statements.
<aname="l124"></a>* A no case number causes next higher int case in </span><spanclass=cF2>switch</span><spanclass=cF0> statements. See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/NullCase.CC.html#l1"><spanclass=cF4>::/Demo/NullCase.CC</span></a><spanclass=cF0>.
<aname="l139"></a>* Switch statements can be nestled with a single switch expression! This is known as a "sub_switch" statement. </span><spanclass=cF2>start</span><spanclass=cF0>/</span><spanclass=cF2>end</span><spanclass=cF0> are
<aname="l140"></a>used to group cases. Don't goto out of, throw an exception out of, or return out of the </span><spanclass=cF2>start</span><spanclass=cF0> front porch area. See </span><spanclass=cF4>
<aname="l161"></a>></span><spanclass=cF2>Zero [One] Two [Three] Four [Five]</span><spanclass=cF0>
<aname="l162"></a>
<aname="l163"></a>* A </span><spanclass=cF2>no_warn</span><spanclass=cF0> stmt will suppress an unused var warning.
<aname="l164"></a>
<aname="l165"></a>* You can have multiple member vars of a class named "</span><spanclass=cF2>pad</span><spanclass=cF0>" or "</span><spanclass=cF2>reserved</span><spanclass=cF0>", and it won't issue warnings.
<aname="l166"></a>
<aname="l167"></a>* </span><spanclass=cF2>noreg</span><spanclass=cF0> or </span><spanclass=cF2>reg</span><spanclass=cF0> can be placed before a function local var name. You can, optionally, specify a reg after the </span><spanclass=cF2>reg</span><spanclass=cF0> keyword.
<aname="l171"></a> //Only use </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l1938"><spanclass=cF4>REGG_LOCAL_VARS</span></a><spanclass=cF2> or </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l1939"><spanclass=cF4>REGG_LOCAL_NON_PTR_VARS</span></a><spanclass=cF2> for reg vars or else clobbered.
<aname="l186"></a>* </span><spanclass=cF2>interrupt</span><spanclass=cF0>, </span><spanclass=cF2>haserrcode</span><spanclass=cF0>, </span><spanclass=cF2>public</span><spanclass=cF0>, </span><spanclass=cF2>argpop</span><spanclass=cF0> or </span><spanclass=cF2>noargpop</span><spanclass=cF0> are function flags. See </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/SerialDev/Keyboard.CC.html#l477"><spanclass=cF4>IRQKbd</span></a><spanclass=cF0>().
<aname="l188"></a>* A single quote can encompass multiple characters. </span><spanclass=cF2>'ABC'</span><spanclass=cF0> is equ to </span><spanclass=cF2>0x434241</span><spanclass=cF0>. </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KeyDev.CC.html#l23"><spanclass=cF4>PutChars</span></a><spanclass=cF0>() takes multiple characters.
<aname="l223"></a>* You can use </span><ahref="https://tomawezome.github.io/ZealOS/Compiler/CMisc.CC.html#l1"><spanclass=cF4>Option</span></a><spanclass=cF0>(</span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l1678"><spanclass=cF4>OPTf_WARN_PAREN</span></a><spanclass=cF0>, ON) to find unnecessary parentheses in code.
<aname="l225"></a>* You can use </span><ahref="https://tomawezome.github.io/ZealOS/Compiler/CMisc.CC.html#l1"><spanclass=cF4>Option</span></a><spanclass=cF0>(</span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l1679"><spanclass=cF4>OPTf_WARN_DUP_TYPES</span></a><spanclass=cF0>, ON) to find dup local var type statements.
<aname="l227"></a>* With the </span><spanclass=cF2>#exe{}</span><spanclass=cF0> feature in your src code, you can place programs that insert text into the stream of code being compiled. See </span><spanclass=cF4>
<aname="l228"></a></span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KMain.CC.html#l252"><spanclass=cF4>#exe {}</span></a><spanclass=cF0> for an example where the date/time and compile-time prompting for configuration data is placed into a program. </span><spanclass=cF4>
<aname="l229"></a></span><ahref="https://tomawezome.github.io/ZealOS/Compiler/CMisc.CC.html#l71"><spanclass=cF4>StreamPrint</span></a><spanclass=cF0>() places text into a src program stream following the conclusion of the </span><spanclass=cF2>#exe{}</span><spanclass=cF0> blk.
<aname="l233"></a>* No </span><spanclass=cF2>typedef</span><spanclass=cF0>, use </span><spanclass=cF2>class</span><spanclass=cF0>.
<aname="l234"></a>
<aname="l235"></a>* No type-checking
<aname="l236"></a>
<aname="l237"></a>* Can't use </span><spanclass=cF2><></span><spanclass=cF0> with </span><spanclass=cF2>#include</span><spanclass=cF0>, use </span><spanclass=cF2>""</span><spanclass=cF0>.
<aname="l239"></a>* "</span><spanclass=cF2>$</span><spanclass=cF0>" is an escape character. Two dollar signs signify an ordinary $. See </span><ahref="https://tomawezome.github.io/ZealOS/Doc/DolDocOverview.DD.html#l1"><spanclass=cF4>DolDoc</span></a><spanclass=cF0>. In </span><spanclass=cF2>asm</span><spanclass=cF0> or </span><ahref="https://tomawezome.github.io/ZealOS/Doc/CosmiC.DD.html#l1"><spanclass=cF4>CosmiC</span></a><spanclass=cF0> code, it also refers to the
<aname="l242"></a>* </span><spanclass=cF2>union</span><spanclass=cF0> is more like a class, so you don't reference it with a </span><spanclass=cF2>union</span><spanclass=cF0> label after you define it. Some common unions are declared
<aname="l243"></a>in </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l65"><spanclass=cF4>KernelA.HH</span></a><spanclass=cF0> for 1,2,4 and 8 byte objects. If you place a type in front of a union declaration, that is the type when used by
<aname="l244"></a>itself. See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/SubIntAccess.CC.html#l1"><spanclass=cF4>::/Demo/SubIntAccess.CC</span></a><spanclass=cF0>.
<aname="l246"></a>* </span><spanclass=cF2>class</span><spanclass=cF0> member vars can have meta data. </span><spanclass=cF2>format</span><spanclass=cF0> and </span><spanclass=cF2>data</span><spanclass=cF0> are two meta data types now used. All compiler structures are saved and
<aname="l247"></a>you can access the compiler's info about classes and vars. See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/ClassMeta.CC.html#l1"><spanclass=cF4>::/Demo/ClassMeta.CC</span></a><spanclass=cF0> and </span><ahref="https://tomawezome.github.io/ZealOS/System/DolDoc/DocForm.CC.html#l263"><spanclass=cF4>DocForm</span></a><spanclass=cF0>().
<aname="l249"></a>* There is a keyword </span><spanclass=cF2>lastclass</span><spanclass=cF0> you use as a default arg. It is set to the class name of the prev arg. See </span><spanclass=cF4>
<aname="l250"></a></span><ahref="https://tomawezome.github.io/ZealOS/Demo/LastClass.CC.html#l1"><spanclass=cF4>::/Demo/LastClass.CC</span></a><spanclass=cF0>, </span><ahref="https://tomawezome.github.io/ZealOS/System/Debug.CC.html#l216"><spanclass=cF4>ClassRep</span></a><spanclass=cF0>(), </span><ahref="https://tomawezome.github.io/ZealOS/System/DolDoc/DocForm.CC.html#l263"><spanclass=cF4>DocForm</span></a><spanclass=cF0>() and </span><ahref="https://tomawezome.github.io/ZealOS/Demo/Disk/BlkDevRep.CC.html#l1"><spanclass=cF4>::/Demo/Disk/BlkDevRep.CC</span></a><spanclass=cF0>.
<aname="l252"></a>* See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/Exceptions.CC.html#l1"><spanclass=cF4>::/Demo/Exceptions.CC</span></a><spanclass=cF0>. </span><spanclass=cF2>try{} catch{}</span><spanclass=cF0> and </span><spanclass=cF2>throw</span><spanclass=cF0> are different from C++. </span><spanclass=cF2>throw</span><spanclass=cF0> is a function with an 8-byte or less char
<aname="l253"></a>arg. The char string passed in </span><spanclass=cF2>throw()</span><spanclass=cF0> can be accessed from within a </span><spanclass=cF2>catch{}</span><spanclass=cF0> using the </span><spanclass=cF2>Fs->except_ch</span><spanclass=cF0>. Within a </span><spanclass=cF2>catch {}</span><spanclass=cF0> blk,
<aname="l254"></a>set the var </span><spanclass=cF2>Fs->catch_except</span><spanclass=cF0> to </span><spanclass=cF2>TRUE</span><spanclass=cF0> if you want to terminate the search for a handler. Use </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KExcept.CC.html#l46"><spanclass=cF4>PutExcept</span></a><spanclass=cF0>() as a handler, if you
<aname="l257"></a>* A function is available similar to </span><spanclass=cF2>sizeof</span><spanclass=cF0> which provides the offset of a member of a class. It's called </span><spanclass=cF2>offset</span><spanclass=cF0>. You place
<aname="l258"></a>the class name and member inside as in </span><spanclass=cF2>offset(classname.membername)</span><spanclass=cF0>. It has nothing to do with 16-bit code. Both </span><spanclass=cF2>sizeof</span><spanclass=cF0> and </span><spanclass=cF2>
<aname="l259"></a>offset</span><spanclass=cF0> only accept one level of member vars. That is, you can't do </span><spanclass=cF2>sizeof(classname.membername.submembername)</span><spanclass=cF0>.
<aname="l260"></a>
<aname="l261"></a>* There is no </span><spanclass=cF2>continue</span><spanclass=cF0> stmt. Use </span><spanclass=cF2>goto</span><spanclass=cF0>.
<aname="l262"></a>
<aname="l263"></a>* </span><spanclass=cF2>lock{}</span><spanclass=cF0> can be used to apply asm </span><spanclass=cF2>LOCK</span><spanclass=cF0> prefixes to code for safe multicore read-modify-write accesses. The code bracked with
<aname="l264"></a>have </span><spanclass=cF2>LOCK</span><spanclass=cF0> asm prefix's applied to relevant insts within. It's a little shoddy. See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/MultiCore/Lock.CC.html#l1"><spanclass=cF4>::/Demo/MultiCore/Lock.CC</span></a><spanclass=cF0>.
<aname="l266"></a>* There is a function called </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Memory/MAllocFree.CC.html#l388"><spanclass=cF4>MSize</span></a><spanclass=cF0>() which gives the size of an object alloced off the heap. For larger size allocations, the
<aname="l267"></a>system rounds-up to a power of two, so </span><spanclass=cF2>MSize()</span><spanclass=cF0> lets you know the real size and you can take full advantage of it.
<aname="l269"></a>* You CAN </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Memory/MAllocFree.CC.html#l387"><spanclass=cF4>Free</span></a><spanclass=cF0>() a </span><spanclass=cF2>NULL</span><spanclass=cF0> ptr. Useful variants of </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Memory/MAllocFree.CC.html#l391"><spanclass=cF4>MAlloc</span></a><spanclass=cF0>() can be found </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Memory/MAllocFree.CC.html#l399"><spanclass=cF4>Here</span></a><spanclass=cF0>. Each task has a heap and you can </span><spanclass=cF2>MAlloc</span><spanclass=cF0> and </span><spanclass=cF2>Free</span><spanclass=cF0>
<aname="l270"></a>off-of other task's heaps, or make an independent heap with </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Memory/HeapCtrl.CC.html#l1"><spanclass=cF4>HeapCtrlInit</span></a><spanclass=cF0>(). See </span><ahref="https://tomawezome.github.io/ZealOS/System/Utils/HeapLog.CC.html#l83"><spanclass=cF4>HeapLog</span></a><spanclass=cF0>() for an example.
<aname="l273"></a>can change </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l3507"><spanclass=cF4>MEM_DEFAULT_STACK</span></a><spanclass=cF0> and recompile </span><spanclass=cF2>Kernel</span><spanclass=cF0> or request more when doing a </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KTask.CC.html#l264"><spanclass=cF4>Spawn</span></a><spanclass=cF0>(). You can use </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KTask.CC.html#l129"><spanclass=cF4>CallStackGrow</span></a><spanclass=cF0>(), but it's
<aname="l274"></a>odd. See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/StackGrow.CC.html#l1"><spanclass=cF4>::/Demo/StackGrow.CC</span></a><spanclass=cF0>.
<aname="l278"></a>* </span><spanclass=cF2>printf()</span><spanclass=cF0> has new codes. See </span><ahref="https://tomawezome.github.io/ZealOS/Doc/Print.DD.html#l1"><spanclass=cF4>Print("") Format Strings</span></a><spanclass=cF0>.