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