<aname="l3"></a>ZealC is a fork of HolyC. The only changes to Terry's HolyC compiler are reformatting, label renames, bugfixes, and additions.
<aname="l4"></a>Little to no functionality is removed, and nothing is fundamentally altered. Code incompatibilities are usually due to Kernel,
<aname="l5"></a>System, or user methods changing in name and/or functionality, rather than any differences in the Compiler. See the </span><spanclass=cF4>
<aname="l6"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Utils/ConversionScript.ZC.html#l1"><spanclass=cF4>Conversion Script</span></a><spanclass=cF0> for help porting HolyC code to ZealC.
<aname="l7"></a>
<aname="l8"></a>
<aname="l9"></a>* See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/CompilerOverview.DD.html#l1"><spanclass=cF4>::/Doc/CompilerOverview.DD</span></a><spanclass=cF0>.
<aname="l10"></a>
<aname="l11"></a>* See </span><ahref="https://zeal-operating-system.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="l12"></a>
<aname="l13"></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
<aname="l14"></a>and </span><spanclass=cF2>F64</span><spanclass=cF0> for 8 byte floats.
<aname="l15"></a>
<aname="l16"></a></span><spanclass=cF2> U0 void, but ZERO size!
<aname="l42"></a>* A char const all alone is sent to </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KeyDev.ZC.html#l23"><spanclass=cF4>PutChars</span></a><spanclass=cF0>(). A string with or without args is sent to </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/StrPrint.ZC.html#l1110"><spanclass=cF4>Print</span></a><spanclass=cF0>(). An empty string literal
<aname="l43"></a>signals a variable format_str follows.
<aname="l44"></a>
<aname="l45"></a></span><spanclass=cF2>void DemoC(char drv, char *format, char *name, int age)
<aname="l57"></a>"%s age %d\n", name, age;
<aname="l58"></a>"" format, name, age;
<aname="l59"></a> '' drive;
<aname="l60"></a> '*';
<aname="l61"></a> }
<aname="l62"></a></span><spanclass=cF0>
<aname="l63"></a>* When dealing with function addresses such as for callbacks, precede the name with "</span><spanclass=cF2>&</span><spanclass=cF0>".
<aname="l64"></a>
<aname="l65"></a>* Type casting is postfix. To typecast int or F64, use </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelB.HH.html#l92"><spanclass=cF4>ToI64</span></a><spanclass=cF0>(), </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelB.HH.html#l90"><spanclass=cF4>ToBool</span></a><spanclass=cF0>() or </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelB.HH.html#l91"><spanclass=cF4>ToF64</span></a><spanclass=cF0>(). (ZealOS follows normal C float<-->int
<aname="l66"></a>conversion, but sometimes you want to override. These functions are better than multiplying by "1.0" to convert to float.)
<aname="l67"></a>
<aname="l68"></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="l69"></a>
<aname="l70"></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="l71"></a></span><ahref="https://zeal-operating-system.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="l72"></a>
<aname="l73"></a></span><spanclass=cF2>public I64i union I64 //"I64i" is intrinsic. We are defining "I64".
<aname="l74"></a> {
<aname="l75"></a> I8i i8[8];
<aname="l76"></a> U8i u8[8];
<aname="l77"></a> I16 i16[4];
<aname="l78"></a> U16 u16[4];
<aname="l79"></a> I32 i32[2];
<aname="l80"></a> U32 u32[2];
<aname="l81"></a> };
<aname="l82"></a>
<aname="l83"></a> I64 i = 0x123456780000DEF0;
<aname="l84"></a> i.u16[1] = 0x9ABC;
<aname="l85"></a></span><spanclass=cF0>
<aname="l86"></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="l87"></a>argc</span><spanclass=cF0>' and '</span><spanclass=cF2>I64 argv[]</span><spanclass=cF0>'.
<aname="l103"></a> public U0 GrPrint(CDC *dc, I64 x, I64 y, U8 *format, ...)
<aname="l104"></a> {
<aname="l105"></a> U8 *buf = </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/StrPrint.ZC.html#l249"><spanclass=cF4>StrPrintJoin</span></a><spanclass=cF2>(NULL, format, argc, argv); //SPrintF() with </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/MAllocFree.ZC.html#l391"><spanclass=cF4>MAlloc</span></a><spanclass=cF2>()ed string.
<aname="l106"></a>
<aname="l107"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Gr/GrBitMap.ZC.html#l1084"><spanclass=cF4>GrPutS</span></a><spanclass=cF2>(dc, x, y, buf); //Plot string at x,y pixels. GrPutS is not public.
<aname="l114"></a> //Print score in the center of the screen.
<aname="l115"></a> ...
<aname="l116"></a>
<aname="l117"></a></span><spanclass=cF0>
<aname="l118"></a>* Allows "</span><spanclass=cF2>5 < i < j + 1 < 20</span><spanclass=cF0>" instead of "</span><spanclass=cF2>5 < i && i < j + 1 && j + 1 < 20</span><spanclass=cF0>".
<aname="l119"></a>
<aname="l120"></a></span><spanclass=cF2>if (13 <= age < 20)
<aname="l121"></a>"Teen-ager";
<aname="l122"></a></span><spanclass=cF0>
<aname="l123"></a>* if you know a switch statement will not exceed the lowest or highest case values. </span><spanclass=cF2>switch []</span><spanclass=cF0> is a little faster because it
<aname="l124"></a>doesn't check.
<aname="l125"></a>
<aname="l126"></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="l127"></a>
<aname="l128"></a>* Allows ranges like "</span><spanclass=cF2>case 4...7:</span><spanclass=cF0>" in </span><spanclass=cF2>switch</span><spanclass=cF0> statements.
<aname="l129"></a>
<aname="l130"></a>* A no case number causes next higher int case in </span><spanclass=cF2>switch</span><spanclass=cF0> statements. See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Demo/NullCase.ZC.html#l1"><spanclass=cF4>::/Demo/NullCase.ZC</span></a><spanclass=cF0>.
<aname="l131"></a>
<aname="l132"></a></span><spanclass=cF2>I64 i;
<aname="l133"></a>
<aname="l134"></a> for (i = 0; i < 20; i++)
<aname="l135"></a> switch (i)
<aname="l136"></a> {
<aname="l137"></a> case: "Zero\n"; break; //Starts at zero
<aname="l138"></a> case: "One\n"; break; //One plus prev case.
<aname="l141"></a> case 10: "Ten\n"; break;
<aname="l142"></a> case: "Eleven\n"; break; //One plus prev case.
<aname="l143"></a> }</span><spanclass=cF0>
<aname="l144"></a>
<aname="l145"></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="l146"></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="l154"></a> case 0: "Zero "; break;
<aname="l155"></a> case 2: "Two "; break;
<aname="l156"></a> case 4: "Four "; break;
<aname="l157"></a> start:
<aname="l158"></a>"[";
<aname="l159"></a> case 1: "One"; break;
<aname="l160"></a> case 3: "Three"; break;
<aname="l161"></a> case 5: "Five"; break;
<aname="l162"></a> end:
<aname="l163"></a>"] ";
<aname="l164"></a> break;
<aname="l165"></a> }</span><spanclass=cF0>
<aname="l166"></a> OutPut:
<aname="l167"></a>></span><spanclass=cF2>Zero [One] Two [Three] Four [Five]</span><spanclass=cF0>
<aname="l168"></a>
<aname="l169"></a>* A </span><spanclass=cF2>no_warn</span><spanclass=cF0> statement will suppress an unused variable warning.
<aname="l170"></a>
<aname="l171"></a>* You can have multiple member variables 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="l172"></a>
<aname="l173"></a>* </span><spanclass=cF2>noreg</span><spanclass=cF0> or </span><spanclass=cF2>reg</span><spanclass=cF0> can be placed before a function local variable name. You can, optionally, specify a register after the </span><spanclass=cF2>reg</span><spanclass=cF0>
<aname="l174"></a>keyword.
<aname="l175"></a>
<aname="l176"></a></span><spanclass=cF2>U0 Main()
<aname="l177"></a> {
<aname="l178"></a> //Only use </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l1939"><spanclass=cF4>REGG_LOCAL_VARS</span></a><spanclass=cF2> or </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l1940"><spanclass=cF4>REGG_LOCAL_NON_PTR_VARS</span></a><spanclass=cF2> for register variables or else clobbered.
<aname="l179"></a> I64 reg R15 i = 5, noreg j = 4;
<aname="l180"></a> no_warn i;
<aname="l181"></a> asm {
<aname="l182"></a> MOV RAX, R15
<aname="l183"></a> CALL &PUT_HEX_U64
<aname="l184"></a> MOV RAX, '\n'
<aname="l185"></a> CALL &PUT_CHARS
<aname="l186"></a> MOV RAX, U64 &j[RBP]
<aname="l187"></a> CALL &PUT_HEX_U64
<aname="l188"></a> MOV RAX, '\n'
<aname="l189"></a> CALL &PUT_CHARS
<aname="l190"></a> }
<aname="l191"></a> }
<aname="l192"></a></span><spanclass=cF0>
<aname="l193"></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://zeal-operating-system.github.io/ZealOS/Kernel/SerialDev/Keyboard.ZC.html#l477"><spanclass=cF4>IRQKbd</span></a><spanclass=cF0>().
<aname="l194"></a>
<aname="l195"></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://zeal-operating-system.github.io/ZealOS/Kernel/KeyDev.ZC.html#l23"><spanclass=cF4>PutChars</span></a><spanclass=cF0>() takes multiple characters.
<aname="l196"></a>
<aname="l197"></a></span><spanclass=cF2>asm {
<aname="l198"></a> HELLO_WORLD::
<aname="l199"></a> PUSH RBP
<aname="l200"></a> MOV RBP, RSP
<aname="l201"></a> MOV RAX, 'Hello '
<aname="l202"></a> CALL &PUT_CHARS
<aname="l203"></a> MOV RAX, 'World\n'
<aname="l204"></a> CALL &PUT_CHARS
<aname="l205"></a> LEAVE
<aname="l206"></a> RET
<aname="l207"></a> }
<aname="l208"></a> Call(HELLO_WORLD);
<aname="l209"></a> PutChars('Hello ');
<aname="l210"></a> PutChars('World\n');
<aname="l211"></a></span><spanclass=cF0>
<aname="l212"></a>* The "</span><spanclass=cF2>`</span><spanclass=cF0>" operator raises a base to a power.
<aname="l213"></a>
<aname="l214"></a>* There is no question-colon operator.
<aname="l230"></a>* You can use </span><ahref="https://zeal-operating-system.github.io/ZealOS/Compiler/CMisc.ZC.html#l1"><spanclass=cF4>Option</span></a><spanclass=cF0>(</span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l1679"><spanclass=cF4>OPTf_WARN_PAREN</span></a><spanclass=cF0>, ON) to find unnecessary parentheses in code.
<aname="l231"></a>
<aname="l232"></a>* You can use </span><ahref="https://zeal-operating-system.github.io/ZealOS/Compiler/CMisc.ZC.html#l1"><spanclass=cF4>Option</span></a><spanclass=cF0>(</span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l1680"><spanclass=cF4>OPTf_WARN_DUP_TYPES</span></a><spanclass=cF0>, ON) to find duplicate local variable type statements.
<aname="l233"></a>
<aname="l234"></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.
<aname="l235"></a>See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KMain.ZC.html#l257"><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="l236"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/Compiler/CMisc.ZC.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> block.
<aname="l237"></a>
<aname="l238"></a>* No </span><spanclass=cF2>#define</span><spanclass=cF0> functions exist (Terry was not a fan)
<aname="l239"></a>
<aname="l240"></a>* No </span><spanclass=cF2>typedef</span><spanclass=cF0>, use </span><spanclass=cF2>class</span><spanclass=cF0>.
<aname="l241"></a>
<aname="l242"></a>* No type-checking
<aname="l243"></a>
<aname="l244"></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="l245"></a>
<aname="l246"></a>* "</span><spanclass=cF2>$</span><spanclass=cF0>" is an escape character. Two dollar signs signify an ordinary $. See </span><ahref="https://zeal-operating-system.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://zeal-operating-system.github.io/ZealOS/Doc/ZealC.DD.html#l1"><spanclass=cF4>ZealC</span></a><spanclass=cF0> code, it also refers to
<aname="l247"></a>the instruction's address or the offset in a </span><spanclass=cF2>class</span><spanclass=cF0> definition.
<aname="l248"></a>
<aname="l249"></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
<aname="l250"></a>declared in </span><ahref="https://zeal-operating-system.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
<aname="l251"></a>when used by itself. See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Demo/SubIntAccess.ZC.html#l1"><spanclass=cF4>::/Demo/SubIntAccess.ZC</span></a><spanclass=cF0>.
<aname="l252"></a>
<aname="l253"></a>* </span><spanclass=cF2>class</span><spanclass=cF0> member variables 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
<aname="l254"></a>saved and you can access the compiler's info about classes and variables. See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Demo/ClassMeta.ZC.html#l1"><spanclass=cF4>::/Demo/ClassMeta.ZC</span></a><spanclass=cF0> and </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/DolDoc/DocForm.ZC.html#l263"><spanclass=cF4>DocForm</span></a><spanclass=cF0>().
<aname="l255"></a>
<aname="l256"></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="l257"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/Demo/LastClass.ZC.html#l1"><spanclass=cF4>::/Demo/LastClass.ZC</span></a><spanclass=cF0>, </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Debug.ZC.html#l216"><spanclass=cF4>ClassRep</span></a><spanclass=cF0>(), </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/DolDoc/DocForm.ZC.html#l263"><spanclass=cF4>DocForm</span></a><spanclass=cF0>() and </span><ahref="https://zeal-operating-system.github.io/ZealOS/Demo/Disk/BlkDevRep.ZC.html#l1"><spanclass=cF4>::/Demo/Disk/BlkDevRep.ZC</span></a><spanclass=cF0>.
<aname="l258"></a>
<aname="l259"></a>* See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Demo/Exceptions.ZC.html#l1"><spanclass=cF4>::/Demo/Exceptions.ZC</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="l260"></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>
<aname="l261"></a>block, set the variable </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://zeal-operating-system.github.io/ZealOS/Kernel/KExcept.ZC.html#l46"><spanclass=cF4>PutExcept</span></a><spanclass=cF0>() as a
<aname="l262"></a>handler, if you like.
<aname="l263"></a>
<aname="l264"></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="l265"></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>
<aname="l266"></a>and </span><spanclass=cF2>offset</span><spanclass=cF0> only accept one level of member variables. That is, you can't do </span><spanclass=cF2>sizeof(classname.membername.submembername)</span><spanclass=cF0>.
<aname="l267"></a>
<aname="l268"></a>* There is no </span><spanclass=cF2>continue</span><spanclass=cF0> statement. Use </span><spanclass=cF2>goto</span><spanclass=cF0>.
<aname="l269"></a>
<aname="l270"></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="l271"></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://zeal-operating-system.github.io/ZealOS/Demo/MultiCore/Lock.ZC.html#l1"><spanclass=cF4>::/Demo/MultiCore/Lock.ZC</span></a><spanclass=cF0>.
<aname="l272"></a>
<aname="l273"></a>* There is a function called </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/MAllocFree.ZC.html#l388"><spanclass=cF4>MSize</span></a><spanclass=cF0>() which gives the size of an object alloced off the heap. For larger size allocations,
<aname="l274"></a>the 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="l275"></a>
<aname="l276"></a>* You CAN </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/MAllocFree.ZC.html#l387"><spanclass=cF4>Free</span></a><spanclass=cF0>() a </span><spanclass=cF2>NULL</span><spanclass=cF0> pointer. Useful variants of </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/MAllocFree.ZC.html#l391"><spanclass=cF4>MAlloc</span></a><spanclass=cF0>() can be found </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/MAllocFree.ZC.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>
<aname="l277"></a>Free</span><spanclass=cF0> off-of other task's heaps, or make an independent heap with </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/HeapCtrl.ZC.html#l1"><spanclass=cF4>HeapCtrlInit</span></a><spanclass=cF0>(). See </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Utils/HeapLog.ZC.html#l83"><spanclass=cF4>HeapLog</span></a><spanclass=cF0>() for an example.
<aname="l278"></a>
<aname="l279"></a>* The stack does not grow because virtual mem is not used. It's recommended to allocate large local variables from the heap.
<aname="l280"></a>You can change </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l3540"><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://zeal-operating-system.github.io/ZealOS/Kernel/KTask.ZC.html#l264"><spanclass=cF4>Spawn</span></a><spanclass=cF0>(). You can use </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KTask.ZC.html#l129"><spanclass=cF4>CallStackGrow</span></a><spanclass=cF0>(), but
<aname="l281"></a>it's odd. See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Demo/StackGrow.ZC.html#l1"><spanclass=cF4>::/Demo/StackGrow.ZC</span></a><spanclass=cF0>.
<aname="l282"></a>
<aname="l283"></a>* Only one base class is allowed.
<aname="l284"></a>
<aname="l285"></a>* </span><spanclass=cF2>printf()</span><spanclass=cF0> has new codes. See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Print.DD.html#l1"><spanclass=cF4>Print("") Format Strings</span></a><spanclass=cF0>.
<aname="l286"></a>
<aname="l287"></a>* All values are extended to 64-bit when accessed. Intermediate calculations are done with 64-bit values.
<aname="l288"></a>
<aname="l289"></a></span><spanclass=cF2>U0 Main()
<aname="l290"></a> {
<aname="l291"></a> I16 i1;
<aname="l292"></a> I32 j1;
<aname="l293"></a>
<aname="l294"></a> j1 = i1 = 0x12345678; //Resulting i1 is 0x5678 but j1 is 0x12345678
<aname="l295"></a>
<aname="l296"></a> I64 i2 = 0x8000000000000000;
<aname="l297"></a> Print("%X\n", i2 >> 1); //Res is 0xC000000000000000 as expected
<aname="l298"></a>
<aname="l299"></a> U64 u3 = 0x8000000000000000;
<aname="l300"></a> Print("%X\n", u3 >> 1); //Res is 0x4000000000000000 as expected
<aname="l301"></a>
<aname="l302"></a> I32 i4 = 0x80000000; //const is loaded into a 64-bit register variable.
<aname="l303"></a> Print("%X\n", i4 >> 1); //Res is 0x40000000
<aname="l304"></a>
<aname="l305"></a> I32 i5 = -0x80000000;
<aname="l306"></a> Print("%X\n", i5 >> 1); //Res is 0xFFFFFFFFC0000000