diff --git a/README.md b/README.md index 9ea133e1..7e2bad69 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,6 @@ Features in development include: - Added comments and documentation - HolyC -> CosmiC - System-wide renaming for clarity - - Removed shift-space mechanism - - 440Hz 'A' tuning changed to 432Hz ## Getting started @@ -44,7 +42,7 @@ Afterwards, you can make a pull request on the `master` branch. ## Background -In around November of 2019, [VoidNV](https://web.archive.org/web/20210414181948/https://github.com/VoidNV) forked [ZenithOS](https://web.archive.org/web/20200811190005/https://github.com/VoidNV/ZenithOS) from TempleOS to continue Terry's work in a direction that would make it a viable operating system while still keeping the innovative and divine-intellect ideas and design strategies intact. At first, development occurred exclusively inside a VM and ISOs were occasionally generated as official releases, but this was scrapped and restarted from scratch. [Releases of the "old" ZenithOS are currently archived on the mega.nz website.](https://mega.nz/#F!ZIEGmSRQ!qvL6Wk6THzE-dazkfT6N3Q) The repository was removed in August of 2020, and reuploaded to [ZenithOS](https://web.archive.org/web/20210630230454/https://github.com/ZenithOS/ZenithOS). The latest archived [front page](https://web.archive.org/web/20200811190005/https://github.com/VoidNV/ZenithOS/), [master.zip](https://web.archive.org/web/20200811190054/https://codeload.github.com/VoidNV/ZenithOS/zip/master), and [related links](https://web.archive.org/web/*/https://github.com/VoidNV/ZenithOS/*) can be found on archive.org. +In around November of 2019, [VoidNV](https://web.archive.org/web/20210414181948/https://github.com/VoidNV) forked [ZenithOS](https://web.archive.org/web/20200811190005/https://github.com/VoidNV/ZenithOS) from TempleOS. [Releases of pre-git ZenithOS are currently archived on the mega.nz website.](https://mega.nz/#F!ZIEGmSRQ!qvL6Wk6THzE-dazkfT6N3Q) The repository was removed in August of 2020, and reuploaded to [ZenithOS](https://web.archive.org/web/20210630230454/https://github.com/ZenithOS/ZenithOS). The latest archived [front page](https://web.archive.org/web/20200811190005/https://github.com/VoidNV/ZenithOS/), [master.zip](https://web.archive.org/web/20200811190054/https://codeload.github.com/VoidNV/ZenithOS/zip/master), and [related links](https://web.archive.org/web/*/https://github.com/VoidNV/ZenithOS/*) can be found on archive.org. In July of 2021, ZealOS was forked from ZenithOS. diff --git a/src/Compiler/BackA.CC b/src/Compiler/BackA.CC index 66c9de88..0e0dffa1 100755 --- a/src/Compiler/BackA.CC +++ b/src/Compiler/BackA.CC @@ -219,7 +219,7 @@ U0 ICSub(CIntermediateCode *tmpi, if (!swap) { op = 0x03; - ICU24(tmpi, 0xD8F748); + ICU24(tmpi, 0xD8F748); // NEG RAX } i = ICModr1(REG_RAX, t2, r2, d2); if (tmpi->ic_flags & ICF_LOCK) @@ -257,7 +257,7 @@ U0 ICSub(CIntermediateCode *tmpi, if (swap) { op = 0x03; - ICU24(tmpi, 0xD9F748); + ICU24(tmpi, 0xD9F748); // NEG U64 RCX } if (r3 > 7) i++; @@ -379,11 +379,11 @@ U0 ICMulEqu(CIntermediateCode *tmpi, I64 rip) MDF_DISP + tmpi->arg1_type_pointed_to, REG_RCX, 0, rip); r = REG_RBX; if (I8_MIN <= i <= I8_MAX) - ICU32(tmpi, i << 24 + 0xDB6B48); + ICU32(tmpi, i << 24 + 0xDB6B48); // IMUL2 U64 RBX, I8 i else { - ICU24(tmpi, 0xDB6948); - ICU32(tmpi, i); + ICU24(tmpi, 0xDB6948); // + ICU32(tmpi, i); // IMUL2 U64 RBX, U32 i } ICMov(tmpi, MDF_DISP + tmpi->arg1_type_pointed_to, REG_RCX, 0, MDF_REG + RT_I64, REG_RBX, 0, rip); } @@ -424,12 +424,12 @@ U0 ICDiv(CIntermediateCode *tmpi, I64 rip) if (tmpi->ic_class->raw_type & RTF_UNSIGNED) { ICZero(tmpi, REG_RDX); - ICU24(tmpi, 0xF1F748); + ICU24(tmpi, 0xF1F748); // DIV U64 RCX } else { - ICU16(tmpi, 0x9948); - ICU24(tmpi, 0xF9F748); + ICU16(tmpi, 0x9948); // CQO + ICU24(tmpi, 0xF9F748); // IDIV U64 RAX } ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_REG + RT_I64, REG_RAX, 0, rip); } @@ -445,12 +445,12 @@ U0 ICDivEqu(CIntermediateCode *tmpi, Bool is_mod, I64 rip) if (tmpi->ic_class->raw_type & RTF_UNSIGNED) { ICZero(tmpi, REG_RDX); - ICU24(tmpi, 0xF1F748); + ICU24(tmpi, 0xF1F748); // DIV U64 RCX } else { - ICU16(tmpi, 0x9948); - ICU24(tmpi, 0xF9F748); + ICU16(tmpi, 0x9948); // CQO + ICU24(tmpi, 0xF9F748); // IDIV U64 RAX } if (is_mod) ICMov(tmpi, tmpi->arg1.type & MDG_MASK + tmpi->arg1_type_pointed_to, @@ -468,12 +468,12 @@ U0 ICDivEqu(CIntermediateCode *tmpi, Bool is_mod, I64 rip) if (tmpi->ic_class->raw_type & RTF_UNSIGNED) { ICZero(tmpi, REG_RDX); - ICU24(tmpi, 0xF1F748); + ICU24(tmpi, 0xF1F748); // DIV U64 RCX } else { - ICU16(tmpi, 0x9948); - ICU24(tmpi, 0xF9F748); + ICU16(tmpi, 0x9948); // CQO + ICU24(tmpi, 0xF9F748); // IDIV U64 RAX } if (is_mod) ICMov(tmpi, MDF_DISP + tmpi->arg1_type_pointed_to, REG_RBX, 0, MDF_REG + RT_I64, REG_RDX, 0, rip); @@ -496,12 +496,12 @@ U0 ICMod(CIntermediateCode *tmpi, I64 rip) if (tmpi->ic_class->raw_type & RTF_UNSIGNED) { ICZero(tmpi, REG_RDX); - ICU24(tmpi, 0xF1F748); + ICU24(tmpi, 0xF1F748); // DIV U64 RCX } else { - ICU16(tmpi, 0x9948); - ICU24(tmpi, 0xF9F748); + ICU16(tmpi, 0x9948); // CQO + ICU24(tmpi, 0xF9F748); // IDIV U64 RAX } ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_REG + RT_I64, REG_RDX, 0, rip); } @@ -601,7 +601,7 @@ U0 ICAddSubEctEqu(CIntermediateCode *tmpi, U8 type_pointed_to, done = TRUE; } else if (op.u8[2] == 0x24) - {//AND + { // AND ICMov(tmpi, MDF_REG + RT_I64, REG_RCX, 0, t2, r2, d2, rip); ICMov(tmpi, MDF_REG + RT_I64, REG_RAX, 0, MDF_DISP + type_pointed_to, REG_RCX, 0, rip); res_reg = REG_RAX; @@ -613,7 +613,7 @@ U0 ICAddSubEctEqu(CIntermediateCode *tmpi, U8 type_pointed_to, done = TRUE; } else if (type_pointed_to < RT_I64) - {//OR/XOR + { // OR/XOR ICMov(tmpi, MDF_REG + RT_I64, REG_RCX, 0, t2, r2, d2, rip); ICMov(tmpi, MDF_REG + RT_I64, REG_RAX, 0, MDF_DISP + type_pointed_to, REG_RCX, 0, rip); res_reg = REG_RAX; diff --git a/src/Compiler/BackB.CC b/src/Compiler/BackB.CC index 19673779..5bd73490 100755 --- a/src/Compiler/BackB.CC +++ b/src/Compiler/BackB.CC @@ -13,7 +13,7 @@ U0 ICNot(CIntermediateCode *tmpi, I64 rip) { i = ICModr1(tmpi, tmpi->arg1.type, tmpi->arg1.reg, tmpi->arg1.disp); ICRex(tmpi, i.u8[1]); - ICU16(tmpi, i.u8[2] << 8 + 0xF6); //TEST ?,0xFF + ICU16(tmpi, i.u8[2] << 8 + 0xF6); // TEST ?, 0xFF ICModr2(tmpi, i,, tmpi->arg1.disp, rip + 1); ICU8(tmpi, 0xFF); } @@ -22,8 +22,8 @@ U0 ICNot(CIntermediateCode *tmpi, I64 rip) ICMov(tmpi, MDF_REG + RT_I64, REG_RAX, 0, tmpi->arg1.type, tmpi->arg1.reg, tmpi->arg1.disp, rip); ICTest(tmpi, REG_RAX); } - ICU24(tmpi, 0xC0940F); //SETZ AL - ICU32(tmpi, 0xC0B60F48);//MOVZX RAX,AL + ICU24(tmpi, 0xC0940F); // SETE AL + ICU32(tmpi, 0xC0B60F48);// MOVZX RAX, AL ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_REG + RT_U64, REG_RAX, 0, rip); } @@ -41,10 +41,10 @@ U0 ICAndAnd(CIntermediateCode *tmpi, I64 rip) r2 = tmpi->arg1.reg; ICZero(tmpi, REG_RAX); ICTest(tmpi, r2); - ICU16(tmpi, 0x0874); + ICU16(tmpi, 0x0874); // JE I8 0xA ICTest(tmpi, REG_RCX); - ICU16(tmpi, 0x0374); - ICU24(tmpi, 0xC0FF48); + ICU16(tmpi, 0x0374); // JE I8 0x5 + ICU24(tmpi, 0xC0FF48); // INC U64 RAX ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_REG + RT_I64, REG_RAX, 0, rip); } @@ -68,8 +68,8 @@ U0 ICOrOr(CIntermediateCode *tmpi, I64 rip) } ICZero(tmpi, REG_RAX); ICU24(tmpi, 0xC80B00 + i + r2 << 16); - ICU16(tmpi, 0x0374); - ICU24(tmpi, 0xC0FF48); + ICU16(tmpi, 0x0374); // JE I8 0x5 + ICU24(tmpi, 0xC0FF48); // INC U64 RAX ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_REG + RT_I64, REG_RAX, 0, rip); } @@ -87,15 +87,15 @@ U0 ICXorXor(CIntermediateCode *tmpi, I64 rip) r2 = tmpi->arg1.reg; ICZero(tmpi, REG_RBX); ICTest(tmpi, r2); - ICU16(tmpi, 0x0374); - ICU24(tmpi, 0xC3FF48); + ICU16(tmpi, 0x0374); // JE I8 0x5 + ICU24(tmpi, 0xC3FF48); // INC U64 RBX ICZero(tmpi, REG_RAX); ICTest(tmpi, REG_RCX); - ICU16(tmpi, 0x0374); - ICU24(tmpi, 0xC0FF48); + ICU16(tmpi, 0x0374); // JE I8 0x5 + ICU24(tmpi, 0xC0FF48); // INC U64 RAX - ICU24(tmpi, 0xC33348); + ICU24(tmpi, 0xC33348); // XOR U64 RAX, U64 RBX ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_REG + RT_I64, REG_RAX, 0, rip); } @@ -173,7 +173,7 @@ U0 ICComp(CIntermediateCode *tmpi, I64 us, I64 is, I64 rip) if (tmpi->ic_class->raw_type & RTF_UNSIGNED || tmpi->ic_flags & ICF_USE_UNSIGNED) is = us; ICU16(tmpi, 0x300 + is); - ICU24(tmpi, 0xC0FF48); + ICU24(tmpi, 0xC0FF48); // INC U64 RAX ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_REG + RT_I64, REG_RAX, 0, rip); } else @@ -211,7 +211,7 @@ U0 ICComp(CIntermediateCode *tmpi, I64 us, I64 is, I64 rip) if (tmpi->ic_class->raw_type & RTF_UNSIGNED || tmpi->ic_flags & ICF_USE_UNSIGNED) is = us; ICU16(tmpi, 0x300 + is); - ICU24(tmpi, 0xC0FF48); + ICU24(tmpi, 0xC0FF48); // INC U64 RAX ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_REG + RT_I64, REG_RAX, 0, rip); } } @@ -298,11 +298,11 @@ U0 ICBitOps(CIntermediateCode *tmpi, CICArg *arg1, CICArg *arg2, CIntermediateCo U0 ICToUpper(CIntermediateCode *tmpi, I64 rip) { ICMov(tmpi, MDF_REG + RT_I64, REG_RAX, 0, tmpi->arg1.type, tmpi->arg1.reg, tmpi->arg1.disp, rip); - ICU32(tmpi, 0x61F88348); - ICU16(tmpi, 0x0A7C); - ICU32(tmpi, 0x7AF88348); - ICU16(tmpi, 0x047F); - ICU32(tmpi, 0xE0C08348); + ICU32(tmpi, 0x61F88348); // CMP U64 RAX, I8 0x61 + ICU16(tmpi, 0x0A7C); // JL I8 0xC + ICU32(tmpi, 0x7AF88348); // CMP U64 RAX, I8 0x7A + ICU16(tmpi, 0x047F); // JG I8 0x6 + ICU32(tmpi, 0xE0C08348); // ADD U64 RAX, I8 0xE0 } U0 ICToI64(CCompCtrl *cc, CIntermediateCode *tmpi, I64 rip) @@ -327,8 +327,8 @@ U0 ICToBool(CCompCtrl *, CIntermediateCode *tmpi, I64 rip) r = REG_RAX; } ICTest(tmpi, r); - ICU24(tmpi, 0xC0950F); //SETNZ AL - ICU32(tmpi, 0xC0B60F48); //MOVZX RAX,AL + ICU24(tmpi, 0xC0950F); // SETNE AL + ICU32(tmpi, 0xC0B60F48); // MOVZX RAX, AL } U0 ICPreIncDec(CIntermediateCode *tmpi, I64 op, I64 rip) diff --git a/src/Compiler/BackC.CC b/src/Compiler/BackC.CC index c99d14d0..6ef06d72 100755 --- a/src/Compiler/BackC.CC +++ b/src/Compiler/BackC.CC @@ -863,7 +863,7 @@ U0 ICSwitch(CIntermediateCode *tmpi, I64 rip, Bool nobound, CCompCtrl *cc, U8 *b if (lb->flags & (CMF_I8_JMP_TABLE | CMF_U8_JMP_TABLE | CMF_I16_JMP_TABLE | CMF_U16_JMP_TABLE)) { - ICU16(tmpi, 0xC381); //ADD EBX,0x12345678 + ICU16(tmpi, 0xC381); // ADD EBX, 0x######## if (buf && cc->flags & CCF_AOT_COMPILE) { tmpa = CAlloc(sizeof(CAOTAbsAddr)); @@ -886,12 +886,12 @@ U0 ICSwitch(CIntermediateCode *tmpi, I64 rip, Bool nobound, CCompCtrl *cc, U8 *b U0 ICLocalVarInit(CIntermediateCode *tmpi) { - ICU24(tmpi, 0xC48B48); - ICU16(tmpi, 0x5748); - ICU24(tmpi, 0xF88B48); - ICU24(tmpi, 0xC1C748); + ICU24(tmpi, 0xC48B48); // MOV U64 RAX, U64 RSP + ICU16(tmpi, 0x5748); // PUSH U64 RDI + ICU24(tmpi, 0xF88B48); // MOV U64 RDI, U64 RAX + ICU24(tmpi, 0xC1C748); // MOV U64 RCX, I32 0x######## ICU32(tmpi, tmpi->ic_data); - ICU16(tmpi, sys_var_init_val << 8 + 0xB0); - ICU24(tmpi, 0xAA48F3); - ICU16(tmpi, 0x5F48); + ICU16(tmpi, sys_var_init_val << 8 + 0xB0); // MOV AL, sys_var_init_val + ICU24(tmpi, 0xAA48F3); // REP_STOSB + ICU16(tmpi, 0x5F48); // POP U64 RDI } diff --git a/src/Compiler/CExterns.CC b/src/Compiler/CExterns.CC index edab1fbd..93b5f910 100755 --- a/src/Compiler/CExterns.CC +++ b/src/Compiler/CExterns.CC @@ -15,8 +15,8 @@ extern I64 LexExpression(CCompCtrl *cc); extern I64 LexCharGet(CCompCtrl *cc); extern CCodeMisc *OptLabelFwd(CCodeMisc *lb); extern CIntermediateCode *OptPass012(CCompCtrl *cc); -extern U0 OptPass3(CCompCtrl *cc,COptReg *reg_offsets); -extern U0 OptPass4(CCompCtrl *cc,COptReg *reg_offsets,I64 *_type); +extern U0 OptPass3(CCompCtrl *cc, COptReg *reg_offsets); +extern U0 OptPass4(CCompCtrl *cc, COptReg *reg_offsets, I64 *_type); extern U0 OptPass5(CCompCtrl *cc); extern U0 OptPass6(CCompCtrl *cc); extern I64 OptPass789A(CCompCtrl *cc, COptReg *reg_offsets, U8 *buf, CDebugInfo **_debug); diff --git a/src/Compiler/CInit.CC b/src/Compiler/CInit.CC index 475317d7..0d630756 100755 --- a/src/Compiler/CInit.CC +++ b/src/Compiler/CInit.CC @@ -2,7 +2,7 @@ class CInternalType { - U8 type,size, name[8]; + U8 type, size, name[8]; } internal_types_table[INTERNAL_TYPES_NUM] = { {RT_I0, 0, "I0i"}, {RT_I0, 0, "I0"}, diff --git a/src/Compiler/Templates.CC b/src/Compiler/Templates.CC index 5023ef82..64064eb1 100755 --- a/src/Compiler/Templates.CC +++ b/src/Compiler/Templates.CC @@ -26,7 +26,7 @@ CMP_TEMPLATES:: MOV RBX, RSP FLD U64 [RBX] FLD U64 8[RBX] -@@20: FPREM +@@20: FPREM FSTSW TEST AX, 0x400 JNZ @@20 diff --git a/src/Demo/AcctExample/PersonalNotes.DD b/src/Demo/AcctExample/PersonalNotes.DD index daee17b2..63a76f77 100755 --- a/src/Demo/AcctExample/PersonalNotes.DD +++ b/src/Demo/AcctExample/PersonalNotes.DD @@ -463,3 +463,26 @@ $TX,"Peter Gadwa",HTML="http://www.wired.com/magazine/2010/11/mf_ticketmaster/al $TX,"Ticketmaster",HTML="http://www.nytimes.com/1994/11/06/business/ticketmaster-s-mr-tough-guy.html?pagewanted=a"$ $TX,"Tom Foley",HTML="http://web.gccaz.edu/~tfoley/perspage.html"$ $TX,"Graphic Technologies",HTML="https://web.archive.org/web/20020811060541/http://www.graphic-technologies.com/"$ + + + + + + + + + + + + + + + $SP,"<1>",BI=1$ + + + + + + + +Òœÿÿÿ#ºÿÿÿ#A#œÿÿÿºÿÿÿA         \ No newline at end of file diff --git a/src/Doc/ChangeLog.DD b/src/Doc/ChangeLog.DD index bcf84135..6e6a29ea 100755 --- a/src/Doc/ChangeLog.DD +++ b/src/Doc/ChangeLog.DD @@ -1,4 +1,7 @@ $WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$ +$IV,1$----12/09/21 03:21:03----$IV,0$ +* Revert 440Hz 'A'. + $IV,1$----12/04/21 04:16:45----$IV,0$ * Raised version number to 1.06. * Removed IDE members and padding from CBlkDev and CBlkDevGlobals, added $MA-X+PU,"ins_port",LM="Find(\"ins_port\",\"/*\");View;"$ to return install-drive recognition functionality. @@ -150,7 +153,7 @@ $IV,1$----07/23/21 16:30:23----$IV,0$ $IV,1$----07/14/21 13:12:34----$IV,0$ * Raised version number to 0.08. * Fixed non-writable drive throw when #include with F5 in $LK+PU,"DocPutKey",A="FF:::/System/DolDoc/DocPutKey.CC,SC_F5"$ and when attempting to $LK+PU,"save",A="FF:::/System/DolDoc/DocPutKey.CC,CH_CTRLS"$. -* Added top & right borders to $LK+PU,"RawDumpRegs",A="FF:::/Kernel/KDebug.CC,RawDumpRegs"$. +* Added top & right borders to $LK+PU,"RawDr",A="FF:::/Kernel/KDebug.CC,RawDumpRegs"$. * Improved spacing in some debug commands. * Fixed $LK+PU,"RawPutChar",A="MN:RawPutChar"$ and $LK+PU,"EdLite",A="MN:EdLite"$ tab width. * Fixed $LK+PU,"Ui",A="MN:Ui"$ missing "0x" prefix syntax highlighter bug. @@ -399,7 +402,7 @@ $BK,1$* Zenith 1.0 released.$BK,0$ * Renamed VGAFlush() -> $LK,"LFBFlush",A="MN:LFBFlush"$(). * Updated $LK,"Palette Demo",A="FI:::/Demo/Graphics/Palette.CC"$ to use current palette environment. * Shortened $LK,"CheckPtr",A="MN:CheckPtr"$() and $LK,"CheckCodePtr",A="MN:CheckCodePtr"$(). Even though boolean expressions outside of $HL$if$HL,0$ statements are compiled inefficiently, clarity and low line count is more important. -* $LK,"RawDumpRegs",A="MN:RawDumpRegs"$() is 40 columns off the right of the screen, instead of fixed at column 40. +* $LK,"RawDr",A="MN:RawDumpRegs"$() is 40 columns off the right of the screen, instead of fixed at column 40. * Windows start at $LK,"4/5th the screen height",A="FF:::/Kernel/KTask.CC,text.rows"$ instead of row 13. System task window is $LK,"1/5th the screen height",A="FF:::/StartOS.CC,text.rows"$. * $LK,"R",A="MN:R"$("RLf_VGA", "$LK,"RLf_VESA",A="MN:RLf_VESA"$"); * Removed VGA text mode support, and all definitions relating to it, including from the $LK,"kernel config",A="FI:::/Kernel/KConfig.CC"$. diff --git a/src/Doc/Welcome.DD b/src/Doc/Welcome.DD index 8a0af909..a8434f24 100755 --- a/src/Doc/Welcome.DD +++ b/src/Doc/Welcome.DD @@ -7,7 +7,7 @@ $ID,2$* Professionals doing hobby projects * Teenagers doing projects * Non-professional, older-persons projects $ID,-2$ -Simplicity is a goal to $LK,"keep the line count down",A="FI:::/Doc/Strategy.DD"$, so it's easy to tinker with. As it turns-out, simplicity makes it faster in some ways, too. It never switches privilege levels, never changes address maps, tends to load whole contiguous files and other, similar things which boost speed. It's only $TX,"94,780",D="DD_ZEALOS_LOC"$ lines of code including the kernel, the 64-bit compiler, the graphics library and all the tools. More importantly, it's designed to keep the user's line count down -- you can do a $LK,"Hello World",A="FI:::/Doc/HelloWorld.DD"$ application in one line of code and can put graphics on the screen with a three line program! +Simplicity is a goal to $LK,"keep the line count down",A="FI:::/Doc/Strategy.DD"$, so it's easy to tinker with. As it turns-out, simplicity makes it faster in some ways, too. It never switches privilege levels, never changes address maps, tends to load whole contiguous files and other, similar things which boost speed. It's only $TX,"95,255",D="DD_ZEALOS_LOC"$ lines of code including the kernel, the 64-bit compiler, the graphics library and all the tools. More importantly, it's designed to keep the user's line count down -- you can do a $LK,"Hello World",A="FI:::/Doc/HelloWorld.DD"$ application in one line of code and can put graphics on the screen with a three line program! It's a kayak, not a Titanic -- it will crash if you do something wrong. You quickly reboot, however. DOS and the 8-bit home computers of the 80's worked fine without memory protection and most computers in the world -- the embedded ones -- operate without protection. The resulting simplicity of no protections is why ZealOS has value. In facts, that's the point of ZealOS. See the $LK,"ZealOS Charter",A="FI:::/Doc/Charter.DD"$. @@ -67,7 +67,7 @@ $FG$He didn't like that, so he made parentheses optional on calls with no args a >$FG,2$Dir;$FG$ -The syntax change created an ambiguity when specifying function addresses, like for calling $LK,"QuickSort",A="MN:QuickSort"$(). To resolve it, I made a '$FG,2$&$FG$' required in front of function names when specifying an address of a function, which is better anyway. +The syntax change created an ambiguity when specifying function addresses, like for calling $LK,"QuickSort",A="MN:QuickSort"$(). To resolve it, he made a '$FG,2$&$FG$' required in front of function names when specifying an address of a function, which is better anyway. Once Terry was no longer using standard C/C++ syntax, he decided to change everything he didn't like and call it $LK,"HolyC",A="FI:::/Doc/CosmiC.DD"$. Here are the new $LK,"operator precedence",A="FF:::/Doc/CosmiC.DD,operator precedence"$ rules. It's Biblical! See $LK,"Luke 5:37",A="BF:Luke,5:37"$. diff --git a/src/Kernel/KMisc.CC b/src/Kernel/KMisc.CC index b4f75055..1f7435f6 100755 --- a/src/Kernel/KMisc.CC +++ b/src/Kernel/KMisc.CC @@ -111,17 +111,17 @@ U0 Sleep(I64 mS) } F64 Ona2Freq(I8 ona) -{//Ona to freq. Ona=60 is 432.0Hz. +{//Ona to freq. Ona=60 is 440.0Hz. if (!ona) return 0; else - return 432.0 / 32 * 2.0 ` (ona / 12.0); + return 440.0 / 32 * 2.0 ` (ona / 12.0); } I8 Freq2Ona(F64 freq) -{//Freq to Ona. 432.0Hz is Ona=60. +{//Freq to Ona. 440.0Hz is Ona=60. if (freq > 0) - return ClampI64(12 * Log2(32.0 / 432.0 * freq), 1, I8_MAX); + return ClampI64(12 * Log2(32.0 / 440.0 * freq), 1, I8_MAX); else return 0; } diff --git a/src/System/Define.CC b/src/System/Define.CC index dc5b20fc..31a0002f 100755 --- a/src/System/Define.CC +++ b/src/System/Define.CC @@ -15,7 +15,7 @@ U0 LoadDocDefines() //$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/System/Boot/BootDVD.CC,DD_BOOT_HIGH_LOC_DVD"$ $TR,"LineRep"$ -$ID,2$DefinePrint("DD_ZEALOS_LOC","95,255"); +$ID,2$DefinePrint("DD_ZEALOS_LOC","95,265"); $ID,-2$ DefinePrint("DD_MP_VECT", "%08X", MP_VECT_ADDR); DefinePrint("DD_MP_VECT_END", "%08X", MP_VECT_ADDR + COREAP_16BIT_INIT_END - COREAP_16BIT_INIT - 1); diff --git a/src/System/Utils/DocUtils.CC b/src/System/Utils/DocUtils.CC index 8ff0863f..6d48508b 100755 --- a/src/System/Utils/DocUtils.CC +++ b/src/System/Utils/DocUtils.CC @@ -7,6 +7,7 @@ U0 CursorRemFile(U8 *filename) DocWrite(doc); DocDel(doc); } + public U0 CursorRemove(U8 *files_find_mask="*") {//Remove ASCII 5 cursor. I64 fuf_flags = 0; @@ -32,6 +33,7 @@ U0 CollapseFile(U8 *filename, Bool collapse=TRUE) DocWrite(doc); DocDel(doc); } + public U0 Collapse(U8 *files_find_mask="*", Bool collapse=TRUE, U8 *fu_flags=NULL) {//Collapse $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ trees. I64 fuf_flags = 0; @@ -74,6 +76,7 @@ I64 DocOptEntry(CDoc *,CDocEntry *doc_e) return res; } + I64 DocOptDoc(CDoc *doc) {//Optimize Doc. Bool unlock = DocLock(doc); @@ -104,6 +107,7 @@ I64 DocOptDoc(CDoc *doc) return res; } + I64 DocOptFile(U8 *filename) {//Optimize file. I64 res; @@ -118,6 +122,7 @@ I64 DocOptFile(U8 *filename) return res; } + I64 DocOptList(CDirEntry *tmpde) { I64 res = 0; @@ -142,6 +147,7 @@ I64 DocOptList(CDirEntry *tmpde) return res; } + public I64 DocOpt(U8 *files_find_mask="*", U8 *fu_flags=NULL) {//Optimize $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ files, eliminating aux_str's and .Z's. //+R flag for aggressively risky. diff --git a/src/System/Utils/LineRep.CC b/src/System/Utils/LineRep.CC index 0574b1cf..686e0a8c 100755 --- a/src/System/Utils/LineRep.CC +++ b/src/System/Utils/LineRep.CC @@ -24,6 +24,7 @@ I64 LineRep1(CDirEntry *tmpde) return res; } + U0 LineRep2(CDoc *doc, CDirEntry *tmpde) { while (tmpde) @@ -39,6 +40,7 @@ U0 LineRep2(CDoc *doc, CDirEntry *tmpde) tmpde = tmpde->next; } } + public I64 LineRep(U8 *files_find_mask="/*", U8 *fu_flags=NULL) {//Source line-of-code count report. I64 fuf_flags = 0, res = 0; @@ -79,6 +81,7 @@ I64 SizeRep1(CDirEntry *tmpde) return res; } + U0 SizeRep2(CDoc *doc,CDirEntry *tmpde) { while (tmpde) @@ -97,6 +100,7 @@ U0 SizeRep2(CDoc *doc,CDirEntry *tmpde) tmpde = tmpde->next; } } + public I64 SizeRep(U8 *files_find_mask="/*", U8 *fu_flags=NONE) {//Report file sizes. I64 fuf_flags = 0, res = 0;