TempleOSTS_131005.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:45:52 +02:00
1 parent 1343005a29
commit 2d2a65d572
547 files changed
+33608 -12549

No files matched your search

+52 -49
View File
@@ -1,4 +1,4 @@
$WW,1$$FG,5$$TX+CX,"Holy C"$$FG$
$WW,1$$FG,5$$TX+CX,"HolyC"$$FG$
* See $LK,"Scoping and Linkages","FI:::/TempleOS/Doc/ImportExports.TXT"$ for details on $FG,2$extern$FG$, $FG,2$import$FG$, $FG,2$_extern$FG$, $FG,2$_import$FG$, etc.
@@ -18,28 +18,28 @@ $FG,2$ U0 void
F64 double$FG$
$FG,4$no F32 float.$FG$
* Function with no, or just default args can be called without parentheses.
* Function with no args, or just default args can be called without parentheses.
* Default args don't have to be on the end. This code is valid:
$ID,2$$FG,2$U0 Test(I64 i=4,I64 j,I64 k=5)
{
PrintF("%X %X %X\n",i,j,k);
Print("%X %X %X\n",i,j,k);
}
Test(,3);$FG$
$ID,-2$
* A string or char constant all alone is sent to $LK,"PutS","MN:PutS"$() or $LK,"PutChar","MN:PutChar"$(). A string with args is sent to $LK,"PrintF","MN:PrintF"$(). An empty string literal signals a variable fmt_str follows.
* A char const all alone is sent to $LK,"PutChar","MN:PutChar"$(). A string with or without args is sent to $LK,"Print","MN:Print"$(). An empty string literal signals a variable fmt_str follows.
$ID,2$$FG,2$U0 Demo1(U8 drv,U8 *fmt,U8 *name,I64 age)
$ID,2$$FG,2$void Demo(char drv,char *fmt,char *name,int age)
{
PutS("Hello World!\n");
PrintF("%s age %d\n",name,age);
PrintF(fmt,name,age);
PutChar(drv);
PutChar('*');
printf("Hello World!\n");
printf("%s age %d\n",name,age);
printf(fmt,name,age);
putchar(drv);
putchar('*');
}
U0 Demo2(U8 drv,U8 *fmt,U8 *name,I64 age)
U0 Demo(U8 drv,U8 *fmt,U8 *name,I64 age)
{
"Hello World!\n";
"%s age %d\n",name,age;
@@ -56,10 +56,10 @@ $FG$$ID,-2$
* 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$
$FG,2$U0 GrPrintF(CDC *dc,I64 x,I64 y,U8 *fmt,...)
$FG,2$U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...)
{
U8 *buf=SPrintFJoin(NULL,fmt,argc,argv);
GrPutS(dc,x,y,buf);
U8 *buf=SPrintJoin(NULL,fmt,argc,argv);
GrPrint(dc,x,y,buf);
Free(buf);
}
$WW,1$$FG$$ID,-2$
@@ -76,7 +76,7 @@ $FG$$ID,-2$
* $FG,2$noreg$FG$ or $FG,2$reg$FG$ can be placed before a function local var name. You can, optionally, specify a register after the $FG,2$reg$FG$ keyword.
* $FG,2$interrupt$FG$, $FG,2$public$FG$, $FG,2$argpop$FG$ or $FG,2$noargpop$FG$ are function flags.
* $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-A,"::/TempleOS/Demo/Lectures/PageTableEntries2.CPP.Z"$.
* A $FG,2$nounusedwarn$FG$ statement will suppress an unused var warning.
@@ -108,7 +108,7 @@ $FG$$ID,-2$
* You can use $LK,"OptOn","MN:OptOn"$($LK,"OPTf_WARN_DUP_TYPES","MN:OPTf_WARN_DUP_TYPES"$) to find dup local var type statements.
* 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 {}","FF:::/TempleOS/Kernel/KEnd.CPP,#exe {"$ for an example where the date/time and compile-time prompting for cfguration data is placed into a program. The $LK,"StreamPrintF","MN:StreamPrintF"$() and $LK,"StreamPutS","MN:StreamPutS"$() place text into a src program stream following the conclusion of the $FG,2$#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 {}","FF:::/TempleOS/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","MN:StreamPrint"$() places text into a src program stream following the conclusion of the $FG,2$#exe{}$FG$ blk.
* No $FG,2$#define$FG$ functions exist (I'm not a fan)
@@ -118,12 +118,14 @@ $FG$$ID,-2$
* Can't use $FG,2$<>$FG$ with $FG,2$#include$FG$, use $FG,2$""$FG$.
* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK-A,"::/TempleOS/Doc/Dollar.TXT"$. In $FG,2$asm$FG$ or $LK,"Holy C","FI:::/TempleOS/Doc/HolyC.TXT"$ code, it also refers to the instruction's addr.
* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK-A,"::/TempleOS/Doc/Dollar.TXT"$. In $FG,2$asm$FG$ or $LK,"HolyC","FI:::/TempleOS/Doc/HolyC.TXT"$ code, it also refers to the instruction's addr.
* $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,"Adam1a.HPP","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-A,"::/TempleOS/Demo/SubIntAccess.CPP"$.
* $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-A,"::/TempleOS/Demo/ClassMeta.CPP"$ and $LK,"DocFormDo","MN:DocFormDo"$().
* There is a keyword $FG,2$lastclass$FG$ you use as a dft arg. It is set to the class name of the previous arg. See $LK,"ClassRep","MN:ClassRep"$().
* See $LK-A,"::/TempleOS/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 var ("$FG,2$...$FG$") args. The values passed in $FG,2$throw()$FG$ can be accessed from within a $FG,2$catch{}$FG$ using the $FG,2$Fs->except_argc$FG$ and $FG,2$Fs->except_argv[]$FG$ vars. 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. By convention, the first arg of $FG,2$except_argv[]$FG$ specifies the exception type num. A list of assigned exception types can be found at $LK,"EXCEPT_LOCAL","MN:EXCEPT_LOCAL"$. For a handler that will catch all excepts, you can use $LK,"CatchAll","MN:CatchAll"$().
* 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$
@@ -151,46 +153,47 @@ I32 j;
j=i=0x12345678; //Resulting i is 0x5678 but j is 0x12345678
I64 i=0x8000000000000000;
PrintF("%X\n",i>>1); //Result is 0xC000000000000000 as expected
Print("%X\n",i>>1); //Result is 0xC000000000000000 as expected
I64 u=0x8000000000000000;
PrintF("%X\n",u>>1); //Result is 0x4000000000000000 as expected
U64 u=0x8000000000000000;
Print("%X\n",u>>1); //Result is 0x4000000000000000 as expected
I32 i=0x80000000; //constant is loaded into a 64-bit register var.
PrintF("%X\n",i>>1); //Result is 0x40000000
I32 i= 0x80000000; //const is loaded into a 64-bit register var.
Print("%X\n",i>>1); //Result is 0x40000000
I32 i=-0x80000000;
PrintF("%X\n",i>>1); //Result is 0xC0000000 as expected
Print("%X\n",i>>1); //Result is 0xC0000000 as expected
$ID,-2$$FG$
$FG,5$$TX+CX,"PrintF Family"$$FG$
$FG,5$$TX+CX,"Print Family"$$FG$
$LK,"MSPrintF","MN:MSPrintF"$() is like $LK,"SPrintF","MN:SPrintF"$() but it returns a $LK+S,"MAlloc","MN:MAlloc"$ated str. It is vary handy because you don't have to worry about overflow.
$LK,"MPrint","MN:MPrint"$() is like $LK,"SPrint","MN:SPrint"$() but it returns a $LK+S,"MAlloc","MN:MAlloc"$ated str. It is vary handy because you don't have to worry about overflow.
$LK,"PutS","MN:PutS"$() doesn't print a new line.
$LK,"Auto","MN:Auto"$(U8 *fmt,...) sends text to the current task's input buffer.
$LK,"AutoStr","MN:AutoStr"$(U8 *fmt,...) sends text of an $LK,"AutoFile","FF:::/TempleOS/Doc/Glossary.TXT,AutoFile"$ to the keyboard stream of the current TASK but can also do mouse cmds.
$LK,"Auto","MN:Auto"$(U8 *fmtstr,...) sends text to the current task's input buffer.
$LK,"AutoStr","MN:AutoStr"$(U8 *fmtstr,...) sends text of an $LK,"AutoFile","FF:::/TempleOS/Doc/Glossary.TXT,AutoFile"$ to the keyboard stream of the current TASK but can also do mouse cmds.
$LK,"XTalk","MN:XTalk"$(CTask *task,U8 *fmt,...) and text to another task's input buffer.
$LK,"XTalkStr","MN:XTalkStr"$(CTask *task,U8 *fmt,...) sends text of an $LK,"AutoFile","FF:::/TempleOS/Doc/Glossary.TXT,AutoFile"$ to the keyboard stream of another TASK but can also do mouse cmds.
$LK,"XTalk","MN:XTalk"$(CTask *task,U8 *fmtstr,...) and text to another task's input buffer.
$LK,"XTalkStr","MN:XTalkStr"$(CTask *task,U8 *fmtstr,...) sends text of an $LK,"AutoFile","FF:::/TempleOS/Doc/Glossary.TXT,AutoFile"$ to the keyboard stream of another TASK but can also do mouse cmds.
$LK,"DocPrint","MN:DocPrint"$(CDoc *doc,U8 *fmt,...) sends text to a document. You can buffer to a Doc and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK-A,"::/TempleOS/Demo/Dsk/FPrintF.CPP"$.
$LK,"Adam","MN:Adam"$(U8 *fmt,...) sends text to the adam task to be compiled and run.
$LK,"AdamLog","MN:AdamLog"$(U8 *fmt,...) and $LK,"AdamErr","MN:AdamErr"$(U8 *fmt,...) send text to the adam task to be displayed.
$LK,"StreamPrint","MN:StreamPrint"$(U8 *fmt,...) sends text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk.
$LK,"GrPrint","MN:GrPrint"$(CDC *dc,I64 x,I64 y,U8 *fmt,...) and $LK,"GrVPrint","MN:GrVPrint"$() plots text in graphics mode.
$LK,"ExePrint","MN:ExePrint"$(U8 *fmt,...) compiles and execute a string. Note: It returns the result of the last executed expression.
$LK,"AFPrint","MN:AFPrint"$(I64 mS,U8 *fmt) $LK,"PutChar","MN:PutChar"$()s one at a time with a delay.
$LK,"RawPrint","MN:RawPrint"$(I64 mS,U8 *fmt) sends direct to screen memory, bypassing window manager.
$BK,1$Note:$BK,0$ Use $FG,2$Print("%s",src)$FG$ if you need an unmodified string.
$LK,"DocPutS","MN:DocPutS"$(CDoc *doc,U8 *src) and $LK,"DocPrintF","MN:DocPrintF"$(CDoc *doc,U8 *fmtstr,...) send text to a linked text file. You can buffer to a Doc and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK-A,"::/TempleOS/Demo/Dsk/FPrintF.CPP"$.
$LK,"Adam","MN:Adam"$(U8 *fmtstr,...) send text to the adam task to be compiled and run.
$LK,"AdamLog","MN:AdamLog"$(U8 *fmtstr,...) and $LK,"AdamErr","MN:AdamErr"$(U8 *fmtstr,...) send text to the adam task to be displayed.
$LK,"StreamPrintF","MN:StreamPrintF"$(U8 *fmtstr,...) and $LK,"StreamPutS","MN:StreamPutS"$(U8 *src) send text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk.
$LK,"GrPrintF","MN:GrPrintF"$(CDC *dc,I64 x,I64 y,U8 *fmtstr,...) and $LK,"GrPutS","MN:GrPutS"$(CDC *dc,I64 x,I64 y,U8 *src) plots text in graphics mode. $LK,"GrVPrintF","MN:GrVPrintF"$() and $LK,"GrVPutS","MN:GrVPutS"$() will print vertically.
$LK,"ExePrintF","MN:ExePrintF"$(U8 *fmtstr,...) and $LK,"ExePutS","MN:ExePutS"$(U8 *src) compile and execute a string. Note: It returns the result of the last executed expression.
$BK,1$Note:$BK,0$ If no $FG,2$PutS$FG$ variant is available, you can use $FG,2$PrintF("%s",src)$FG$.
$AN,"","PrintF_Codes"$The $LK,"PrintF","MN:PrintF"$() family supports extended format codes. See $LK,"SPrintFJoin","MN:SPrintFJoin"$().
$AN,"","Print_Codes"$The $LK,"Print","MN:Print"$() family supports extended format codes. See $LK,"SPrintJoin","MN:SPrintJoin"$().
$ID,2$$FG,2$%$FG$[$FG,2$-$FG$][$FG,2$0$FG$][$FG,5$width$FG$][$FG,2$.$FG,5$decimals$FG$][$FG,5$flags$FG$][$FG,2$h$FG,5$sub_fmt$FG$][$FG,5$main_fmt$FG$]
$FG,5$flags:$FG$
@@ -203,7 +206,7 @@ $FG,5$sub_fmt:$FG$
$ID,2$On date or time entries, the sub_format specifies the format. See $LK-A,"::/TempleOS/Demo/DateTime.CPP"$.
$AN,"","sub_fmt"$On $FG,2$"%n"$FG$, $FG,2$"%d"$FG$ or $FG,2$"%u"$FG$, the sub_fmt causes thousands mode.
$FG,2$"%h?n"$FG$ will pick a var exponent multiples of three unit, while $FG,2$"%h-3n"$FG$, for example, will display milli units or $FG,2$"%h6n"$FG$ will display mega units. The $FG,2$'k'$FG$ flag is always on for $FG,2$"%n"$FG$. See $LK-A,"::/TempleOS/Demo/PrintF.CPP"$.
$FG,2$"%h?n"$FG$ will pick a var exponent multiples of three unit, while $FG,2$"%h-3n"$FG$, for example, will display milli units or $FG,2$"%h6n"$FG$ will display mega units. The $FG,2$'k'$FG$ flag is always on for $FG,2$"%n"$FG$. See $LK-A,"::/TempleOS/Demo/Print.CPP"$.
$ID,-2$
* $FG,2$"%n"$FG$ will print a floating point in engineering notation, exponents being multiples of three. If it has a $FG,5$sub_fmt$FG$ code, it will display scientific units letters.
@@ -215,11 +218,11 @@ $ID,-2$
* $FG,2$"%P"$FG$ will display a PSECT expression which is good for ptrs or addresses.
* $FG,2$"%T"$FG$ and $FG,2$"%D"$FG$ will display a date or time and the format is selected with a subcode, entered after a "$FG,2$h$FG$". Example: "$FG,2$%20h1D$FG$" uses date format code "1". See $LK-A,"::/TempleOS/Demo/DateTime.CPP"$, $LK,"MSPrintFDate","MN:MSPrintFDate"$() and $LK,"MSPrintFTime","MN:MSPrintFTime"$() for subcodes.
* $FG,2$"%T"$FG$ and $FG,2$"%D"$FG$ will display a date or time and the format is selected with a subcode, entered after a "$FG,2$h$FG$". Example: "$FG,2$%20h1D$FG$" uses date format code "1". See $LK-A,"::/TempleOS/Demo/DateTime.CPP"$, $LK,"MPrintDate","MN:MPrintDate"$() and $LK,"MPrintTime","MN:MPrintTime"$() for subcodes.
* $FG,2$"%z"$FG$ will display a subentry of an enumerated list of text entries. It calls $LK+S,"LstEntryPt","MN:LstEntryPt"$(). Pass entry_num first, list second.
* $FG,2$"%z"$FG$ will display a subentry of an enumerated list of text entries. It calls $LK+S,"LstSub","MN:LstSub"$(). Pass subentry first, list second.
* $FG,2$"%Z"$FG$ will display a Define subentry. Pass entry_num first, lst_systext second.
* $FG,2$"%Z"$FG$ will display a Define subentry. Pass subentry first, lst_define second.
* $FG,2$"%Q"$FG$ will convert "\" to "\\" and quote to backslash quote. (For use in creating strs in strs.)