TempleOSCDV4.08.ISO
This commit is contained in:
1 parent
b632ab9a4f
commit
2d56cda5f3
258 files changed
+6973
-5476
No files matched your search
+68
-68
@@ -1,12 +1,12 @@
|
||||
$WW,1$$PURPLE$$TX+CX,"HolyC"$$FG$
|
||||
$WW,1$$FG,5$$TX+CX,"HolyC"$$FG$
|
||||
|
||||
* See $LK,"::/Doc/CompilerOverview.TXT"$.
|
||||
|
||||
* See $LK,"Scoping and Linkage",A="FI:::/Doc/ScopingLinkage.TXT"$ for details on $GREEN$extern$FG$, $GREEN$import$FG$, $GREEN$_extern$FG$, $GREEN$_import$FG$, etc.
|
||||
* See $LK,"Scoping and Linkage",A="FI:::/Doc/ScopingLinkage.TXT"$ for details on $FG,2$extern$FG$, $FG,2$import$FG$, $FG,2$_extern$FG$, $FG,2$_import$FG$, etc.
|
||||
|
||||
* Built-in types include $GREEN$I0,I8,I16,I32,I64$FG$ for signed 0-8 byte ints and $GREEN$U0,U8,U16,U32,U64$FG$ for unsigned 0-8 byte ints and $GREEN$F64$FG$ for 8 byte floats.
|
||||
* Built-in types include $FG,2$I0,I8,I16,I32,I64$FG$ for signed 0-8 byte ints and $FG,2$U0,U8,U16,U32,U64$FG$ for unsigned 0-8 byte ints and $FG,2$F64$FG$ for 8 byte floats.
|
||||
|
||||
$GREEN$ U0 void, but ZERO size!
|
||||
$FG,2$ U0 void, but ZERO size!
|
||||
I8 char
|
||||
U8 unsigned char
|
||||
I16 short
|
||||
@@ -16,16 +16,16 @@ $GREEN$ U0 void, but ZERO size!
|
||||
I64 long (64-bit)
|
||||
U64 unsigned long (64-bit)
|
||||
F64 double$FG$
|
||||
$RED$no F32 float.$FG$
|
||||
$FG,4$no F32 float.$FG$
|
||||
|
||||
* Function with no args, or just default args can be called without parentheses.
|
||||
|
||||
>$GREEN$Dir("*");$FG$
|
||||
>$GREEN$Dir();$FG$
|
||||
>$GREEN$Dir;$FG$
|
||||
>$FG,2$Dir("*");$FG$
|
||||
>$FG,2$Dir();$FG$
|
||||
>$FG,2$Dir;$FG$
|
||||
|
||||
* Default args don't have to be on the end. This code is valid:
|
||||
$ID,2$$GREEN$U0 Test(I64 i=4,I64 j,I64 k=5)
|
||||
$ID,2$$FG,2$U0 Test(I64 i=4,I64 j,I64 k=5)
|
||||
{
|
||||
Print("%X %X %X\n",i,j,k);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ Test(,3);$FG$
|
||||
$ID,-2$
|
||||
* A char const all alone is sent to $LK,"PutChars",A="MN:PutChars"$(). A string with or without args is sent to $LK,"Print",A="MN:Print"$(). An empty string literal signals a variable fmt_str follows.
|
||||
|
||||
$ID,2$$GREEN$void DemoC(char drv,char *fmt,char *name,int age)
|
||||
$ID,2$$FG,2$void DemoC(char drv,char *fmt,char *name,int age)
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
printf("%s age %d\n",name,age);
|
||||
@@ -52,15 +52,15 @@ U0 DemoHolyC(U8 drv,U8 *fmt,U8 *name,I64 age)
|
||||
'*';
|
||||
}
|
||||
$FG$$ID,-2$
|
||||
* When dealing with function addresses such as for callbacks, precede the name with "$GREEN$&$FG$".
|
||||
* When dealing with function addresses such as for callbacks, precede the name with "$FG,2$&$FG$".
|
||||
|
||||
* Type casting is postfix. To typecast int or F64, use $LK,"ToI64",A="MN:ToI64"$(), $LK,"ToBool",A="MN:ToBool"$() or $LK,"ToF64",A="MN:ToF64"$(). (TempleOS follows normal C float<-->int conversion, but sometimes you want to override. These functions are better than multiplying by "1.0" to convert to float.)
|
||||
|
||||
* There is no $GREEN$main()$FG$ function. Any code outside of functions gets executed upon start-up, in order.
|
||||
* There is no $FG,2$main()$FG$ function. Any code outside of functions gets executed upon start-up, in order.
|
||||
|
||||
* There are no bit fields, but there are $LK,"bit access",A="HI:Bit"$ routines and you can access bytes or words within any int. See $LK,"I64 declaration",A="MN:I64"$. A class can be accessed as a whole are subints, if you put a type in front of the $GREEN$class$FG$ declaration.
|
||||
* There are no bit fields, but there are $LK,"bit access",A="HI:Bit"$ routines and you can access bytes or words within any int. See $LK,"I64 declaration",A="MN:I64"$. A class can be accessed as a whole are subints, if you put a type in front of the $FG,2$class$FG$ declaration.
|
||||
$ID,2$
|
||||
$GREEN$public I64i union I64 //"I64i" is intrinsic. We are defining "I64".
|
||||
$FG,2$public I64i union I64 //"I64i" is intrinsic. We are defining "I64".
|
||||
{
|
||||
I8i i8[8];
|
||||
U8i u8[8];
|
||||
@@ -73,9 +73,9 @@ $GREEN$public I64i union I64 //"I64i" is intrinsic. We are defining "I64".
|
||||
I64 i=0x123456780000DEF0;
|
||||
i.u16[1]=0x9ABC;
|
||||
$FG$$ID,-2$
|
||||
* Variable arg count functions ($GREEN$...$FG$) can access their args with built-in variables similar to '$GREEN$this$FG$' in C++. They are '$GREEN$I64 argc$FG$' and '$GREEN$I64 argv[]$FG$'.
|
||||
* Variable arg count functions ($FG,2$...$FG$) can access their args with built-in variables similar to '$FG,2$this$FG$' in C++. They are '$FG,2$I64 argc$FG$' and '$FG,2$I64 argv[]$FG$'.
|
||||
$ID,2$$WW,0$
|
||||
$GREEN$I64 AddNums(...)
|
||||
$FG,2$I64 AddNums(...)
|
||||
{
|
||||
I64 i,res=0;
|
||||
for (i=0;i<argc;i++)
|
||||
@@ -83,9 +83,9 @@ $GREEN$I64 AddNums(...)
|
||||
return res;
|
||||
}
|
||||
|
||||
$FG$>$GREEN$AddNums(1,2,3);$FG$
|
||||
$FG$>$FG,2$AddNums(1,2,3);$FG$
|
||||
ans=6
|
||||
$GREEN$
|
||||
$FG,2$
|
||||
|
||||
public U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...)
|
||||
{
|
||||
@@ -101,20 +101,20 @@ public U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...)
|
||||
...
|
||||
|
||||
$WW,1$$FG$$ID,-2$
|
||||
* Allows "$GREEN$5<i<j+1<20$FG$" instead of "$GREEN$5<i && i<j+1 && j+1<20$FG$".
|
||||
* Allows "$FG,2$5<i<j+1<20$FG$" instead of "$FG,2$5<i && i<j+1 && j+1<20$FG$".
|
||||
$ID,2$
|
||||
$GREEN$if (13<=age<20)
|
||||
$FG,2$if (13<=age<20)
|
||||
"Teen-ager";
|
||||
$FG$$ID,-2$
|
||||
* if you know a switch stmt will not exceed the lowest or highest case values. $GREEN$switch []$FG$ is a little faster because it doesn't check.
|
||||
* if you know a switch stmt will not exceed the lowest or highest case values. $FG,2$switch []$FG$ is a little faster because it doesn't check.
|
||||
|
||||
* $GREEN$switch$FG$ stmts always use a jump table. Don't use them with cases with really big, sparse ranges.
|
||||
* $FG,2$switch$FG$ stmts always use a jump table. Don't use them with cases with really big, sparse ranges.
|
||||
|
||||
* Allows ranges like "$GREEN$case 4...7:$FG$" in $GREEN$switch$FG$ stmts.
|
||||
* Allows ranges like "$FG,2$case 4...7:$FG$" in $FG,2$switch$FG$ stmts.
|
||||
|
||||
* A no case number causes next higher int case in $GREEN$switch$FG$ stmts. See $LK,"::/Demo/NullCase.CPP"$.
|
||||
* A no case number causes next higher int case in $FG,2$switch$FG$ stmts. See $LK,"::/Demo/NullCase.CPP"$.
|
||||
|
||||
$ID,2$$GREEN$I64 i;
|
||||
$ID,2$$FG,2$I64 i;
|
||||
for (i=0;i<20;i++)
|
||||
switch (i) {
|
||||
case: "Zero\n"; break; //Starts at zero
|
||||
@@ -125,37 +125,37 @@ for (i=0;i<20;i++)
|
||||
case: "Eleven\n"; break; //One plus prev case.
|
||||
}$FG$$ID,-2$
|
||||
|
||||
* $GREEN$sub_switch_start$FG$/$GREEN$sub_switch_end$FG$ allow a new type of nested-switch control flow. (Don't goto, throw exception or return out of $GREEN$sub_switch_start$FG$ front porch area.) See $LK,"::/Demo/SubSwitch.CPP"$.
|
||||
* Switch statements can be nestled with a single switch expression! This is known as a "sub_switch" statement. $FG,2$start$FG$/$FG,2$end$FG$ are used to group cases. Don't goto out of, throw an exception out of, or return out of the $FG,2$start$FG$ front porch area. See $LK,"::/Demo/SubSwitch.CPP"$.
|
||||
|
||||
$ID,2$$GREEN$I64 i;
|
||||
$ID,2$$FG,2$I64 i;
|
||||
for (i=0;i<10;i++)
|
||||
switch (i) {
|
||||
case 0: "Zero "; break;
|
||||
case 2: "Two "; break;
|
||||
case 4: "Four "; break;
|
||||
sub_switch_start:
|
||||
start:
|
||||
"[";
|
||||
case 1: "One"; break;
|
||||
case 3: "Three"; break;
|
||||
case 5: "Five"; break;
|
||||
sub_switch_end:
|
||||
end:
|
||||
"] ";
|
||||
break;
|
||||
}$FG$
|
||||
$BG$OutPut:
|
||||
>$GREEN$Zero [One] Two [Three] Four [Five]$FG$
|
||||
>$FG,2$Zero [One] Two [Three] Four [Five]$FG$
|
||||
$ID,-2$
|
||||
* A $GREEN$nounusedwarn$FG$ stmt will suppress an unused var warning.
|
||||
* A $FG,2$no_warn$FG$ stmt will suppress an unused var warning.
|
||||
|
||||
* You can have multiple member vars of a class named "$GREEN$pad$FG$" or "$GREEN$reserved$FG$", and it won't issue warnings.
|
||||
* You can have multiple member vars of a class named "$FG,2$pad$FG$" or "$FG,2$reserved$FG$", and it won't issue warnings.
|
||||
|
||||
* $GREEN$noreg$FG$ or $GREEN$reg$FG$ can be placed before a function local var name. You can, optionally, specify a reg after the $GREEN$reg$FG$ keyword.
|
||||
* $FG,2$noreg$FG$ or $FG,2$reg$FG$ can be placed before a function local var name. You can, optionally, specify a reg after the $FG,2$reg$FG$ keyword.
|
||||
|
||||
$ID,2$$GREEN$U0 Main()
|
||||
$ID,2$$FG,2$U0 Main()
|
||||
{
|
||||
//Only use $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ or $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ for reg vars or else clobbered.
|
||||
I64 reg R15 i=5, noreg j=4;
|
||||
nounusedwarn i;
|
||||
no_warn i;
|
||||
asm {
|
||||
MOV RAX,R15
|
||||
CALL &PUT_HEX_U64
|
||||
@@ -168,11 +168,11 @@ $ID,2$$GREEN$U0 Main()
|
||||
}
|
||||
}
|
||||
$FG$$ID,-2$
|
||||
* $GREEN$interrupt$FG$, $GREEN$haserrcode$FG$, $GREEN$public$FG$, $GREEN$argpop$FG$ or $GREEN$noargpop$FG$ are function flags. See $LK,"::/Demo/Lectures/Mem/PageTableEntries.CPP"$.
|
||||
* $FG,2$interrupt$FG$, $FG,2$haserrcode$FG$, $FG,2$public$FG$, $FG,2$argpop$FG$ or $FG,2$noargpop$FG$ are function flags. See $LK,"::/Demo/Lectures/Mem/PageTableEntries.CPP"$.
|
||||
|
||||
* A single quote can encompass multiple characters. $GREEN$'ABC'$FG$ is equ to $GREEN$0x434241$FG$. $LK,"PutChars",A="MN:PutChars"$() takes multiple characters.
|
||||
* A single quote can encompass multiple characters. $FG,2$'ABC'$FG$ is equ to $FG,2$0x434241$FG$. $LK,"PutChars",A="MN:PutChars"$() takes multiple characters.
|
||||
|
||||
$ID,2$$GREEN$asm {
|
||||
$ID,2$$FG,2$asm {
|
||||
HELLO_WORLD::
|
||||
PUSH RBP
|
||||
MOV RBP,RSP
|
||||
@@ -187,67 +187,67 @@ Call(HELLO_WORLD);
|
||||
PutChars('Hello ');
|
||||
PutChars('World\n');
|
||||
$FG$$ID,-2$
|
||||
* The "$GREEN$`$FG$" operator raises a base to a power.
|
||||
* The "$FG,2$`$FG$" operator raises a base to a power.
|
||||
|
||||
* There is no question-colon operator.
|
||||
|
||||
* TempleOS $LK,"operator precedence",A="FF:::/Compiler/CInit.CPP,cmp.binary_ops"$
|
||||
$GREEN$`$FG$,$GREEN$>>$FG$,$GREEN$<<$FG$
|
||||
$GREEN$*$FG$,$GREEN$/$FG$,$GREEN$%$FG$
|
||||
$GREEN$&$FG$
|
||||
$GREEN$^$FG$
|
||||
$GREEN$|$FG$
|
||||
$GREEN$+$FG$,$GREEN$-$FG$
|
||||
$GREEN$$GREEN$<$FG$,$GREEN$>$FG$,$GREEN$<=$FG$,$GREEN$>=$FG$
|
||||
$GREEN$==$FG$,$GREEN$!=$FG$
|
||||
$GREEN$&&$FG$
|
||||
$GREEN$$GREEN$^^$FG$
|
||||
$GREEN$||$FG$$FG$
|
||||
$GREEN$=$FG$,$GREEN$<<=$FG$,$GREEN$>>=$FG$,$GREEN$*=$FG$,$GREEN$/=$FG$,$GREEN$&=$FG$,$GREEN$|=$FG$,$GREEN$^=$FG$,$GREEN$+=$FG$,$GREEN$-=$FG$
|
||||
$FG,2$`$FG$,$FG,2$>>$FG$,$FG,2$<<$FG$
|
||||
$FG,2$*$FG$,$FG,2$/$FG$,$FG,2$%$FG$
|
||||
$FG,2$&$FG$
|
||||
$FG,2$^$FG$
|
||||
$FG,2$|$FG$
|
||||
$FG,2$+$FG$,$FG,2$-$FG$
|
||||
$FG,2$$FG,2$<$FG$,$FG,2$>$FG$,$FG,2$<=$FG$,$FG,2$>=$FG$
|
||||
$FG,2$==$FG$,$FG,2$!=$FG$
|
||||
$FG,2$&&$FG$
|
||||
$FG,2$$FG,2$^^$FG$
|
||||
$FG,2$||$FG$$FG$
|
||||
$FG,2$=$FG$,$FG,2$<<=$FG$,$FG,2$>>=$FG$,$FG,2$*=$FG$,$FG,2$/=$FG$,$FG,2$&=$FG$,$FG,2$|=$FG$,$FG,2$^=$FG$,$FG,2$+=$FG$,$FG,2$-=$FG$
|
||||
|
||||
* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$,ON) to find unnecessary parentheses in code.
|
||||
|
||||
* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$,ON) to find dup local var type stmts.
|
||||
|
||||
* With the $GREEN$#exe{}$FG$ feature in your src code, you can place programs that insert text into the stream of code being compiled. See $LK,"#exe {}",A="FF:::/Kernel/KEnd.CPP,#exe {"$ for an example where the date/time and compile-time prompting for cfguration data is placed into a program. $LK,"StreamPrint",A="MN:StreamPrint"$() places text into a src program stream following the conclusion of the $GREEN$#exe{}$FG$ blk.
|
||||
* With the $FG,2$#exe{}$FG$ feature in your src code, you can place programs that insert text into the stream of code being compiled. See $LK,"#exe {}",A="FF:::/Kernel/KEnd.CPP,#exe {"$ for an example where the date/time and compile-time prompting for cfguration data is placed into a program. $LK,"StreamPrint",A="MN:StreamPrint"$() places text into a src program stream following the conclusion of the $FG,2$#exe{}$FG$ blk.
|
||||
|
||||
* No $GREEN$#define$FG$ functions exist (I'm not a fan)
|
||||
* No $FG,2$#define$FG$ functions exist (I'm not a fan)
|
||||
|
||||
* No $GREEN$typedef$FG$, use $GREEN$class$FG$.
|
||||
* No $FG,2$typedef$FG$, use $FG,2$class$FG$.
|
||||
|
||||
* No type-checking
|
||||
|
||||
* Can't use $GREEN$<>$FG$ with $GREEN$#include$FG$, use $GREEN$""$FG$.
|
||||
* Can't use $FG,2$<>$FG$ with $FG,2$#include$FG$, use $FG,2$""$FG$.
|
||||
|
||||
* "$GREEN$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$. In $GREEN$asm$FG$ or $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ code, it also refers to the inst's address or the offset in a $GREEN$class$FG$ definition.
|
||||
* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$. In $FG,2$asm$FG$ or $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ code, it also refers to the inst's address or the offset in a $FG,2$class$FG$ definition.
|
||||
|
||||
* $GREEN$union$FG$ is more like a class, so you don't reference it with a $GREEN$union$FG$ label after you define it. Some common unions are declared in $LK,"KernelA.HPP",A="MN:U16"$ 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 itself. See $LK,"::/Demo/SubIntAccess.CPP"$.
|
||||
* $FG,2$union$FG$ is more like a class, so you don't reference it with a $FG,2$union$FG$ label after you define it. Some common unions are declared in $LK,"KernelA.HPP",A="MN:U16"$ 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 itself. See $LK,"::/Demo/SubIntAccess.CPP"$.
|
||||
|
||||
* $GREEN$class$FG$ member vars can have meta data. $GREEN$fmtstr$FG$ and $GREEN$fmtdata$FG$ are two meta data types now used. All compiler structures are saved and you can access the compiler's info about classes and vars. See $LK,"::/Demo/ClassMeta.CPP"$ and $LK,"DocForm",A="MN:DocForm"$().
|
||||
* $FG,2$class$FG$ member vars can have meta data. $FG,2$fmtstr$FG$ and $FG,2$fmtdata$FG$ are two meta data types now used. All compiler structures are saved and you can access the compiler's info about classes and vars. See $LK,"::/Demo/ClassMeta.CPP"$ and $LK,"DocForm",A="MN:DocForm"$().
|
||||
|
||||
* There is a keyword $GREEN$lastclass$FG$ you use as a dft arg. It is set to the class name of the prev arg. See $LK,"::/Demo/LastClass.CPP"$, $LK,"ClassRep",A="MN:ClassRep"$(), $LK,"DocForm",A="MN:DocForm"$() and $LK,"::/Demo/Dsk/BlkDevRep.CPP"$.
|
||||
* There is a keyword $FG,2$lastclass$FG$ you use as a dft arg. It is set to the class name of the prev arg. See $LK,"::/Demo/LastClass.CPP"$, $LK,"ClassRep",A="MN:ClassRep"$(), $LK,"DocForm",A="MN:DocForm"$() and $LK,"::/Demo/Dsk/BlkDevRep.CPP"$.
|
||||
|
||||
* See $LK,"::/Demo/Exceptions.CPP"$. $GREEN$try{} catch{}$FG$ and $GREEN$throw$FG$ are different from C++. $GREEN$throw$FG$ is a function with an 8-byte or less char arg. The char string passed in $GREEN$throw()$FG$ can be accessed from within a $GREEN$catch{}$FG$ using the $GREEN$Fs->except_ch$FG$. Within a $GREEN$catch {}$FG$ blk, set the var $GREEN$Fs->catch_except$FG$ to $GREEN$TRUE$FG$ if you want to terminate the search for a handler. Use $LK,"PutExcept",A="MN:PutExcept"$() as a handler, if you like.
|
||||
* See $LK,"::/Demo/Exceptions.CPP"$. $FG,2$try{} catch{}$FG$ and $FG,2$throw$FG$ are different from C++. $FG,2$throw$FG$ is a function with an 8-byte or less char arg. The char string passed in $FG,2$throw()$FG$ can be accessed from within a $FG,2$catch{}$FG$ using the $FG,2$Fs->except_ch$FG$. Within a $FG,2$catch {}$FG$ blk, set the var $FG,2$Fs->catch_except$FG$ to $FG,2$TRUE$FG$ if you want to terminate the search for a handler. Use $LK,"PutExcept",A="MN:PutExcept"$() as a handler, if you like.
|
||||
|
||||
* A function is available similar to $GREEN$sizeof$FG$ which provides the offset of a member of a class. It's called $GREEN$offset$FG$. You place the class name and member inside as in $GREEN$offset(classname.membername)$FG$. It has nothing to do with 16-bit code. Both $GREEN$sizeof$FG$ and $GREEN$offset$FG$ only accept one level of member vars. That is, you can't do $GREEN$sizeof(classname.membername.submembername)$FG$.$FG$
|
||||
* A function is available similar to $FG,2$sizeof$FG$ which provides the offset of a member of a class. It's called $FG,2$offset$FG$. You place the class name and member inside as in $FG,2$offset(classname.membername)$FG$. It has nothing to do with 16-bit code. Both $FG,2$sizeof$FG$ and $FG,2$offset$FG$ only accept one level of member vars. That is, you can't do $FG,2$sizeof(classname.membername.submembername)$FG$.$FG$
|
||||
|
||||
* There is no $GREEN$continue$FG$ stmt. Use $GREEN$goto$FG$.
|
||||
* There is no $FG,2$continue$FG$ stmt. Use $FG,2$goto$FG$.
|
||||
|
||||
* $GREEN$lock{}$FG$ can be used to apply asm $GREEN$LOCK$FG$ prefixes to code for safe multicore read-modify-write accesses. The code bracked with have $GREEN$LOCK$FG$ asm prefix's applied to relevant insts within. It's a little shoddy. See $LK,"::/Demo/MultiCore/Lock.CPP"$.
|
||||
* $FG,2$lock{}$FG$ can be used to apply asm $FG,2$LOCK$FG$ prefixes to code for safe multicore read-modify-write accesses. The code bracked with have $FG,2$LOCK$FG$ asm prefix's applied to relevant insts within. It's a little shoddy. See $LK,"::/Demo/MultiCore/Lock.CPP"$.
|
||||
|
||||
* There is a function called $LK,"MSize",A="MN:MSize"$() which gives the size of an object alloced off the heap. For larger size allocations, the system rounds-up to a power of two, so $GREEN$MSize()$FG$ lets you know the real size and you can take full advantage of it.
|
||||
* There is a function called $LK,"MSize",A="MN:MSize"$() which gives the size of an object alloced off the heap. For larger size allocations, the system rounds-up to a power of two, so $FG,2$MSize()$FG$ lets you know the real size and you can take full advantage of it.
|
||||
|
||||
* You CAN $LK,"Free",A="MN:Free"$() a $GREEN$NULL$FG$ ptr. Useful variants of $LK,"MAlloc",A="MN:MAlloc"$() can be found $LK,"Here",A="MN:CAlloc"$. Each task has a heap and you can $GREEN$MAlloc$FG$ and $GREEN$Free$FG$ off-of other task's heaps, or make an independent heap with $LK,"HeapCtrlInit",A="MN:HeapCtrlInit"$(). See $LK,"HeapLog",A="MN:HeapLog"$() for an example.
|
||||
* You CAN $LK,"Free",A="MN:Free"$() a $FG,2$NULL$FG$ ptr. Useful variants of $LK,"MAlloc",A="MN:MAlloc"$() can be found $LK,"Here",A="MN:CAlloc"$. Each task has a heap and you can $FG,2$MAlloc$FG$ and $FG,2$Free$FG$ off-of other task's heaps, or make an independent heap with $LK,"HeapCtrlInit",A="MN:HeapCtrlInit"$(). See $LK,"HeapLog",A="MN:HeapLog"$() for an example.
|
||||
|
||||
* The stk does not grow because virtual mem is not used. I recommend allocating large local vars from the heap. You can change $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$ and recompile $GREEN$Kernel$FG$ or request more when doing a $LK,"Spawn",A="MN:Spawn"$(). You can use $LK,"CallStkGrow",A="MN:CallStkGrow"$(), but it's odd. See $LK,"::/Demo/StkGrow.CPP"$.
|
||||
* The stk does not grow because virtual mem is not used. I recommend allocating large local vars from the heap. You can change $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$ and recompile $FG,2$Kernel$FG$ or request more when doing a $LK,"Spawn",A="MN:Spawn"$(). You can use $LK,"CallStkGrow",A="MN:CallStkGrow"$(), but it's odd. See $LK,"::/Demo/StkGrow.CPP"$.
|
||||
|
||||
* Only one base class is allowed.
|
||||
|
||||
* $GREEN$printf()$FG$ has new codes. See $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.TXT"$.
|
||||
* $FG,2$printf()$FG$ has new codes. See $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.TXT"$.
|
||||
|
||||
* All values are extended to 64-bit when accessed. Intermediate calculations are done with 64-bit values.
|
||||
|
||||
$ID,2$$GREEN$U0 Main()
|
||||
$ID,2$$FG,2$U0 Main()
|
||||
{
|
||||
I16 i1;
|
||||
I32 j1;
|
||||
|
||||
Reference in new issue
Block a user