TempleOSCDV4.11.ISO
This commit is contained in:
1 parent
9206246147
commit
93ca216483
662 files changed
+6431
-7369
No files matched your search
@@ -76,7 +76,7 @@ ANSWERS:
|
||||
|
||||
8) To call a subroutine farther than 2 Gig away, you put the address into RAX, then CALL RAX.
|
||||
|
||||
9) CALL REL32 is significantly faster. See $LK,"::/Demo/Lectures/InterruptDemo.CPP"$.
|
||||
9) CALL REL32 is significantly faster. See $LK,"::/Demo/Lectures/InterruptDemo.HC"$.
|
||||
|
||||
10) IN or OUT instructions happen at a fixed speed based on the original ISA bus clock.
|
||||
|
||||
File renamed without changes.
@@ -12,11 +12,11 @@ It's a little better.
|
||||
I often use 64-bit ints with upper 32-bits
|
||||
as int and lower 32-bits as fraction.
|
||||
|
||||
See $LK,"::/Demo/SubIntAccess.CPP"$ for how
|
||||
See $LK,"::/Demo/SubIntAccess.HC"$ for how
|
||||
to access upper or lower 32-bits.
|
||||
|
||||
For a complete lst of nonstandard compiler
|
||||
features, see $LK,"::/Doc/HolyC.TXT"$.
|
||||
features, see $LK,"::/Doc/HolyC.DD"$.
|
||||
|
||||
*/
|
||||
|
||||
@@ -71,7 +71,7 @@ place i into a reg, so there is a
|
||||
penalty.
|
||||
|
||||
For a complete lst of nonstandard compiler
|
||||
features, see $LK,"::/Doc/HolyC.TXT"$.
|
||||
features, see $LK,"::/Doc/HolyC.DD"$.
|
||||
*/
|
||||
|
||||
"i.u32[0] =%X\n",i.u32[0];
|
||||
@@ -82,7 +82,7 @@ CPURep;
|
||||
Main;
|
||||
DoIt2;
|
||||
|
||||
//See $LK,"::/Demo/Lectures/FixedPointAdvanced.CPP"$
|
||||
//See $LK,"::/Demo/Lectures/FixedPointAdvanced.HC"$
|
||||
|
||||
/*Program Output$HL,0$$WW+H,1$$FD,1$
|
||||
|
||||
@@ -11,7 +11,7 @@ and my compiler used to do floats poorly.
|
||||
I often use 64-bit ints with upper 32-bits
|
||||
as int and lower 32-bits as fraction.
|
||||
|
||||
See $LK,"::/Demo/SubIntAccess.CPP"$ for how
|
||||
See $LK,"::/Demo/SubIntAccess.HC"$ for how
|
||||
to access upper or lower 32-bits.
|
||||
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
//This is the fastest you can update the whole screen.
|
||||
//See $LK,"::/Demo/Lectures/MiniGrLib.CPP"$ if this interests you.
|
||||
//See $LK,"::/Demo/Lectures/MiniGrLib.HC"$ if this interests you.
|
||||
|
||||
F64 VGAPattern(I64 p)
|
||||
{//This returns the time to update in seconds.
|
||||
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
//This file is required by $LK,"::/Demo/Lectures/Mem/Uncached.CPP"$.
|
||||
//This file is required by $LK,"::/Demo/Lectures/Mem/Uncached.HC"$.
|
||||
|
||||
U8 *Mem2MegAlloc(I64 *_pages2Meg,CBlkPool *bp=NULL)
|
||||
{/*Alloc 2Meg pages from BlkPool. Don't link to task.
|
||||
@@ -198,5 +198,5 @@ CHeapCtrl *HeapCtrlBPInit(CBlkPool *bp,I64 pages512)
|
||||
|
||||
/* PCI hardware devices, when they require uncached memory buffers, need
|
||||
this code. TempleOS, however, has a law requiring only IN/OUT port hardware
|
||||
access except VGA, handled here: $LK,"::/Kernel/Mem/PageTables.CPP"$.
|
||||
access except VGA, handled here: $LK,"::/Kernel/Mem/PageTables.HC"$.
|
||||
*/
|
||||
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
// Requires $LK,"::/Demo/Lectures/Mem/Mem2Meg.CPP"$.
|
||||
// Requires $LK,"::/Demo/Lectures/Mem/Mem2Meg.HC"$.
|
||||
|
||||
Cd(__DIR__);;
|
||||
#include "Mem2Meg"
|
||||
@@ -2,11 +2,11 @@
|
||||
$TR-C,"Main Compiler"$
|
||||
$ID,2$The mini compiler is like the main compiler, except the main compiler's lexical analyser removes comments and does preprocessing. $LK,"Lex",A="MN:Lex"$(),$LK,"Echo",A="MN:Echo"$(ON).
|
||||
|
||||
The main compiler generates $LK,"Intermediate Code",A="FF:::/Compiler/CompilerA.HPP,IC_END"$ at the parser stage. See $LK,"PrsExpression",A="MN:PrsExpression"$(), $LK,"PrsStmt",A="MN:PrsStmt"$().
|
||||
The main compiler generates $LK,"Intermediate Code",A="FF:::/Compiler/CompilerA.HH,IC_END"$ at the parser stage. See $LK,"PrsExpression",A="MN:PrsExpression"$(), $LK,"PrsStmt",A="MN:PrsStmt"$().
|
||||
|
||||
The main compiler optimizes See $LK,"Intermediate Code Attributes",A="MN:intermediate_code_table"$, $LK,"Combining Consts",A="FF:::/Compiler/OptPass012.CPP,case IC_MUL"$, $LK,"Choosing Reg Vars",A="FF:::/Compiler/OptPass3.CPP,cmp.num_reg_vars"$. Use $LK,"PassTrace",A="MN:PassTrace"$() to see the optimization stages.
|
||||
The main compiler optimizes See $LK,"Intermediate Code Attributes",A="MN:intermediate_code_table"$, $LK,"Combining Consts",A="FF:::/Compiler/OptPass012.HC,case IC_MUL"$, $LK,"Choosing Reg Vars",A="FF:::/Compiler/OptPass3.HC,cmp.num_reg_vars"$. Use $LK,"PassTrace",A="MN:PassTrace"$() to see the optimization stages.
|
||||
|
||||
The main compiler makes machine code in the back end. See $LK,"IC Struct",A="MN:CIntermediateCode"$, $LK,"COCCompile",A="MN:COCCompile"$ and $LK,"OptPass789A",A="FF:::/Compiler/OptPass789A.CPP,IC_MUL"$(), $LK,"BackEnd",A="FF:::/Compiler/BackA.CPP,ICMul"$. Set $LK,"Trace",A="MN:Trace"$(ON) to see the output of the backend.
|
||||
The main compiler makes machine code in the back end. See $LK,"IC Struct",A="MN:CIntermediateCode"$, $LK,"COCCompile",A="MN:COCCompile"$ and $LK,"OptPass789A",A="FF:::/Compiler/OptPass789A.HC,IC_MUL"$(), $LK,"BackEnd",A="FF:::/Compiler/BackA.HC,ICMul"$. Set $LK,"Trace",A="MN:Trace"$(ON) to see the output of the backend.
|
||||
$ID,-2$
|
||||
$TR,"Mini Compiler"$
|
||||
$ID,2$For this mini compiler, some things you should know about 64-bit asm:
|
||||
@@ -112,7 +112,7 @@ U0 PrsTerm(U8 **_src,U8 **_dst,I64 prec)
|
||||
|
||||
I64 Parse(U8 **_src,U8 **_dst)
|
||||
{//See $LK,"PrsExpression",A="MN:PrsExpression"$().
|
||||
//See $LK,"Opcode Fmts",A="FF:::/Compiler/OpCodes.TXT,IDIV"$ for details on asm insts.
|
||||
//See $LK,"Opcode Fmts",A="FF:::/Compiler/OpCodes.DD,IDIV"$ for details on asm insts.
|
||||
I64 i;
|
||||
U8 *dst=*_dst;
|
||||
switch (Lex(_src,&i)) {
|
||||
@@ -216,8 +216,8 @@ U0 Main()
|
||||
throw;
|
||||
"$$RED$$This code is not efficient, but the compiler is simple.$$FG$$\n";
|
||||
Un(code,dst-code); //Unassemble the code we created.
|
||||
//$LK,"Call",A="MN:Call"$() is a function. See $LK,"_CALL",A="FF:::/Kernel/KUtils.CPP,_CALL"$::
|
||||
//See also $LK,"CallInd",A="MN:CallInd"$(). See $LK,"_CALL_IND",A="FF:::/Kernel/KUtils.CPP,_CALL_IND"$::
|
||||
//$LK,"Call",A="MN:Call"$() is a function. See $LK,"_CALL",A="FF:::/Kernel/KUtils.HC,_CALL"$::
|
||||
//See also $LK,"CallInd",A="MN:CallInd"$(). See $LK,"_CALL_IND",A="FF:::/Kernel/KUtils.HC,_CALL_IND"$::
|
||||
"$$LTBLUE$$Answer:%d$$FG$$\n",Call(code);
|
||||
} catch {
|
||||
"$$RED$$Error$$FG$$\n";
|
||||
@@ -1,4 +1,4 @@
|
||||
//See $LK,"::/Demo/Lectures/GraphicsCPULoad.CPP"$
|
||||
//See $LK,"::/Demo/Lectures/GraphicsCPULoad.HC"$
|
||||
U8 rev[256], //The VGA bits are bwd
|
||||
|
||||
image[640*480/8]; //We need read-modify write.
|
||||
@@ -128,5 +128,5 @@ This bit tells TempleOS to update whole screen.
|
||||
MiniGrLibDemo;
|
||||
|
||||
//See $LK,"RawPutChar",A="MN:RawPutChar"$() for text.
|
||||
//See $LK,"::/Demo/Lectures/ScreenMemory.CPP"$ for color.
|
||||
//See $LK,"::/Demo/Lectures/GraphicsCPULoad.CPP"$.
|
||||
//See $LK,"::/Demo/Lectures/ScreenMemory.HC"$ for color.
|
||||
//See $LK,"::/Demo/Lectures/GraphicsCPULoad.HC"$.
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
/*TempleOS runs exclusively in ring 0.
|
||||
Ring 0 is part of the $LK,"Charter",A="FI:::/Doc/Charter.TXT"$.
|
||||
Ring 0 is part of the $LK,"Charter",A="FI:::/Doc/Charter.DD"$.
|
||||
This demo is for you to play around
|
||||
with ring 3. TempleOS is for
|
||||
recreational programming, after all.
|
||||
@@ -1,5 +1,5 @@
|
||||
//This just shows how screen memory works.
|
||||
//See $LK,"::/Demo/Lectures/MiniGrLib.CPP"$
|
||||
//See $LK,"::/Demo/Lectures/MiniGrLib.HC"$
|
||||
|
||||
U0 PlotXY(I64 x,I64 y)
|
||||
{
|
||||
@@ -45,5 +45,5 @@ That means no read-modify-writes, too.
|
||||
|
||||
Main;
|
||||
|
||||
//See $LK,"::/Demo/Lectures/GraphicsCPULoad.CPP"$.
|
||||
//See $LK,"::/Demo/Lectures/GraphicsCPULoad.HC"$.
|
||||
|
||||
Reference in new issue
Block a user