LTCD_070816.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:45:20 +02:00
1 parent d14bbc24f9
commit 0e9364ff4c
506 files changed
+157705 -41812

No files matched your search

Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
$WW,1$$FG,2$Bt$FG$: Bit Test
$FG,2$Bts$FG$: Bit Test and Set to one
$FG,2$Btr$FG$: Bit Test and Reset to zero
$FG,2$Btc$FG$: Bit Test and Compliment (toggle)
$FG$These bit test operations are "atomic" meaning they won't be interrupted between the testing of the bit and the alteration. This is important when multitasking. With multiprocessing, you should "Lock" these operations.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+38
View File
@@ -0,0 +1,38 @@
$WW,1$See $LK,"::/LT/Doc/Dollar.TXZ","FI:::/LT/Doc/Dollar.TXZ"$ for details on dollar sign cmds.
$FG,2$"Expression"$FG$ a number or C+ algebraic term with operators and C+ symbols can be entered.
$FG,2$"Macro"$FG$ Most entries can behave like macro entries if you assign them macro strs.
$FG,2$"AutoStr"$FG$ Like a macro except it is an $LK,"AutoFile","FF:::/LT/Doc/OSGlossary.GLZ,AutoFile"$. You cannot have both an autostr and macro text defined.
$FG,5$Displayed Text$FG$ is the text that will be displayed for the item. For links, you can leave it blank and the details of the link will be shown.
$FG,5$Hide$FG$ means display nothing, making an entry invisible.
$FG,5$Left X$FG$ relative to the left margin.
$FG,5$Center X$FG$ relative to the horizontal center of the window.
$FG,5$Right X$FG$ relative to the right margin.
$FG,5$Top Y$FG$ relative to the top of the window.
$FG,5$Center Y$FG$ relative to the vertical center of the window.
$FG$$FG,5$Bottom Y$FG$ relative to the bottom of the window.
$FG,5$Blink$FG$ make the text blink.
$FG,5$Invert$FG$ make the text inverted.
$FG,5$Underline$FG$ make the text underlined.
$FG,5$Scroll X Length Expression$FG$ if a value is entered, the text will scroll in an area of this width.
$FG,5$Y Offset Expression$FG$ if a value is entered, the text will be shifted vertically by this many pixels, so you can make superscripts or subscripts.
$FG,5$X Offset Expression$FG$ if a value is entered, the text will be shifted horizontally by this many pixels.
$FG,5$Tree$FG$ The item will behave like a tree widget, with this as the adam.
$FG,5$Collapsed$FG$ The tree or hidden widget will begin collapsed.
$FG,5$Alias$FG$ For tree entries, the text of the subentry the cursor is on will appear here. This is for drop-down lists.
$FG,5$Quote$FG$ Make the result suitable for including in a program, in quotes, especially $FG,4$format_str$FG$ entries in class definitions.
$FG,5$X Expression$FG$ For cursor movements, this is the horizontal value.
$FG,5$Y Expression$FG$ For cursor movements, this is the vertical value.
$FG,5$$BK,1$PopUp$BK,0$$FG$ For macro's, run the macro in a PopUp window. Do this when making a macro to run a program, so it doesn't tie-up memory.
$FG,5$Escape$FG$ For macro's, send an $FG,2$ESC$FG$ char to exit before running the macro. Without this, the macro runs in the wrong window, usually.
$FG,5$Refresh Data$FG$ For entries in programs where values are prompted, this flag updates the entry continuously.
+5
View File
@@ -0,0 +1,5 @@
$WW,1$* You can adjust the mouse movement rate by setting global variables in your start-up file. See $LK,"mouse_scale","FA:HOME/Adam3.APZ,mouse_move_scale"$.
* You can set your local time zone by setting the $LK,"local_time_offset","MN:local_time_offset"$ global variable in a start-up file. It's units are $LK,"LTDATE_FREQ","MN:LTDATE_FREQ"$. See $LK,"local time","FF:HOME/Adam3.APZ,local_time"$.
+92
View File
@@ -0,0 +1,92 @@
$WW,1$$FG,5$$TX+CX,"Departures from C/C++:"$$FG$
* Built-in types include $FG,2$I0,I1,I2,I4,I8$FG$ for signed ints and $FG,2$U0,U1,U2,U4,U8$FG$ for unsigned ints and $FG,2$double$FG$.
* The "$FG,2$`$FG$" operator raises a base to a power.
* Operator Precidence
1) $FG,2$`$FG$,$FG,2$>>$FG$,$FG,2$<<$FG$
2) $FG,2$*$FG$,$FG,2$/$FG$,$FG,2$%$FG$
3) $FG,2$&$FG$
4) $FG,2$|$FG$,$FG,2$^$FG$
5) $FG,2$+$FG$,$FG,2$-$FG$
6) $FG,2$==$FG$,$FG,2$!=$FG$,$FG,2$<$FG$,$FG,2$>$FG$,$FG,2$<=$FG$,$FG,2$>=$FG$
7) $FG,2$&&$FG$
8) $FG,2$||$FG$,$FG,2$^^$FG$
9) $FG,2$:$FG$,$FG,2$?$FG$
10) $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$
* Allows "$FG,2$5<i<j<20$FG$" instead of "$FG,2$5<i && i<j && j<20$FG$".
* With the $FG,2$#exe{}$FG$ feature in your source code, you can place programs that insert text into the stream of code being compiled. See $LK,"#exe {}","FF:::/LT/OSMain/OSEnd.CPZ,#exe {"$ for an example where the date/time and compile-time prompting for configuration data is placed into a program. The $LK,"ExePrintF","MN:ExePrintF"$() and $LK,"ExePutS","MN:ExePutS"$() place text into a source program stream following the conclusion of the $FG,2$#exe{}$FG$ blk.
* No "$FG,2$#define$FG$" functions exist (I'm not a fan)
* Pointer arithmetic is not based on size of objects (I'd have no objections to this changing)
* No type-checking
* Variable parameter cnts ($FG,2$...$FG$) are accessed with "$FG,2$argc$FG$" and "$FG,2$argv[]$FG$" which are predefined invisible local variable.
* "$FG,2$cout$FG$" works with commas but not "$FG,2$<<$FG$" and has no "$FG,2$endl$FG$" or other codes. Use "$FG,2$coutln$FG$" to print a carriage return after other stuff. An alias for "$FG,2$cout$FG$" is "$FG,2$dbgo$FG$" or "$FG,2$dbgoln$FG$" and is useful for debugging--I often place debug output all over the place and do a $LK,"Grep","MN:Grep"$() to locate them all.
* Type casting is done with "$FG,2$><(classname)$FG$" and is postfix.
* When dealing with function addresses, precede the name with "$FG,2$&$FG$". With this syntax change, a function name by itself can be used as a call like a Pascal procedure with no "()" if there are no parameters or there are just default parameters.
* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK,"::/LT/Doc/Dollar.TXZ","FI:::/LT/Doc/Dollar.TXZ"$.
* There is not a "$FG,2$struct$FG$" keyword, just "$FG,2$class$FG$".
* "$FG,2$union$FG$" is more like a class, so you don't referrence it with a "$FG,2$union$FG$" label after you define it. Some common unions are declared in $LK,"AdamK.HPZ","MN:U2"$ 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.
* You cannot declare instances of "$FG,2$class$FG$es" or "$FG,2$unions$FG$" in the same statement where they are defined.
* $FG,2$class$FG$ member vars have two keywords for associating data with member vars -- "$FG,2$fmtstr$FG$" and "$FG,2$fmtdata$FG$". All compiler structures are saved and you can access the compiler's info about classes and variables. In the future, I hope to have arbitrary named data items on class definitions.
* "$FG,2$static$FG$" variables in functions are not allowed and I have no plans for doing them--just use a global variable.
* See $LK,"::/LT/Demo/Exceptions.CPZ","FI:::/LT/Demo/Exceptions.CPZ"$. "$FG,2$try{} catch{}$FG$ and $FG,2$throw$FG$" are different from C++. "$FG,2$throw$FG$" is a function with variable ("$FG,2$...$FG$") parameters. 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$" variables. 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 parameter of $FG,2$except_argv[]$FG$ specifies the exception type number. 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 variables. That is, you cannot do $FG,2$sizeof(classname.membername.submembername)$FG$.$FG$
* There is a function called $LK,"MSize","MN:MSize"$() which gives the size of an object allocated 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.
* You can $LK,"Free","MN:Free"$() a $FG,2$NULL$FG$ pointer. Useful variants of $LK,"MAlloc","MN:MAlloc"$() can be found $LK,"Here","MN:MAllocZ"$. Each task has a heap and you can $FG,2$MAlloc$FG$ and $FG,2$Free$FG$ off of other task's heaps.
$FG,5$$TX+CX,"PrintF Family"$$FG$
$AN,"","PrintF_Codes"$
$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,"Auto","MN:Auto"$(I1 *src,...) and text to the current task's input buffer.
$LK,"AutoStr","MN:AutoStr"$(I1 *src,...) sends text of an $LK,"AutoFile","FF:::/LT/Doc/OSGlossary.GLZ,AutoFile"$ to the keyboard stream of the current TASK but can also do mouse commands.
$LK,"XTalk","MN:XTalk"$(TssStruct *tss,I1 *src,...) and text to another task's input buffer.
$LK,"XTalkStr","MN:XTalkStr"$(TssStruct *tss,I1 *src,...) sends text of an $LK,"AutoFile","FF:::/LT/Doc/OSGlossary.GLZ,AutoFile"$ to the keyboard stream of another TASK but can also do mouse commands.
$LK,"LtfPutSExt","MN:LtfPutSExt"$(Ltf *l,I1 *src) and $LK,"LtfPrintF","MN:LtfPrintF"$(Ltf *l,I1 *src,...) send text to a linked text file. You can buffer to a Ltf and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK,"::/LT/Demo/FPrintF.CPZ","FI:::/LT/Demo/FPrintF.CPZ"$.
$LK,"Adam","MN:Adam"$(I1 *src,...) send text to the adam task to be compiled and run.
$LK,"AdamLog","MN:AdamLog"$(I1 *src,...) and $LK,"AdamErr","MN:AdamErr"$(I1 *src,...) send text to the adam task to be displayed.
$LK,"Lpt1PrintF","MN:Lpt1PrintF"$(I1 *src,...) send text to the printer port.
$LK,"ExePrintF","MN:ExePrintF"$(I1 *src,...) and $LK,"ExePutS","MN:ExePutS"$(I1 *src) send text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk.
$BK,1$Note:$BK,0$ If no $FG,2$PutS$FG$ variant is available, you can use $FG,2$PrintF("%s",src)$FG$.
The $LK,"PrintF","MN:PrintF"$() family supports extended format codes.
* $FG,2$"%n"$FG$ will print a floating point in scientific notation.
* $FG,2$"%S"$FG$ will print a systext entry.
* $FG,2$"%C"$FG$ will print a ToUpper character.
* $FG,2$"%F"$FG$ will print a text file.
* $FG,2$"t"$FG$ is a flag which will truncate to field width.
* $FG,2$"%P"$FG$ will display a PSECT expression which is good for pointers 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,"MSPrintFDate","MN:MSPrintFDate"$() and $LK,"MSPrintFTime","MN:MSPrintFTime"$() for subcodes.
* $FG,2$"%z"$FG$ will display a sub entry of an enumerated list of text entries. It calls $LK+S,"PointAtListEntry","MN:PointAtListEntry"$().
* $FG,2$"%Z"$FG$ will display a SysText sub entry.
* $FG,2$"%Q"$FG$ will convert "\" to "\\" and quote to backslash quote. (For use in creating strs in strs.)
* $FG,2$"%q"$FG$ will reverse a $FG,2$"%Q"$FG$.
+159
View File
@@ -0,0 +1,159 @@
$WW,1$$FG,5$$TX+CX,"Dollar Sign Cmds"$$FG$
LoseThos supports rich-text type commands which are bracketed with "$$". Use CTRL-L to experiment with them. Use CTRL-T to toggle between plain text and rich text.
The format of "$$" commands includes a two character code, +/-flags, a comma and parameters separated by commas. The flags often determine how many and what parameters the command takes.
See $LK,"::/LT/Doc/CtrlL.MUZ","FI:::/LT/Doc/CtrlL.MUZ"$.
See $LK,"Ltf Type Defines","MN:LTFT_TEXT"$ and $LK,"Ltf Type Codes","FF:::/LT/OSMain/SysText.CPZ,ST_LTF_CMDS"$
$TR,"TX Text"$
$ID,2$Normally, text is not bracketed with "$$", but if you wish to specify flag attributes to center text, you can bracket them with "$$" and enter flags such as "$FG,4$+CX$FG$". You cannot edit them if they are bracketed by "$$" unless you toggle to plain text mode with CTRL-T.
$ID,-2$$TR,"CR Hard Carriage Return"$
$ID,2$Carriage returns are normally specified without being bracketed with "$$".
$ID,-2$$TR,"SR Soft Carriage Return"$
$ID,2$Word wrap uses soft carriage returns which are not saved. You never place soft carriage returns by yourself.
$ID,-2$$TR,"TB Tab"$
$ID,2$Tabs are normally not bracketed with "$$", but are stored as ASCII#9.
$ID,-2$$TR,"CU Cursor position"$
$ID,2$The cursor position is usually stored as a ASCII#5 I1acter and is not bracketed with "$$". You do not normally enter cursor position commands yourself.
$ID,-2$$TR,"ID Indent +/- number"$
$ID,2$This changes the indention deeper if positive or shallower if negative. It effects the behavior of trees.
$ID,-2$$TR,"DA Data"$
$ID,2$This is primarily used for forms that prompt for data. Use CTRL-L as a resource editor-type thing to generate the text you'll need in your "fmtdata" command in a struct. If you add it directly with LtfPutSExt, you'll need to fill-in the data address. See $LK,"DoForm","MN:DoForm"$().
$ID,-2$$TR,"Text Colors"$
$ID,2$You place an expression(usually a color define--see $LK,"color defines","MN:BLACK"$) to indicate which of the 16 colors to use. If you enter no number, color returns to the default.
$FG,5$FG Foreground Color$FG$
$FG,5$BG Background Color$FG$
$FG,5$FD Default Foreground Color$FG$
$FG,5$BD Default Background Color$FG$
$FG,5$FL Foreground of Link Color$FG$
$FG,5$BL Background of Link Color$FG$
$FG,5$FM Foreground of Macro/Menu-Value Color$FG$
$FG,5$BM Background of Macro/Menu-Value Color$FG$
$FG,5$FA Foreground of Anchor Color$FG$
$FG,5$BA Background of Anchor Color$FG$
$FG,5$FH Foreground of Hidden widget Color$FG$
$FG,5$BH Background of Hidden widget Color$FG$
$FG,5$FE Foreground of Tree Color$FG$
$FG,5$BE Background of Tree Color$FG$
$ID,-2$$TR,"FU,BU User Prompts"$
$ID,2$These are special color changing commands. They are used when the user is prompted for text at the command line. They reset the cursor position if the cursor is positioned before them on the line. They are also used to indicate the start of a prompted str.
$ID,-2$$TR,"CL clear"$
$ID,2$Clear all entries except ones with hold($FG,4$+H$FG$) flags. This is good for programs which update data to the command line. It keeps the quantity of ltf entries down.
$ID,-2$$TR,"WW Word Wrap"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"UL Underline"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"IV Invert"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"BK Blink"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"SX Shift X position"$
$ID,2$* Include a number from -16 to 15.
* Only foreground is shifted.
* Positive right.
* For negative be sure to precede with a comma.
$ID,-2$$TR,"SY Shift Y position"$
$ID,2$* Include a number from -16 to 15.
* Only foreground is shifted.
* Positive down.
* For negative be sure to precede with a comma.
$ID,-2$$TR,"CM Cursor Movement"$
$ID,2$
$ID,-2$$TR,"AN Anchor"$
$ID,2$
$ID,-2$$TR,"LK Link"$
$ID,2$By default, links have a separate display text from link text, but with the $FG,4$-A$FG$ flag you can make the link displayed as in example 3.
Examples (Press CTRL-T to see):
1)$LK,"File link to Help.TXZ","::/LT/Doc/Help.TXZ"$
2)$LK,"File link to Help.TXZ with link type file","FI:::/LT/Doc/Help.TXZ"$
3)File link without different display str.$LK-A,"::/LT/Doc/Help.TXZ"$
4)$LK,"File find link searching for 'Admin'","FF:::/LT/Doc/Help.TXZ,Admin"$
5)$LK,"File find link searching for 3rd 'CTRL'","FF:::/LT/OSMain/AdamK.HPZ,CTRL:3"$
6)$LK,"Manual page link","MN:PrintF"$
7)$LK,"File line number link","FL:::/LT/OSMain/AdamK.HPZ,200"$
8)$LK,"File anchor link--Press CTRL-T to see anchor after you click","FA:::/LT/OSMain/SysText.CPZ,OS_SYSTEXT"$
$ID,-2$$TR,"BT Button"$
$ID,2$
$ID,-2$$TR,"CB Check Box"$
$ID,2$
$ID,-2$$TR,"MA Macro"$
$ID,2$Macro's are usually placed into menu/help areas and they have the '$FG,4$+X$FG$' flag set by default. Adding '$FG,4$-X$FG$' prevents the usual ESC from being sent (which exits the macro screen). Note that when you output a macro to the cmd line, when the user clicks on it, it will go to the bottom and execute it unless you cancel the ESC with a '$FG,4$-X$FG$'.
$ID,-2$$TR,"MU Menu Value"$
$ID,2$
$ID,-2$$TR,"HX Hex Edit"$
$ID,2$
$ID,-2$$TR,"Hidden Text Widget"$
$ID,2$$FG,5$HS Start of hidden text$FG$
$FG,5$HE End of hidden text$FG$
$FG,5$$FG$Hidden text widgets allow text to be placed in collapsable brackets like this $HS$$FG$This is hidden.$HE$ which can be expanded by clicking them. If you place a '$FG,4$-C$FG$' flag to uncollapse it, it will start expanded like this $HS-C$$FG$Click to hide$HE$. They can be nestled like this $HS$Click here:$HS$This is nestled.$HE$ okay?$HE$.
$ID,-2$$TR,"TR Tree Widget"$
$ID,2$A tree widget is a branch in a collapsable tree. The domain of the branch extends from the first +indent until enough -indents bring it back to where it started. Tree's begin collapsed unless a $FG,4$-C$FG$ flag is present.
$ID,-2$$TR,"PI Picture"$
$ID,2$You can insert a picture into text with CTRL-R. It is critical where the cursor is at the time you enter CTRL-R because the picture will be offset from that location. This is especially important when adding images to programs. Numbers for pictures are automatically chosen because copying to and from the clipboard requires this. You can insert another picture with the same image by hitting CTRL-T and manually adding a $$PI$$ entry with the same number. You can cause the $$PI$$ command to appear with some text associated with it by manually adding text into the $$PI$$ command, as in $$PI,"pic 2",2$$.
$ID,-2$$TR,"IB Insert Binary"$
$ID,2$This cmd is used to tell the compiler to fetch the binary data stored after the end of text. There is basically one type of binary data in LTF's at this point--pictures-- created with CTRL-R. They have a number associated with them. This number is automatically chosen, because copying to the clip-board and back requires renumbering. To use a $$IB$$ command, toggle to plain text (CTRL-T) after inserting a picture and check the number in the $$PI$$ command. Create a $$IB$$ command with the same number and the picture will be inserted into the compiled stream like a str constant. You can optionally include text to be displayed for the $$IB$$ command.
The main reason for the $$IB$$ command at this point is to pass a parameter to the $LK,"GrElemsPlot","MN:GrElemsPlot"$() function. See $LK,"::/LT/Demo/Graphics/Sprite1.CPZ","FI:::/LT/Demo/Graphics/Sprite1.CPZ"$.
$ID,-2$$TR,"IT Insert Binary Type"$
$ID,2$See $$IB$$. This command inserts a number into the compiled stream describing the type of binary data associated with a number. See $LK,"LTFBT_GRELEM","MN:LTFBT_GRELEM"$ for the types of binary data in LTF's.
$ID,-2$$TR,"IS Insert Binary Size"$
$ID,2$See $$IB$$. This command inserts a number into the compiled stream describing the size of binary data associated with a number.
$ID,-2$$TR,"OL,OR Toolbar Entries"$
$ID,2$Left and right toolbar entries behave like $$PI$$ entries, but are positioned automatically at the top of the window.
$ID,-2$$TR,"BP Break Point"$
$ID,2$This is used by the debugger to mark a break point.
$ID,-2$$TR,"ER Error"$
$ID,2$When errors are detected in dollar commands, an $FG,5$ER$FG$ entry is generated to hold the garbage so it is not lost.
$ID,-2$
See $LK,"Ltf Flag Defines","MN:LTFLf_AUX_STR"$ and $LK,"Ltf Flag Codes","FF:::/LT/OSMain/SysText.CPZ,ST_LTF_FLAGS"$
$FE,4$See $LK+S,"default_flags","FA:::/LT/Adam/Ltf/LtfPlain.APZ,default_flags"$.
$TR,"FLAGS"$
$ID,2$$TR,"+H Hold"$
$ID,2$Hold entry and do not delete it when cleared with $FG,5$CL$FG$ or when the l->max_entries is exceeded. Word wrap is a good one to hold.
$ID,-2$$TR,"+A Auxilliary Str"$
$ID,2$Most commands display a str. Some need other strs. A $FG,4$+A$FG$ means an auxilliary str is present. Links have $FG,4$+A$FG$ by default, so use a $FG,4$-A$FG$ if you wish the display str and the link str to be the same.
$ID,-2$$TR,"+TR Tree"$(obsolete)
$ID,2$* There is now a separate $FG,5$TR$FG$ command so this flag is obsolete.
* Make a tree branch. Usually this is placed on a text($FG,5$TX$FG$) entry. The tree extends from the start until another tree entry or when indentation has been expanded and reduced back to the starting value.
* A $FG,4$+C$FG$ flag on a tree will start it collapsed.
$ID,-2$$TR,"+PU PopUp"$
$ID,2$A PopUp flag on a macro ($FG,5$MA$FG$) will cause the commands to run in a pop-up window.
$ID,-2$$TR,"+C Collapsed"$
$ID,2$A collapsed flag on a tree $FG,5$TR$FG$ entry or a hide start $FG,5$HS$FG$ will cause it to start collapsed. A $FG,4$-C$FG$ flag will make it start open.
$ID,-2$$TR,"+X Exit"$
$ID,2$* A exit flag will cause a macro to send an ESC before running(to exit the macro screen and return to the cmd prompt). Actually, the default has an exit flag set so you might add a $FG,4$-X$FG$ to turn-off ESC.
* If an entry is in the cmd prompt window, the $FG,4$+X$FG$ will cause a movement to the bottom of the window.
$ID,-2$$TR,"+Q Quit"$
$ID,2$A quit flag is similar to a $FG,4$+X$FG$ except a CTRL-Q instead of an ESC to exit.
$ID,-2$$TR,"+Z Zero"$
$ID,2$A zero flag on a hex edit($FG,5$HX$FG$) entry will cause the offset from zero. A $FG,4$-X$FG$ will show the actual mem address. By default, $FG,5$HX$FG$ has the zero flag set.
$ID,-2$$TR,"+AL Alias"$
$ID,2$An alias flag on a tree entry ($FG,4$+TR$FG$) will cause the text of the current entry the cursor is on to be copied to this entry. This creates something similar to a drop-down window, but it doesn't work well yet.
$ID,-2$$TR,"+TML,+TMR Top Menu"$
$ID,2$These flags position the entry along the top of the window.
$ID,-2$$TR,"+RD Refresh Data"$
$ID,2$The Refresh Data flag on a $FG,5$DA$FG$ or a $FG,5$CB$FG$ makes the value updated continuously.
$ID,-2$$ID,-2$$FE,5$
$FG,5$EXAMPLES:
$FG$Press CTRL-T to see how the following were done.
$UL,1$Underlined$UL,0$ $IV,1$Inverted$IV,0$ $BK,1$Blinking$BK,0$ $SY,-3$super$SY,0$ $SY,0$$SY,3$sub$SY,0$
$TX+SCX,"This is a big long scrolling message.",10$
$FG,5$Cursor Movements:$FG$
$CM+LX,3,3$Cursor moved 3 rows down and to 3rd column from left.
$CM+RX,-40,3$Note mandatory comma after flags
The following may be changed to modes instead of attributes with flags.
$TX+CX,"This is centered"$
$TX+RX,"This is right justified"$
+75
View File
@@ -0,0 +1,75 @@
$FG,2$$WW,1$'^'$FG$ Means the Control Key
$MA+A+LA,"Toggle Plain Text ^T","Msg(2,0x14,0x41400000414);"$
$MA+A+LA,"Toggle Picture Word ^O","Msg(2,0xF,0x41800000418);"$
$MA+A+LA,"Toggle Border ^B","Msg(2,2,0x43000000430);"$
Select Text SHIFT CURSOR
$MA+A+LA,"Cut to Clipboard SHIFT DEL","Msg(2,0,0x3D300000253);"$
$MA+A+LA,"Copy to Clipboard ^INS","Msg(2,0,0x4D200000452);"$
$MA+A+LA,"Paste from Clipboard SHIFT INS","Msg(2,0,0x2D200000252);"$
$MA+A+LA,"Del Line ^Y","Msg(2,0x19,0x41500000415);"$
Begin/End of Line ^Left/^Right
Begin/End of File ^Up/^Down
$MA+A+LA,"Indent In ^N","Msg(2,0xE,0x43100000431);"$
$MA+A+LA,"Indent Out ^SHIFT N","Msg(2,0xE,0x63100000631);"$
$MA+A+LA,"Word Wrap On ^W","Msg(2,0x17,0x41100000411);"$
$MA+A+LA,"Word Wrap Off ^SHIFT W","Msg(2,0x17,0x61100000611);"$
$MA+A+LA,"Underline On ^U","Msg(2,0x15,0x41600000416);"$
$MA+A+LA,"Underline Off ^SHIFT U","Msg(2,0x15,0x61600000616);"$
$MA+A+LA,"Blink On ^K","Msg(2,0xB,0x42500000425);"$
$MA+A+LA,"Blink Off ^SHIFT K","Msg(2,0xB,0x62500000625);"$
$MA+A+LA,"Invert Color On ^Z","Msg(2,0x1A,0x42C0000042C);"$
$MA+A+LA,"Invert Color Off ^SHIFT Z","Msg(2,0x1A,0x62C0000062C);"$
$MA+A+LA,"Toggle Superscript ^P","Msg(2,0x10,0x41900000419);"$
$MA+A+LA,"Toggle Subscript ^SHIFT P","Msg(2,0x10,0x61900000619);"$
$MA+A+LA,"Insert Dollar Cmd ^L","Msg(2,0xC,0x42600000426);"$
$MA+A+LA,"Insert Graphic Cmd ^R","Msg(2,0x12,0x41300000413);"$
$MA+A+LA,"Macro Capture and Play F2","Msg(2,0,0x3C0000003C);"$
$MA+A+LA,"Undo ALT-BACKSPACE","Msg(2,8,0x80E0000080E);"$
$MA+A+LA,"Page Break ^ENTER","Msg(2,0xD,0x41C0000041C);"$
$MA+A+LA,"Print PrintScreen","Msg(2,0,0xB7000000B7);"$
$MA+A+LA,"Goto Favorites ^SHIFT F","Msg(2,6,0x62100000621);"$
$MA+A+LA,"File Manager ^D","Msg(2,4,0x42000000420);"$
$MA+A+LA,"Find/Replace ^F","Msg(2,6,0x42100000421);"$
$MA+A+LA,"Find Next F3","Msg(2,0,0x3D0000003D);"$
$MA+A+LA,"Go to Line ^G","Msg(2,7,0x42200000422);"$
$MA+A+LA,"Save ^S","Msg(2,0x13,0x41F0000041F);"$
$MA+A+LA,"Save As ^A","Msg(2,1,0x41E0000041E);"$
$MA+A+LA,"Quit No Save ^Q","Msg(2,0x11,0x41000000410);"$
$MA+A+LA,"Quit and Save ESC","Msg(2,0x1B,0x0100000001);"$
$TR,"Cmd Line Issues"$
$ID,2$$FG$* $FG,2$CTRL-SHIFT-ENTER$FG$ can be used to insert a carriage return without issuing a cmd. This is useful when you have scrolled-up and wish to enter a cmd on a blank line.
* The last semicolon on the line is converted to a double semicolon because the compiler looks ahead before doing a cmd. This normally has no negative effect, but when entering "if" statements with "else" clauses it presents problems.
$ID,-2$$TR,"Hot Keys"$
$ID,2$$FG,9$CTRL ALT DEL$FG$ Reboots
$FG,9$CTRL ALT ESC$FG$ Spawns new task
$FG,9$CTRL ALT TAB$FG$ Switches tasks
$FG,9$CTRL ALT X$FG$ Kills current task
$FG,9$$FG,9$CTRL ALT C$FG$ Breaks current program
$FG,9$WINDOWS KEY$FG$ Activates Menu/Help/Macro area
$FG,9$CTRL FUNCTION KEY$FG$ Enters autocomplete word
$FG,9$CTRL Digit KEY$FG$ Enters autocomplete of dictionary word
$FG,9$CTRL SHIFT-FUNCTION KEY$FG$ Does man page on symbol
$FG,9$CTRL SHIFT-digit KEY$FG$ Looks-up the dictionary definition.
$ID,-2$$TR,"Debugging"$
$ID,2$F9 Toggle Breakpoint
SHIFT-F9 Clear ALL Breakpoints
F5 Go
SHIFT-F5 Single-Step
$ID,-2$
* If "MENU" appears on the title bar, you can click it with a mouse.
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
$WW,1$A graphic element is a line or point or poly-line or whatever, created with $FG,2$CTRL-R$FG$. Several graphic elements are clustered by $FG,2$CTRL-R$FG$.
+28
View File
@@ -0,0 +1,28 @@
$WW,1$* The support for 3 dimensional graphics is not very good. You'll probably just get frustrated.
* $FG,4$Gs->grbase$FG$ is a bitmap for persistent data on the screen, not needing to be redrawn. You create an alias for this by using $LK,"GrAlias","MN:GrAlias"$() and work with that. This image is XORed on top of everything, so the colors you work with, you usually XOR with WHITE to compensate. (White is usually the text background color. XORing twice gets you to what you started with.) It's slightly simpler using this bitmap then $LK,"grbase2","MN:grbase2"$, but it's not as good because changes aren't syncronized to the screen update and window borders are not enforced. See $LK,"::/LT/Demo/Graphics/DotNet.CPZ","FI:::/LT/Demo/Graphics/DotNet.CPZ"$
* There is actually one $FG,4$Gs->grbase$FG$ for each core and they get merged. See $LK,"::/LT/Demo/MultiCore2.CPZ","FI:::/LT/Demo/MultiCore2.CPZ"$
* $LK,"grbase2","MN:grbase2"$ is a bitmap for the screen, redrawn each refresh. You create an alias with $LK,"GrAlias","MN:GrAlias"$() and work with that. You must change the "$FG,2$Fs->update_win$FG$" variable to point to your update function and must draw everything in the window over and over again. "$FG,2$DrawIt()$FG$" is the preferred name for your update function, so everyone is consistent. See $LK,"::/LT/Demo/Graphics/Box.CPZ","FI:::/LT/Demo/Graphics/Box.CPZ"$
* Use $LK,"GrAlias","MN:GrAlias"$() to create your own structure for accessing the screen and pass it either $FG,4$Gs->grbase$FG$ or $LK,"grbase2","MN:grbase2"$. (Free it with $LK,"GrDel","MN:GrDel"$() when finished). A $LK,"GrBitMap","MN:GrBitMap"$ returned by $LK,"GrAlias","MN:GrAlias"$() stores the pen width and current color. It also can hold info necessary to rotate the whole image in 3D and shift it around.
* Use $LK,"GrBitMapNew","MN:GrBitMapNew"$() to create a memory bitmap which can be used to work off-line and which can be $LK,"GrBlot","MN:GrBlot"$ed onto the screen. If you set $FG,2$brush$FG$ member of $FG,2$GrBitMap$FG$ to another $FG,2$GrBitMap$FG$, all the graphic routines will $LK,"GrBlot","MN:GrBlot"$() the brush instead of $LK,"GrPlot","MN:GrPlot"$(). See $LK,"::/LT/Demo/Graphics/Blot.CPZ","FI:::/LT/Demo/Graphics/Blot.CPZ"$.
* There are various flavors of line and point plotting routines. $LK,"GrLine","MN:GrLine"$() and $LK,"GrPlot","MN:GrPlot"$() are the simplest. The others allow 3 dimensional graphics.
* $LK,"GrTheta","MN:GrTheta"$() and $LK,"GrPhi","MN:GrPhi"$() create matrices for 3 dimensional rotations. You pass them an angle in radians. To make the matrices take effect, assign them to your graphic $LK,"GrBitMap","MN:GrBitMap"$'s "$FG,2$r$FG$" variable and set the $LK,"BMF_TRANSFORMATION","MN:BMF_TRANSFORMATION"$ flag. Transformations (rotations) can be combined using $LK,"GrMulMat","MN:GrMulMat"$(). See $LK,"::/LT/Demo/Graphics/Box.CPZ","FI:::/LT/Demo/Graphics/Box.CPZ"$.
* You can rotate single points using $LK,"GrRotate","MN:GrRotate"$().
* You can shift the image around by changing a $LK,"GrBitMap","MN:GrBitMap"$'s "$FG,2$x$FG$","$FG,2$y$FG$" and "$FG,2$z$FG$" variables.
* Use the resource editor, $FG,2$CTRL-R$FG$, to create a picture-like thing called a Graphic Element that can be plotted with $LK,"GrElemsPlot","MN:GrElemsPlot"$(). Use $FG,2$$$IB,"",1$$$FG$ in a source program to insert the address of picture #1. (After creating a picture with $FG,2$CTRL-R$FG$ in your source code, toggle to plain text with $FG,2$CTRL-T$FG$ and check it's number. Then, make an assignment to a pointer variable with $FG,2$$$IB,"",n$$$FG$ as the value. See $LK,"::/LT/Demo/Graphics/Sprite1.CPZ","FI:::/LT/Demo/Graphics/Sprite1.CPZ"$ and $LK,"::/LT/Demo/Graphics/Sprite2.CPZ","FI:::/LT/Demo/Graphics/Sprite2.CPZ"$.) The origin (zero point) for a graphic element is defined by the cursor location when you press $FG,2$CTRL-R$FG$. The "$FG,2$x$FG$", "$FG,2$y$FG$" and "$FG,2$z$FG$" values you pass to $LK,"GrElemsPlot","MN:GrElemsPlot"$() shift it around. You can edit a Graphic Element by clicking the cursor on it and pressing $FG,2$CTRL-R$FG$ again.
* There is a mechanism built-in for generating motion based on differential equations, which allows real-world physics. You create an $LK,"Ode","MN:Ode"$ struct with $LK,"OdeNew","MN:OdeNew"$(), passing it the number of variables in the state vector. For real-world physics, you usually have 2 state variables for each dimension (for each mass) because motion is governed by f=ma which is a 2nd order equation. The two states are position and velocity and to solve these you need to supply the derivative of position and velocity. The derivative of position is usually simply the current velocity and the derivative of velocity is the acceleration (the sum of forces on a mass divided by mass). To help provide meaningful names for values in the state vector, you can create an $LK,"Order2D3","MN:Order2D3"$ pointer and point it to a mass in the state vector. Six elements in the state vector are required for each mass.
See $LK,"::/LT/Apps/Rocks/Rocks.CPZ","FI:::/LT/Apps/Rocks/Rocks.CPZ"$
+66
View File
@@ -0,0 +1,66 @@
$WW,1$$FG,5$$TX+CX,"ACCOUNT FILES"$$FG$
You can add and remove accounts by making or removing directories in the $FG,2$::/LT/Accts$FG$ directory. You'll have to copy start-up files into them.
See $LK-A,"HOME/User.CPZ"$ for the user start-up file.
See $LK-A,"HOME/User.MUZ"$ for a personalizable menu/macro area which can be viewed at the command line with the windows key or by clicking "$FG,2$MENU$FG$" in the upper left border area of a window.
See $LK-A,"HOME/DoIt.CPZ"$ for a file which is invoked at the start-up of the first user.
See $LK-A,"HOME/Favor.MUZ"$ for a handy "favorites" file which can be reached by pressing $FG,2$CTRL-SHIFT-F$FG$, pretty-much anywhere. Users can place links and todo lists or any text within this.
See $LK-A,"HOME/Adam3.APZ"$ for the user files that get loaded into the adam task at start-up. These are only loaded once.
See $LK-A,"HOME/System.CPZ"$ for the start-up file used when a $LK,"System","MN:System"$() command is used.
See $LK-A,"HOME/Servant.CPZ"$ for the start-up file other commands which $LK,"Spawn","MN:Spawn"$() tasks.
See $LK-A,"HOME/Fault.CPZ"$ for a start-up file called when a fault occurs. When debugging you might place data display commands here.
$FG,4$SysRegistry.BIZ$FG$ is for operating system data. It's just a $LK,"SysAccntRegistryStruct","MN:SysAccntRegistryStruct"$ that's been written-out. For application configuration data, create a data file in the application's subdirectory in $FG,2$HOME$FG$ if you make an application.
$FG,5$$TX+CX,"APPLICATION POLICIES"$$FG$
* Place applications in their own $FG,2$/LT/Apps$FG$ subdirectory.
* Make a file called $FG,2$Load.CPZ$FG$ to load the application.
* Make a file called $FG,2$Run.CPZ$FG$ to load and run the application, preferable by $FG,2$#include$FG$ing the $FG,2$Load.CPZ$FG$ file.
* Place user data in a subdirectory of $FG,2$HOME$FG$, preferably naming the subdirectory the same as the $FG,2$/LT/Apps$FG$ subdirectory.
* Make a file called $FG,2$Install.CPZ$FG$ or $FG,2$Install.AUZ$FG$ to create the $FG,2$HOME$FG$ subdirectory and do similar stuff.
$FG,5$$TX+CX,"OS PROGRAMMING GUIDELINES:"$$FG$
* Virtual mem is not used (It is identity mapped in EM64T mode). The stack does not grow, so allocate enough when the task (process) is $LK,"Spawn","MN:Spawn"$ed and use the heap for most things. (The "heap" refers to $LK,"MAlloc","MN:MAlloc"$() and $LK,"Free","MN:Free"$().)
* I've tried to standardize names see $LK,"Naming convention","FF:::/LT/Doc/OSGlossary.GLZ,Naming convention"$
* There are two modes of compiling $LK,"Static Compiled Mode","FF:::/LT/Doc/OSGlossary.GLZ,Static Compiled Mode"$ and $LK,"Dynamic Compiled Mode","FF:::/LT/Doc/OSGlossary.GLZ,Dynamic Compiled"$. Actual compilation is done in both--nothing is "interpreted".
* $LK,"Differences from C/C++","FI:::/LT/Doc/Differences.TXZ"$
$FG,5$$TX+CX,"Hash symbol tables:"$$FG$
* See $LK,"::/LT/Adam/HashUtils.APZ","FI:::/LT/Adam/HashUtils.APZ"$ for examples of how the hash tables are set-up. Basically, symbols are placed into hash tables and child process hash tables are chained to parents. This provides scopes for variables and functions.
* "$FG,2$adam_tss->hash_table$FG$" holds the C/C++ symbols loaded in on start-up.
* "$FG,2$Fs->hash_table$FG$" holds user C+ symbols and if a symbol is not found, it checks parents. When a duplicate symbol is added to the table, it overshadows the previous symbol. When developing software, typically you include the file at the command prompt, make changes and reinclude it. Old symbols are overshadowed but they are still there. Periodically, kill the TASK and start fresh when mem is low. If you wish your applications to free themselves instead of staying in mem, spawn or $LK,"PopUp","MN:PopUp"$() a task to run the application and kill it when it's done.
* To display the contents of a hash table, use the $LK,"HashRep","MN:HashRep"$() routine or the varients.
$FG,5$$TX+CX,"Assembly Language Concerns:"$$FG$
* $FG,2$FS$FG$ must always point to the per-TASK's structure. See $LK,"C+","FF:::/LT/OSMain/AdamK.HPZ,TssStruct:2"$ and $LK,"Asm","FF:::/LT/OSMain/OSDefs.ASZ,TSS_RIP"$.
* $FG,2$GS$FG$ must always point to the per-CPU's structure. See $LK,"C+","FF:::/LT/OSMain/AdamK.HPZ,CPUStruct:1"$ and $LK,"Asm","FF:::/LT/OSMain/OSDefs.ASZ,CPU_NUM"$.
* Don't change the segment registers unless interrupts are off.
* When interacting with compiled code, preserve $FG,2$RBP, RSI, RDI, R12-R15$FG$ because the compiler uses these for register vars. You are free to trash $FG,2$RAX, RBX, RCX, RDX$FG$ and $FG,2$R8-R11.
+21
View File
@@ -0,0 +1,21 @@
$WW,1$$FG,5$User Skills Required$FG$
* Knowledge of the $FG,2$C$FG$ programming language.
$FG,5$Supported Hardware$FG$
* IBM PC compatible with 64-bit x86 $FG,4$EM64T$FG$
* VGA graphics
* Some$FG$ keyboards and mice.
* Minimum 256 Meg RAM; Maximum 128 Gig RAM
* Internal PC Speakers
* Can boot to IDE CD-ROMs
* Can access but not boot SATA CD-ROMs
* ATA and SATA hard drives $FG,4$<=120 Gig$FG$
* RS232 serial ports
* Game Port Joysticks, not USB.
$FG,5$Unsupported Hardware$FG$
* No Modern graphics cards
* No Modern sound cards
* $FG,4$No Networking$FG$
* No USB devices
* No Printers (There is a feeble attempt to send ASCII to a parallel port when you press $FG,2$PRT SCRN$FG$.)
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+39
View File
@@ -0,0 +1,39 @@
$LK,"Main Help","FI:::/LT/Doc/Help.TXZ"$
Function Catagories
$LK,"AutoFile","HI:AutoFile"$
$LK,"Bit","HI:Bit"$
$LK,"Boot","HI:Boot"$
$LK,"Call","HI:Call"$
$LK,"Char","HI:Char"$
$LK,"Circular Queue","HI:Circular Queue"$
$LK,"Comm","HI:Comm"$
$LK,"Compiler","HI:Compiler"$
$LK,"Compression","HI:Compression"$
$LK,"Debugging","HI:Debugging"$
$LK,"Exceptions","HI:Exceptions"$
$LK,"Fifo","HI:Fifo"$
$LK,"File","HI:File"$
$LK,"Games","HI:Games"$
$LK,"Graphics","HI:Graphics"$
$LK,"Hash","HI:Hash"$
$LK,"Input Pointer","HI:Input Pointer"$
$LK,"Install","HI:Install"$
$LK,"Ltf","HI:Ltf"$
$LK,"Math","HI:Math"$
$LK,"Memory","HI:Memory"$
$LK,"Messages","HI:Messages"$
$LK,"Misc","HI:Misc"$
$LK,"Multi-Core","HI:MultiCore"$
$LK,"PicWords","HI:PicWords"$
$LK,"Processor","HI:Processor"$
$LK,"Sound","HI:Sound"$
$LK,"Task","HI:Task"$
$LK,"Time","HI:Time"$
$LK,"Training","HI:Training"$
$LK,"Windows","HI:Windows"$
$LK,"WordStat","HI:WordStat"$
$LK,"Utils","HI:Utils"$
+4
View File
@@ -0,0 +1,4 @@
$WW,1$"Input Pointer" is either a mouse or joystick at this point. If you really want to, you can access the mouse variables directly -- see $LK,"mxx","MN:mxx"$.
Binary file not shown.
BIN
View File
Binary file not shown.
+94
View File
@@ -0,0 +1,94 @@
$WW,1$$FG,5$$TX+CX,"Introduction"$$FG$
There's no point being an inferior immitation of $FG,2$Windows$FG$. I picked a niche and specialized -- $BK,1$programming as entertainment$BK,0$. I chose simplicity intentionally over conventional approaches. This is not a platform for games, but a platform for writing games. Hobbiest programmers are a higher priority than commercial developers.
I have no plans to support multimedia or the Internet. This is a supplemental operating system (like supplemental insurance). Duel boot and do that stuff on your primary operating system. There's no reason to reinvent the wheel and, unlike what I've done in LoseThos , I see nothing I could add to a browser or multimedia player -- you can't change the file formats.
LoseThos has no networking and will never have networking so there's no need for security. Did an $FG,2$Apple II$FG$ or $FG,2$Commodore 64$FG$ have security? I mention these classic systems because the intended usage of LoseThos is similar, only modern.
LoseThos is not for desktop publishing or word processing. It's document format is designed for interaction on the screen and does not lend itself to printing. Click here for a hint $HS$This text is hidden until you click on it.$HE$.
When I started programming in 1981 on an $FG,2$Apple II$FG$, it took two lines of code to draw a line on the screen and it could be typed from the command line or in a $FG,2$BASIC$FG$ program:
$FG,4$HGR
HLINE 1,1 TO 30,30$FG$
Programming is far more intimidating, now. It's not uncommon for a "Hello World" application to take 50 lines of code.
Most game development packages for amateurs are like fitting a square peg in a round hole. People want good looking games, but don't have "the chops". $FG,2$LoseThos$FG$ games will not look as good, but there is complete freedom -- you won't be constrained. I suggest you stick to 2D instead of 3D.
Game companies employ more artists than programmers. In the past, games were often made by individual programmers. Modern games are more like movies, relying on lots of "canned" video and sound.
I had to have an option for simple graphics so I made a graphic layer that is "persistent" (stays on the screen without having to be refreshed.) There is a second layer which is redrawn each refresh. The two layers are merged (XOR), along with a text layer, to form the screen image. There's actually a persistent layer for each CPU, but beginners don't need to know that.
I hate fighting with fonts. There will always be just one font, a fixed-width font, because variable width letters screw-up tables. Now, I fight with colors and it's about the same. Oh, well.
I like $FG,2$ASCII$FG$ more than $FG,2$UNICODE$FG$. I'll stick to the American market. I might add extended $FG,2$ASCII$FG$, but not $FG,2$UNICODE$FG$. Let programmers in other countries write their own operating systems.
The text layer allows animated character graphics, which were fun. It's been modified to shift the character in each position horizontally or vertically, so you can do $SY,-3$superscripts $SY,0$or $SY,3$subscripts$SY,0$.
I hated learning one language for the command line and another for programming. With $FG,2$LoseThos$FG$, the command line feeds right into the $FG,2$C+$FG$ (more than $FG,2$C$FG$, less than $FG,2$C++$FG$) compiler, line by line, and it places code in memory it $LK,"MAlloc","MN:MAlloc"$()s. It's like the compiler is paused. Naturally, you $FG,2$#include$FG$ a program to load it into memory and, usually, start it. During boot, many files get compiled before it allows you to access the command line. All the header declarations for the operating system are already compiled and are available for use in your programs without needing to $FG,2$#include $FG$them. Everything is truely compiled and nothing is "interpreted".
Statements outside the "scope" of a $FG,2$C+$FG$ function execute immediately. There is no $FG,2$main()$FG$ function. Instead, you give a meaningful name and invoke that function by calling it with a statement outside the scope of any function, usually at the bottom of your file.
I started with $FG,2$C$FG$ syntax, but didn't like the command line for a directory listing looking like this:
$FG,4$Dir("*.*",FALSE);
$FG$So, I added default parameters from $FG,2$C++$FG$ and it looked like this:
$FG,4$Dir();
$FG$I didn't like that, so I made parentheses optional on calls with no parameters and it looks like this:
$FG,4$Dir;$FG$
The only side effect in changing the syntax is that when you specify the address of a function, you must include a $FG,2$&$FG$ in front (which is better anyway).
Once I was no longer using standard syntax, I decided to change everything I didn't like. Here are the new $LK,"operator precidence","FA:::/LT/Compiler/CmpInit.CPZ,OP_precidence"$ rules. See $LK,"Departures from C/C++","FI:::/LT/Doc/Differences.TXZ"$.
There are no object files in LoseThos and, normally, you don't make executable files either, but you can. That's known as "static" compilation.
I looked at $FG,2$Linux$FG$ code to learn how to use a hard drive and, damn it was confusing. It had so many layers it was hard to find the actual $FG,4$IN$FG$ and $FG,4$OUT$FG$ instructions that access the hardware. I decided I'd keep layering to a minimum. Why have open source software if people can't understand and modify it?
One problem with $FG,2$Linux$FG$ is it handles many platforms and different pieces of hardware so it's full of $FG,4$#if$FG$'s and I found it difficult to read. I don't know if LoseThos will become that way or not. I'm starting with 64-bit CPU's and hardware of that vintage, so I have no reason to support the majority of old hardware.
I cherished a book called "Mapping the $FG,2$Commodore 64$FG$" when I was a kid because it literally told what everything did. I had a lot of fun. $FG,2$Commodore$FG$, Ticketmaster's $FG,2$VAXTMOS$FG$ and $FG,2$MATLAB$FG$ are influences.
I made the kernel (known as OSMain) intentionally simple, so everybody could understand and tinker. Technically, it shouldn't be called a kernel since $BK,1$everything always runs in kernel mode$BK,0$. All code always has full priviledge. User programs can access all memory, use all CPU instructions, access all I/O ports directly, and can access all parts of the disk. My system reboots in 3 seconds if I crash it and I like total freedom as a programmer.
Tasks have no priority scheme and are never removed from the queue. Instead they poll whatever they are waiting on and swap-out. This keeps it simple. It's only a problem if you have too many tasks busy.
The file system is simple so no body can sue me. There is an allocation bitmap and all files are stored contiguously. You cannot grow files. Files have checksums, however. Filenames ending in "Z" are stored compressed. LoseThos supports direct block access into files. There is no $FG,2$PATH$FG$ but parent directories are searched when a file is not found. See $LK,"LTZ","FI:::/LT/Doc/LTZ.TXZ"$ for transferring files to your primary partition.
At one job I made a hardware device which plugged into the parallel port. When we upgraded from $FG,2$Win98$FG$ to $FG,2$WinXP$FG$, hardware ports became off-limits. A coworker found some software to enable them. $FG,2$LoseThos$FG$ allows full access to ports. Some hobbiests might want to plug hobby hardware projects into the parallel port.
I like being able to turn-off interrupts ($FG,2$Cli; $FG$and $FG,2$Sti;$FG$) when I change a structure used in a multitasking environment. $FG,2$LoseThos$FG$ runs all programs in kernel mode, so no instructions are restricted. Turning-off preemption with $LK,"Preempt","MN:Preempt"$() is a less drastic measure that is usually sufficient.
The graphic resolution is poor, 640x480x4. I've decided to set this as the one and only resolution, forever. It uses minimal CPU. A fixed size keeps it simple. Everybody has the same appearance on their screen. It's good for mobile devices. VGA is currently the least common denominator on PC's. Look on the bright-side -- you won't spend your time twiddling pixels.
$FG,2$LoseThos$FG$ is for hobbiest programmers on single user home computers. The focus task is all-important so "symmetrical multiprocessing" is almost pointless. When it comes to multicore utilization, all resources should be devoted to the focus task. For now, you must explicitly make use of mutlicore in your programs. You can make use of $FG,4$Gs->grbase$FG$, a persistent graphics layer present for each core. It gets merged (XORed) to make the final image. Multicore is fun. A practical use I plan is placing time-critical tasks on a core which doesn't allow long periods with preemption turned-off.
I didn't want to use virtual memory, but I had to for 64-bit mode. It's just as though there is no virtual memory, except you can mark pages as uncached or write-through for MultiCore programming.
There is no distinction between "task", "process" or "thread". All have a $LK,"TssStruct","MN:TssStruct"$() pointed to by $FG,4$Fs->$FG$ while $FG,4$Gs->$FG$ points to a $LK,"CPUStruct","MN:CPUStruct"$ for the current CPU. Each task can have just one window.
In LoseThos , "$FG,2$Adam$FG$" refers to the father of all tasks. He's never supposed to die. Since task's inherit the symbols of parents, system-wide stuff is associated with $FG,2$Adam$FG$. His heap is like kernel memory in other operating systems. He stays in a server mode, taking requests, so you can ask him to $FG,2$#include$FG$ something which places that code system-wide. A funny story is that, originally, I called it the "root" task and even had a "$FG,2$/LT/Root$FG$" directory.
For easy back-up, place everything you do in your $FG,2$HOME$FG$ directory and subdirectories. That should make upgrading easy, too. To make an account use $LK,"MkDir","MN:MkDir"$() to create a directory under $FG,2$/LT/Accts$FG$. It will be $FG,2$HOME$FG$ if you boot to it. The customizable start-up scripts should go in your $FG,2$HOME$FG$ directory. The default start-up files are in $FG,2$/LT/Accts$FG$, the parent of all accounts. Copy the start-up files you wish to customize into $FG,2$HOME$FG$ and modify them. See $LK,"Account Files","FF:::/LT/Doc/GuideLines.TXZ,ACCOUNT FILES"$.
Typically, your usage pattern through the day will be repeatedly left or right clicking on filenames in a command line $LK,"Dir","MN:Dir"$() listing. You left-click files to edit them and right-click to $FG,2$#include$FG$ them. To begin a project, type $LK,"Edit","MN:Edit"$(""); and supply a filename. Press $FG,2$ESC$FG$ to save and exit the file. You'll need to do a new $LK,"Dir","MN:Dir"$() command, periodically, so make a macro. Access the macro by pressing the $FG,2$WINDOWS$FG$ key, cursoring until you are on top of it and pressing the $FG,2$SPACE BAR$FG$.
$FG,2$CTRL-T$FG$ toggles plain text mode, similar to html. $FG,2$CTRL-L$FG$ inserts a nongraphic widget. $FG,2$CTRL-R$FG$ inserts a graphic or edits the graphic under the cursor.
$FG,2$CTRL-ALT-ESC$FG$ creates a new terminal window. $FG,2$CTRL-ALT-X$FG$ kills a window. You'll do these periodically. $FG,2$CTRL-SHIFT-F$FG$ pops-up the "favorites" document. The favorites can be used from anywhere. You can put anything there. I use it as a handy TODO file, along with common links.
$LK,"Grep","MN:Grep"$() is your best friend. There's a wrapper function called $LK,"F","MN:F"$() in your $FG,2$User.CPZ$FG$ file. $LK,"Grep","MN:Grep"$() can also be used to replace strings across multiple files.
As you browse code, use the $FG,2$WordStat$FG$ window to look-up functions, etc. Press $FG,2$CTRL-SHIFT-F1$FG$ (or whatever) to follow a symbol to it's source. You can browse deeper and deeper. You go back with $FG,2$CTRL-Q$FG$.
Use the $LK,"Help Index","FI:::/LT/Doc/HelpIndex.TXZ"$ to find-out what exists. It's broken down by category. A link to the help index should be on your menu. ($FG,2$WINDOW's KEY$FG$). Also, look in the $FG,2$/LT/Demo$FG$ directory.
$MA+A-X+PU,"Take Tour","SpawnUser(\"Cd(\\\"::/LT/Accts/Tour\\\");;AutoFile(\\\"Tour\\\");\r\");"$
+25
View File
@@ -0,0 +1,25 @@
$WW,1$$FG,5$$TX+CX,"Proverbs"$$FG$
Writing your own code is more fun then modifying someone else's. Sadly, I heard 90% of programmers work on maintaining code. One good thing about looking at other people's code is it's a good way to learn -- you can learn what to and what NOT to do.
Code written by one person is less redundant than code written by a team because one person knows when he is reinventing the wheel. It is more vertical, meaning deeper levels of subroutines.
When working on other people's code, you tend to be defensive, using caution about uncertain items and this adds unnecessary code.
Documentation which is out-of-date is worse than no documentation. With LoseThos, I tried to keep documentation right by code.
If you call common low-level routines, there is a potential for huge added functionality with changes to the low level routines, benefitting everything. Imagine modifying a file choosing dialog.
Not all features are good to use. I've seen cases where people use macro functions ($FG,2$#define$FG$) to make C code look like C++ code. It becomes one-more layer you have to look-up to understand. An advantage of nonvertical coding is readibility. It is possible to get carried away with nonstandard library routines.
One mentor discouraged using abbreviations. One advantage of nonabreviated labels is there's no uncertainty on how to spell them. Typing is never what slows you down, except maybe at the command line. Uncertainty is what slow you down.
One mentor always put "temp" on the beginning of local variables -- "$FG,2$tempd$FG$" instead of just "$FG,2$d$FG$". The reason is probably for text searches. I've somewhat eliminated this need with the "whole label" search feature.
$LK,"Grep","MN:Grep"$() is my best friend. I use a wrapper function $LK,"F","MN:F"$().
It's easier to write a command-line interface than a GUI one and if it's for personal use, why not?
On a modern home computer, the only things which take significant memory are disk cache, graphics and sound. Code related items do not. If you had a million lines of code and stored an 8-byte value telling where each line was located, that would be 8 Meg. I have 2Gig, so that would be 0.4 %. Structures for classes and functions amount to nothing.
A home computer doesn't really need a big disk cache. How often do you listen to the same multimedia items more than once? If you have a server for a database, sure you need disk cache.
+62
View File
@@ -0,0 +1,62 @@
/*
$FG,2$$WW,1$You may wonder why I do scaled integer arithmetic in the graphics routines. The transformation matrix in a $LK,"GrBitMap","MN:GrBitMap"$, r, is stored as 8-byte integers shifted 32 bits left to allow fractions. This is faster than floating point (double) arithmetic, but less accurate.
$WW,0$
$FG$*/
#define SAMPLE_SIZE 100000000
I4 coordinates[65536];
void TimeIns()
{
U8 start1,end1,start2,end2,overhead_time,test_time;
double reg d1;
I8 reg i,reg temp,reg d2,reg sum;
//Set-up some sample coordinates
for (i=0;i<65536;i++)
coordinates[i]=RandU4;
Preempt(OFF);
//$FG,2$Measure Loop Overhead$FG$
start1=GetTimeStamp;
for (i=0;i<SAMPLE_SIZE;i++) {
}
end1=GetTimeStamp;
overhead_time=end1-start1;
//$FG,2$Measure double arithmetic$FG$
d1=Sin(1.0);
sum=0;
start2=GetTimeStamp;
for (i=0;i<SAMPLE_SIZE;i++)
$FG,4$ sum+=d1*coordinates[i&65535];
$FG$ coutln "Double Arithmetic Sum :",sum;
end2=GetTimeStamp;
test_time=end2-start2;
PrintF("Double Arithmetic Cycles: %10.5f\r\n",
(test_time-overhead_time)*1.0/SAMPLE_SIZE);
//$FG,2$Measure scaled integer arithmetic$FG$
d2=Sin(1.0)*0x100000000;
sum=0;
start2=GetTimeStamp;
for (i=0;i<SAMPLE_SIZE;i++) {
$FG,4$ temp=d2*coordinates[i&65535];
sum+=temp.i4[1];
$FG$$FG$ }
end2=GetTimeStamp;
test_time=end2-start2;
coutln "Scaled Integer Sum :",sum;
PrintF("Scaled Integer Cycles :%10.5f\r\n",
(test_time-overhead_time)*1.0/SAMPLE_SIZE);
Preempt(ON);
}
TimeIns;
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+82
View File
@@ -0,0 +1,82 @@
$WW,1$$FG,5$$TX+CX,"MEMORY USAGE"$$FG$
$FG,2$Page Tables:$FG$
0x1000*(PML1+PML2+PML3+PML4)
-----------
0x83000
$FG,2$Heap Size:$FG$
*SYS_MEMBLKS-0x100000-page_tables
-----------
sys_heap_limit+1-sys_heap_base
$FG,2$mp_heap:$FG$
-----------
0x00200000
$FG,2$Cain Heap CPU #1:$FG$
-----------
0x00200000*(mp_cnt-1)
$FG,4$MAlloc Blk Allocations:$FG$
$FG,2$Allocations below 0x200, first one:$FG$
0x1E00+size_rounded_up_to_page
-----------
0x2000
$FG,2$Allocations below 0x400, first one:$FG$
0x1E00+size_rounded_up_to_page
-----------
0x2200
$FG,2$Allocations below 0x20000:$FG$
size_rounded_up_to_page+0x200
$FG,2$Allocations above 0x20000:$FG$
(size-0x400)rounded_up_to_power_2+0x400
$FG,4$Task Usage:$FG$
$FG,2$Stack:$FG$
0x20000+0x400
$FG,2$Hash Table:$FG$
0x08000+0x200
$FG,2$First Small Chunk:$FG$
0x2000
$FG,4$Adam Task:$FG$
$FG,2$Default RAM Drive B (when used):$FG$
0x20000*0x200+0x400
-----------
0x04000400
$FG,2$grbase2:
vga_image:
gr_merge_base:
Gs->grbase*mp_cnt:$FG$
(mp_cnt+3)*(0x40000+0x400)
-----------
0x00101000
$FG,2$Disk Cache:$FG$
0x8000000+0x400
-----------
0x08000400
$FG,2$WordStat:$FG$
-----------
big--holds a sparse matrix containing statistics on which words follow which other words with what frequency.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+189
View File
@@ -0,0 +1,189 @@
$WW,1$$FG,5$Notes on upgrading:
$FG,2$* Use the $LK,"R","MN:R"$("old","new") to rename items if I change them.
* You are strongly advised not to make statically compiled modules. (Static modules produce a .BIZ file which you $LK,"Load","MN:Load"$() while dynamicly compiled code is just $FG,4$#include$FG,2$d.)
$FG$
$IV,1$----08/16/07 02:38:03----$IV,0$
* Added faster line clipping.
$IV,1$----08/15/07 20:51:55----$IV,0$
* Fixed feature of scan codes--sc.u4[1] is unconsolidated code.
* Made so you can nestle $FG,2$AutoFile$FG$s.
* Modified $LK,"Load","MN:Load"$()... no recognizable changes
* Modified $FG,4$cout$FG$ no recognizable changes
* Made $FG,4$PUSH_C_REGS$FG$ and $FG,4$POP_C_REGS$FG$ and made use of it. Fewer regs are pushed in many places.
$IV,1$----08/14/07 14:35:33----$IV,0$
* Fixed Ltf bug on PAGE DOWN/UP
* Added $LK,"LTFF_DO_FULL_UPDATE","MN:LTFF_DO_FULL_UPDATE"$ to prevent flicker if you like.
* $LK,"LTFF_DONT_SWAP_OUT","MN:LTFF_DONT_SWAP_OUT"$, related to swap-outs during $LK,"PrintF","MN:PrintF"$(). Made swap-out less.
$IV,1$----08/13/07 08:38:18----$IV,0$
* Worked-out scheme to keep from turning preemption off during window updates.
* Added $FG,2$preempt$FG$ parameter to $LK,"LtfUpdateWinJoin","MN:LtfUpdateWinJoin"$().
* Modified poll kbdmouse to spawn separate task when winupdates take too long.
$IV,1$----08/13/07 01:24:12----$IV,0$
* Modified $LK,"WinSync","MN:WinSync"$() to make it more useful.
* R("nearest_sub_GrElem", "nearest_sub_grelem");
* R("cur_sub_GrElem", "cur_sub_grelem");
* Added $LK,"::/LT/Demo/Graphics/Pick.CPZ","FI:::/LT/Demo/Graphics/Pick.CPZ"$ showing how to use distance to cursor calculations in graphics routines.
$IV,1$
----08/12/07 01:59:17----$IV,0$
* Added compiler optimizations.
* Added recovery disk option.
* Changed B RAM drive size on install CD.
$IV,1$----08/09/07 22:13:41----$IV,0$
* Adjusted $LK,"TssStruct","MN:TssStruct"$ to optimize for byte displacement. Haven't settled on best.
* Added compiler optimizations.
* Fixed editor bugs.
$IV,1$----08/09/07 08:19:49----$IV,0$
* Got rid of REX 0x40 in assembler
* Got rid of Ltf password flag.
$IV,1$----08/08/07 10:15:29----$IV,0$
* Removed .BMP screen capture due to licensing concerns.
$IV,1$----08/08/07 05:10:27----$IV,0$
* Moved flags in $LK,"TssStruct","MN:TssStruct"$ and $LK,"CPUStruct","MN:CPUStruct"$, eliminated CPU preemptive flag (It's now a task flag, only.)
* Made $LK,"Preempt","MN:Preempt"$() function inline
* Added compiler opt -- fewer 0x40 bytes
* Fixed $LK,"::LT/Demo/GameStarters/Swing.CPZ","FI:::LT/Demo/GameStarters/Swing.CPZ"$
$IV,1$----08/07/07 22:33:38----$IV,0$
* $BK,1$Finished Version 3.04$BK,0$
* Improved kbd/mouse
* Replaced U4Fifo with U8Fifo
$IV,1$----08/05/07 22:31:06----$IV,0$
* Cleaned-up WordStat code
* Added $LK,"OrderFiles","MN:OrderFiles"$(). See $LK,"::/LT/Demo/OrderedIO.CPZ","FI:::/LT/Demo/OrderedIO.CPZ"$
$IV,1$----07/31/07 02:48:11----$IV,0$
* Adding new feature to compiler to allow "5<i<10" instead of "5<i && i<10".
* Fixed a horrible compiler bug where "i<5" worked but not "5>=i". (I always code the former way.)
$IV,1$----07/27/07 00:49:50----$IV,0$
* Improved fault handling
* Added compiler optimizations
* Added TSSf_AWAITING_MSG to improve performance.
* Modified keyboard/mouse routine. Boots faster and might not hang so much when you use both at the same time.
$IV,1$----07/25/07 03:40:49----$IV,0$
* $BK,1$WARNING:$BK,0$ Your $LK,"Auto","MN:Auto"$() entries to configure builds must be changed. I cleaned-up the $LK,"AddDrives","MN:AddDrives"$() prompts, getting rid of "Custom". All $FG,2$ATA$FG$ and $FG,2$ATAPI$FG$ types require numbers.
$IV,1$----07/24/07 21:55:58----$IV,0$
* Fixed graphic pen_width brushes. It slightly affects picture appearance. You might need to increase pen_width.
$ID,2$$FG,5$To convert old pictures...
$FG$1) Boot the old LoseThos version
2) Press CTRL-R when on top of the picture
3) Select "Insert"
4) Select "Convert to Bitmap". If you don't want it drawn on a background, select "transparent bitmap."
5) Stretch-out a box around the image
6) Click "End"
7) Click "End" again
8) Save your picture in a file
9) Boot the new version of LoseThos
$FG,5$Another option you might try$FG$
1) Press CTRL-R
2) Select "Edit"
3) find the "Width" entries and change the far right numbers.
4) Press ESC
5) Select "End"
6) Save your picture in a file
$ID,-2$
$IV,1$----07/24/07 01:13:59----$IV,0$
* I think I fixed a bug in the CD-ROM install script.
$IV,1$----07/23/07 16:51:15----$IV,0$
* Added borderless windows. CTRL-B now toggles the window border and Blink is now done with CTRL-K.
$IV,1$----07/21/07 21:46:59----$IV,0$
* Added $LK,"WordStat","MN:WordStat"$() to replace old Spawn(&WsTsk).
$IV,1$----07/21/07 04:00:51----$IV,0$
* Fixed divide by zero bug in $LK,"GrBlot3","MN:GrBlot3"$()
$IV,1$----07/20/07 00:41:53----$IV,0$
* R("ViewDisk","ViewDrive");
* Added new $LK,"ViewDisk","MN:ViewDisk"$().
* Fixed horrible $BK,1$compiler bug$BK,0$ relating to unary minus and double/int conversion.
$IV,1$
----07/19/07 17:00:50----$IV,0$
* Scaled pen_width on GrElem transformations
* Added lecture on scaled integer arithmetic. $LK,"::/LT/Doc/Lectures/ScaledInt.CPZ","FI:::/LT/Doc/Lectures/ScaledInt.CPZ"$
* Added demo MultiCore1
$IV,1$----07/16/07 01:40:23----$IV,0$
* Added nestled comments to compiler.
$IV,1$----07/13/07 14:54:38----$IV,0$
* Added some compiler optimizations.
* Fixed bugs in editor
$IV,1$----07/09/07 07:30:18----$IV,0$
* Added $LK,"kbd_display_special_keys","MN:kbd_display_special_keys"$.
* placed sys_cur_raw_scan_code into upper DWORD of sys_cur_scan_code.
* R("TranslateScanCode", "ScanCodeToASCII");
* Removed $FG,2$name$FG$ parameter from $LK,"AFGetKey","MN:AFGetKey"$() and $LK,"AFGetChar","MN:AFGetChar"$().
$IV,1$----07/08/07 08:22:53----$IV,0$
* Added keyname display to wallpaper for making movies.
$IV,1$----07/07/07 02:22:45----$IV,0$
* Discovered subscript key needed to be changed. Now, CTRL-P and CTRL-SHIFT-P toggle super/sub scripts.
$IV,1$----07/06/07 23:42:59----$IV,0$
* Decided to make screen size fixed. Do the following text replacements on your code:
$ID,2$R("grwidth","GR_WIDTH");
R("grheight","GR_HEIGHT");
R("text_rows","TEXT_ROWS");
R("text_cols","TEXT_COLS");
R("GR_BLACK","BLACK"); //do all colors
The video mode prompt was removed, so modify $LK,"Auto","MN:Auto"$() strings for compiling the kernel.
$ID,-2$
$IV,1$----07/02/07 19:18:08----$IV,0$
* Added $LK,"SpawnUser","MN:SpawnUser"$().
* Changed $LK,"Edit","MN:Edit"$() and $LK,"DoForm","MN:DoForm"$() so they run the ltf entry they exit on.
* Changed $LK,"WsInit","MN:WsInit"$() to take full filename mask. Filters-out non text files.
$IV,1$----06/22/07 18:12:48----$IV,0$
* This is funny--I fixed a bug in the compiler which made ";" on a do while optional.
$IV,1$----06/21/07 16:11:14----$IV,0$
* Renamed "HeapChk" to "HeapWalk"
* Renamed "HeapChkOn/HeapChkOff" to "HeapLog(ON/OFF)" and "HeapChkRep" to "HeapLogRep".
* Made $LK,"AbsI8","MN:AbsI8"$() internal.
* Improved $LK,"Line","MN:Line"$().
* Added $LK,"::/LT/Demo/GameStarters/FlightSim.CPZ","FI:::/LT/Demo/GameStarters/FlightSim.CPZ"$
* Fixed bug in compiler related to mutlidimensional arrays of size less than 8 byte elements.
$IV,1$----06/19/07 00:37:08----$IV,0$
* $BK,1$Uploaded V3.03$BK,0$
* Made on Gs->grbase for each core and they get merged together, so you can do mutlicore screen operations. See $LK,"::/LT/Demo/MultiCore2.CPZ","FI:::/LT/Demo/MultiCore2.CPZ"$.
$IV,1$----06/15/07 05:05:19----$IV,0$
* Added GrElem transformation. Doesn't work on some element types.
$IV,1$----06/10/07 17:39:35----$IV,0$
* $BK,1$Uploaded V3.02$BK,0$
* Added $LK,"PicWords","HI:PicWords"$
* Changed $LK,"mp_heap","MN:mp_heap"$ from write-through to uncached.
* Modified $LK,"MPQueueJob","MN:MPQueueJob"$()
$IV,1$----05/29/07 18:33:01----$IV,0$
* Added $LK,"GrText","MN:GrText"$(). Added it to GrElems.
* Modified $LK,"WallPaper","MN:WallPaper"$() to calc mem less often.
$IV,1$----05/16/07 01:34:25----$IV,0$
* Fixed bug where buttons weren't unchecked.
$IV,1$----05/14/07 20:18:26----$IV,0$
* Added new profiler mode. $LK,"ProfAll","MN:ProfAll"$() and $LK,"ProfBin","MN:ProfBin"$().
+160
View File
@@ -0,0 +1,160 @@
$WW,1$$TR,"Task"$
$ID,2$A "task" is the Intel term for a "process". Each task has a $LK+S,"TssStruct","MN:TssStruct"$, the name derived from "Task State Something". The "$FG,2$Fs$FG$" segment register is maintained pointing to the current TssStruct. There is only one window per task.
$ID,-2$$TR,"Adam Task"$
$ID,2$This is Adam, as in Adam and Eve, the parent of all tasks. This task is created at start-up and appears in the small window at the top beneath the user windows. On it's heap are all mem objects which are system wide. When created, it runs the file $LK,"::/LT/OSMain/AdamK.APZ","FI:::/LT/OSMain/AdamK.APZ"$$ER$ Normally, AdamK.APZ ends by $FG,2$#include$FG$ $LK,"::/LT/Adam/Adam2.APZ","FI:::/LT/Adam/Adam2.APZ"$ where the remainder of the operating system is "$FG,2$#include$FG$d". When start-up is finished, the adam task enters a server mode where it accepts requests from other tasks. The $LK,"Adam","MN:Adam"$("") routine will cause the adam task to compile and run text source code. "$FG,2$#include$FG$" statements can be sent to the $LK,"Adam","MN:Adam"$("") routine, creating system-wide code and data which don't disappear when any particular task ends. (The Adam task is immortal.)
$ID,-2$$TR,"Cain Task"$
$ID,2$This is Cain, as in Adam and Eve's child. Each CPU has a special task which is immortal and which is special. The Adam task on CPU#0 is also it's Cain task.
$ID,-2$$TR,"Parent/Child Task"$
$ID,2$Often a task will $LK,"Spawn","MN:Spawn"$() or $LK,"PopUp","MN:PopUp"$() a task as a helper. The helper is known as a Child Task, though you can $FG,2$Spawn$FG$ a task and assign it a different parent... like Adam. Links are kept as to who Spawned what so that when one task is $LK,"Kill","MN:Kill"$()ed the helper tasks disappear, too. You see a report on current system tasks with $LK+S,"TaskRep","MN:TaskRep"$(). There is just one possible window per task, so child tasks are needed.
$ID,-2$$TR,"C+"$
$ID,2$The language used by LoseThos is more than "$FG,2$C$FG$" and less than "$FG,2$C++$FG$", so it's just "$FG,2$C+$FG$". It has the default parameter feature of $FG,2$C++$FG$ and uses $FG,2$class$FG$ in place of $FG,2$struct$FG$. It uses $FG,2$U1,U2,U4,U8$FG$ and $FG,2$I1,I2,I4,I8$FG$ for signed and unsigned integers. It has a slightly different operator precidence. See $LK,"OP_Precidence","FA:::/LT/Compiler/CmpInit.CPZ,OP_Precidence"$ It has the $FG,2$PASCAL$FG$ like feature of function calls with no parens, but requires an "$FG,2$&$FG,2$$FG$" when referring to a function address.
$ID,-2$$TR,"Static Compiled Mode"$
$ID,2$I coined this term to refer to conventional compilation mode, but it is not the preferred mode for this operating system and is discouraged. "$FG,2$.BI?$FG$" files are created directly, skipping "$FG,2$.OBJ$FG$" files. In this mode, code and data are contiguous. After compiling, you do a $LK,"Load","MN:Load"$() cmd which is available from right-clicking on a link (like from $LK,"Dir","MN:Dir"$()). There is no "$FG,2$main()$FG$" routine. Instead, statements outside functions are automatically executed upon loading. There is no way to unload except by killing the task. To invoke $FG,2$Static Compiled Mode$FG$, use the $LK,"CompileFile","MN:CompileFile"$() routine or right-click on a link. The OSmain and compiler are made in static compiled mode and stored in "$FG,2$Boot.BIC$FG$" and "$FG,2$Compiler.BIZ$FG$".
$ID,-2$$TR,"Dynamic Compiled Mode"$
$ID,2$I coined this term to refer to the mode when the compiler allocates objects(code and data) from the heap, noncontiguously. This mode is used during command-line operations. When you "$FG,2$#include$FG$" a file, it is compiled function by function and objects are placed all over in mem. The $LK,"ExecuteFile","MN:ExecuteFile"$() routine is the same as "$FG,2$#include$FG$" but can be placed in programs. $LK,"ExecuteStr","MN:ExecuteStr"$() routine will compile and run a str. "$FG,2$asm{}$FG$" cmds are not allowed in Dynamic mode.
$ID,-2$$TR,"Compiler Intermediate Code"$
$ID,2$The compiler generates instructions one step before making actual assembly(machine) language instructions. This code is reverse polish in nature and can be viewed with $LK,"PTrace","MN:PTrace"$() or $LK,"OTrace","MN:OTrace"$(). The compiler does not "interpret" code, except in the process of optimization. The assembly language can be viewed when it is compiled with the $LK,"CTrace","MN:CTrace"$() routine, or afterward with $LK,"Dasm","MN:Dasm"$().
$ID,-2$$TR,"File Partition"$
$ID,2$There are physical partitions on disks and then there are virtual partitions which are stored in files on other partitions. This is a LoseThos feature. You can create a file partition using AddDrives or at the prompt when you recompile the operating system. Enter the filename including the drive letter. If you answer "Yes" to the prompt on reformating, this partition will be reformatted each time you use it for the first time after booting. The original purpose of file partitions was as a holding area to collect files to write to a CD-ROM. Use the file partition's letter when calling $LK,"CreateCDFile","MN:CreateCDFile"$().
$ID,-2$$TR,"Hard-coded"$
$ID,2$When you use a raw number instead of a $FG,2$#define$FG$'ed label, that's called "hard-coding". Use labels whenever possible or your programs will fail if numbers change when the operating system is updated.
$ID,-2$
$LK,"AutoFile","HI:AutoFile"$
$LK,"Graphic Element","HI:Graphics/GrElem"$
$LK,"Hash Table","HI:Hash"$
$LK,"PicWords","HI:PicWords"$
$LK,"SysText","HI:Char/SysText"$
$FG,5$$TX+CX,"FileNames"$$FG$
$FG,5$Wildcards$FG$
FileName wild card matching allows "$FG,2$*$FG$" to match sequences of arbitrary characters and "$FG,2$?$FG$" for a single arbitrary character. For some commands, you can enter multiple specifiers separated by "$FG,2$;$FG$". You don't need to, but can, use "$FG,2$*.*$FG$" instead of "$FG,2$*$FG$" for filenames. You can specify names to exclude by using a "$FG,2$~$FG$".
$FG,5$*.??Z$FG$
These files are automatically compressed or uncompresses files when read or written.
$FG,5$$FG,5$*.??C$FG$
Contiguous files--NOT compressed.
$FG,5$*.TX?$FG$
Text Files
$FG,5$*.GL?$FG$
Glossary Files--WordStat will show a "$FG,2$#$FG$" next to words which are defined as anchors within glossary files.
$FG,5$*.CP?$FG$
C+ source files. The default C+ compiler type is "$FG,2$.CPZ$FG$".
$FG,5$*.SP?$FG$
C+ source files to be compiled statically.
$FG,5$*.AP?$FG$
C+ source files meant to be included into the Adam Task.
$FG,5$*.HP?$FG$
C+ source header files.
$FG,5$*.AS?$FG$
Assembly source files. The default assembler type is "$FG,2$.ASZ$FG$".
$FG,5$*.MU?$FG$
Menu/Help/Macro files
$FG,5$*.MP?$FG$
Compiler "map" files
$FG,5$*.BI?$FG$
Binary executable files, created by $LK,"CompileFile","MN:CompileFile"$() and read by $LK,"Load","MN:Load"$().
$FG,5$*.DT?$FG$
Data files
$FG,5$*.DVC$FG$
File Partition Drive (A drive stored in a file on another partition)
$FG,5$$FG,5$*.IS?$FG$
CD-ROM image file--ISO9660. To burn on other operating systems, rename "$FG,2$.ISO$FG$"
$FG,5$*.AUZ$FG$
"AutoFile" Basically a C+ program who's stdout goes to the input of a task when $LK,"AutoFile","MN:AutoFile"$() is called.
$LK,"SOURCE_FILE_MASK","MN:SOURCE_FILE_MASK"$$FG$
This $FG,2$#define$FG$ holds a list of source file extensions.
$LK,"TEXT_FILE_MASK","MN:TEXT_FILE_MASK"$$FG$
This $FG,2$#define$FG$ holds a list of text file extensions.
$FG,5$$TX+CX,"Naming conventions"$
$FG$
$FG,5$$FG$The following are rules I stick to. If you work on the operating system, it'd be good to stick with them for uniformity, but you can do what you like. Since there are no "$FG,2$namespaces$FG$" and I don't plan to implement name spaces, I highly recommend putting a 2-3 character module code prefix on symbols. e.g. "Ws","Ltf","Lex"
$FG,5$ALL_CAPS$FG$
Assembly Language labels are capitalized with underscores between words. So are $FG,2$#define$FG$'s.
$FG,5$MixedCaps$FG$
$FG,2$C+$FG$ Functions and class names are MixedCaps.
$FG,5$lower_case$FG$
Local function vars and glbl vars are lower case. Class member names are also lower_case.
$FG,5$SYSf_????$FG$
Flags which are designated with bit numbers instead of bit values are designated with a lower case "$FG,2$f$FG$".
$FG,5$CP_????$FG$
Assembly language routines which are C+ callable have a prefix "CP_".
$AN,"Fs","Fs"$
This refers to the CPU segment register called FS. This register is special in LoseThos because it points to the currently active task's $LK,"TssStruct","MN:TssStruct"$.
$AN,"Gs","Gs"$
This refers to the CPU segment register called GS. This register is special in LoseThos because it points to the currently active task's $LK,"CPUStruct","MN:CPUStruct"$.
$AN,"Tss","Tss"$
This is an Intel abbreviation for task state something. Each task has one of these structures.
$AN,"Bt,Bts,Btr,Btc","Bt,Bts,Btr,Btc"$
These are bit manipulation functions named after Intel instructions. They stand for "Bit Test", "Bit Test and Set", "Bit Test and Reset" and "Bit Test and Compliment".
$AN,"Cli,Sti","Cli,Sti"$
These functions turn on or off interrupts. They are named after the Intel instructions. "Cli" turns off interrupts.
$AN,"Heap","Heap"$
Programs can dynamically request chunks of memory allocated from a "heap" using $LK,"MAlloc","MN:MAlloc"$(). They must be sure to $LK,"Free","MN:Free"$() it when finished. Pointers are used to refer to it. The "heap" is dynamically allocated memory.
$AN,"Root","root"$
Refers to the base of a binary tree or the head of a queue.
$AN,"Join","Join"$
When two parts of a program have a common low-level routine, that routine is often labeled SomethingJoin.
$FG,5$$TX+CX,"Abreviations"$$FG$
$FG,5$Acct$FG$ Account
$FG,5$Attr$FG$ Attribute
$FG,5$Blk$FG$ Block
$FG,5$Buf$FG$ Buffer
$FG,5$Cb$FG$ Call-back (or code block)
$FG,5$Chnl$FG$ Channel
$FG,5$Cmd$FG$ Command
$FG,5$Cmp$FG$ Compiler
$FG,5$Cnt$FG$ Count
$FG,5$Ctrl$FG$ Control. The control key is indicated with "$FG,2$^$FG$" in documentation.
$FG,5$Cur$FG$ Current
$FG,5$Dbg$FG$ Debug
$FG,5$Del$FG$ Delete
$FG,5$Dev$FG$ Device
$FG,5$Dir$FG$ Directory
$FG,5$Elem$FG$ Element
$FG,5$Glbl$FG$ Global
$FG,5$Gr$FG$ Graphic
$FG,5$ip_$FG$ Input Pointer. See $LK,"::/LT/Adam/InputPointer.APZ","FI:::/LT/Adam/InputPointer.APZ"$.
$FG,5$Lex$FG$ Lexical analyser
$FG,5$Lpt$FG$ I think this stands for "line printer port". (It's a DOS term.)
$FG,5$Ltf$FG$ Linked-Text-File (doubly-linked-list of rich text and graphic cmds)
$FG,5$Mem$FG$ Memory
$FG,5$MP$FG$ MultiProcessor
$FG,5$Msg$FG$ Message
$FG,5$Num$FG$ Number
$FG,5$Ode$FG$ Ordinary differential equation
$FG,5$Pmt$FG$ Prompt
$FG,5$Ptr$FG$ Pointer
$FG,5$Rep$FG$ Report
$FG,5$Rmt$FG$ Remote
$FG,5$Rx$FG$ Receive
$FG,5$Str$FG$ String
$FG,5$Sys$FG$ System
$FG,5$Tx$FG$ Transmit
$FG,5$Var$FG$ Variable
$FG,5$Win$FG$ Window
Binary file not shown.
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
$WW,1$A $FG,2$Queue$FG$ is a bunch of $LK,"MAlloc","MN:MAlloc"$()ed chunks of memory linked together in a circle with one pointer to the $FG,2$next$FG$ value and another pointer to the $FG,2$last$FG$ value. These pointers must be stored in the first locations in the structure. Typically, you have a special head of the queue which is special and marks the start.
BIN
View File
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
BoolU4 old_io_sound=TRUE;
void SongEndTsk()
{
Sound(0);
IOSound(old_io_sound);
Exit;
}
void SongTsk()
{
I8 i;
Fs->end_task_cb=&SongEndTsk;
old_io_sound=IOSound(OFF);
ResetMusicSettings;
for (i=0;i<1;i++) {
Play("2qG3ECB2eGG3qCeFDsBGBG");
Play("2qG3ECB2eGG3qCeFDsBGBG");
Play("qEeEFqEB2eG3FetCAGqFC");
Play("EeEFqEB2eG3FetCAGqFC");
}
XTalk(Fs->parent_tss,".");
}
void SplashOnTop()
{
while (TRUE) {
WinToTop(Fs->parent_tss);
WinSync;
}
}
void StartSong()
{
Type("::/LT/Doc/StartUp.TXZ");
Fs->win_left=TEXT_COLS/4;
Fs->win_right=3*TEXT_COLS/4;
Fs->win_top=TEXT_ROWS/4;
Fs->win_bottom=3*TEXT_ROWS/4;
Spawn(&SongTsk,"Start Song",Fs);
Spawn(&SplashOnTop,"Splash On Top",Fs);
GetChar;
}
StartSong;
Binary file not shown.
Binary file not shown.
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
$WW,1$One jiffy is one time slice. $LK,"Jiffies","MN:Jiffies"$ returns time slices since boot and takes longer to compute than $LK,"GetTimeStamp","MN:GetTimeStamp"$.
$LK,"ReadSysTimer","MN:ReadSysTimer"$ reads the timer ticks since boot. It's not as fast as $LK,"GetTimeStamp","MN:GetTimeStamp"$.
Use $LK,"JIFFY_FREQ","MN:JIFFY_FREQ"$ to convert $LK,"Jiffies","MN:Jiffies"$.
Use $LK,"SYS_TIMER_FREQ","MN:SYS_TIMER_FREQ"$ to convert $LK,"ReadSysTimer","MN:ReadSysTimer"$.
Binary file not shown.
+119
View File
@@ -0,0 +1,119 @@
$WW,1$$FG,5$$IV,1$$TX+CX,"TIPS"$$IV,0$$FG$
* Turn-off or reboot($FG,2$CTRL-ALT-DEL$FG$) at any time, except during disk writes. Writes are not cached.
* If you make changes to LoseThos files in your account directory, some will be complied at boot time, others when you open a new user window. So, you don't need to recompile the kernel ($FG,2$OSMain$FG$). You should have two LoseThos partitions on your hard drive because a syntax error in a start-up file will make the partition unbootable. Boot to the second partition and fix it, or boot to a CD-ROM and use $LK,"AddDrives","MN:AddDrives"$() to mount your hard drive.
* Press the $FG,2$WINDOW$FG$'s key at the command line to access your macro/menu area. Place macros there with $FG,2$CTRL-L$FG$, or icon-like pictures with $FG,2$CTRL-R$FG$. Use the "$FG,2$Pop-Up$FG$" option on macros to $LK,"Spawn","MN:Spawn"$() a task to run a file. It dies when it is finished. This returns memory to the system. Be sure to press $FG,2$CTRL-S$FG$ to save your macro/menu area after making changes.
* You can adjust the number of answers displayed by setting $FG,2$Fs->answers_displayed$FG$ to a number from 0-8 in your $LK,"HOME/User.CPZ","FI:HOME/User.CPZ"$ file.
* You can adjust the mouse movement rate by setting global variables in your start-up file. See $LK,"mouse_scale","FA:HOME/Adam3.APZ,mouse_move_scale"$.
* You can set your local time zone by setting the $LK,"local_time_offset","MN:local_time_offset"$ global variable in a start-up file. It's units are $LK,"LTDATE_FREQ","MN:LTDATE_FREQ"$. See $LK,"local time","FF:HOME/Adam3.APZ,local_time"$.
* You can define or redefine behavior of all keys in your $LK,"MyPutKey","MN:MyPutKey"$() routine.
* You can use "$FG,2$ans0$FG$","$FG,2$ans1$FG$", etc in expressions. You can use the cmd prompt as a calculator by just entering expressions like "$FG,2$1+2*3;$FG$". $FG,2$double$FG$ results can be accessed with "$FG,2$ansd0$FG$" or "$FG,2$ansd1$FG$".
* You can recompile and reinstall the kernel with $LK,"InstallBoot","MN:InstallBoot"$(). You'll probably want to make a function for recompiling that uses the $LK,"Auto","MN:Auto"$() function to answer the config questions.
* You can disable $FG,2$WORDSTAT$FG$ commenting-out $LK,"WsInit","FF:HOME/Adam3.APZ,WsInit"$() and the $LK,"Spawn","MN:Spawn"$() in $LK,"HOME/Adam3.APZ","FF:HOME/Adam3.APZ,WsInit"$.
* You can disable MutliCore by commenting-out $LK,"MPStart","FF:HOME/Adam3.APZ,MPStart"$ in $LK,"HOME/Adam3.APZ","FF:HOME/Adam3.APZ,MPStart"$.
* You can use $LK,"progress1","MN:progress1"$-$LK,"progress4","MN:progress4"$ in your programs for whatever you like. They're just global variables that are shown on the wallpaper. The original intent was to indicate how far along operations were. There's no coordination, so different apps might interfere. I use them most for debugging--just values easily viewed.
* Use $LK,"LtfMax","MN:LtfMax"$() to adjust the size of the cmd line buf. It counts $LK,"Ltf","MN:Ltf"$ entries, not lines.
* You can get rid of the splash screen by commenting-out the start song in $LK,"HOME/Adam3.APZ","FF:HOME/Adam3.APZ,StartSong"$.
* You can reduce memory usage by making a smaller disk cache when you recompile the kernel; disabling $FG,2$WORDSTAT$FG$; Specifying smaller stack sizes when doing $LK,"Spawn","MN:Spawn"$(), changing $LK,"DEFAULT_STACK","MN:DEFAULT_STACK"$, and using $LK,"LtfMax","MN:LtfMax"$() to reduce the command line buffer size.
* Filenames ending in "$FG,2$Z$FG$" will be automatically compressed and uncompressed when read or written. The compression method is not supported by other operating systems. You can store files uncompressed by $LK,"Move","MN:Move"$()ing them to a filename not ending in "$FG,2$Z$FG$". See $LK,"::/LT/Doc/LTZ.TXZ","FI:::/LT/Doc/LTZ.TXZ"$ if you want to uncompress while in $FG,2$WINDOWS$FG$.
* The joystick can be recalibrated with $LK,"JoyCalibration","MN:JoyCalibration"$().
* $LK,"MergeChk","MN:MergeChk"$() can be used to see what's changed. The "$FG,2$+d$FG$" flag will show differences of files which have changed and allow you to merge code. (The "$FG,2$+r$FG$" flag will recurse.)
* There is a utility $LK,"LinkChk","MN:LinkChk"$() which will check for broken links in documentation.
* Use $LK,"Plain","MN:Plain"$() to edit a plain text file. You'll need this if your file has $FG,2$$$$FG$'s.
* Use $LK,"Silent","MN:Silent"$() to disable screen text output.
* Use $LK,"IOSound","MN:IOSound"$() to disable noise from disk access.
* There are handy functions--$FG,2$F(),R(),FD()$FG$ and $FG,2$RD()$FG$ which are defined in $LK+S,"HOME/User.CPZ","FI:HOME/User.CPZ"$. You're encouraged to change them, since they're in account files. They will perform find-and-replace operations accross multiple files. The "$FG,2$+l$FG$" flag is particularly useful since it limits to whole labels. You are encouraged to add or modify handy wrapper functions to make command line operations easier.
* You can save files after making changes, anytime you are within the editor, like when viewing help/macro files. $FG,2$CTRL-A$FG$ saves as, $FG,2$CTRL-S$FG$ saves with the same name in the scrolling title bar. Hitting $FG,2$ESC$FG$ will exit and save. ($FG,2$CTRL-Q$FG$ will exit and not save). You can save the cmd line window to a file, too, since you're actually in the editor when you're at the cmd line.
* When using $FG,2$CTRL-L$FG$ to insert links in documents, you can usually leave the "Display Text" blank and it will be filled-in automatically based on other entries.
* There is a feature of the precompiler that allows code to be executed in the middle of compilation and data inserted into the compilation stream. Click here for an example: $LK,"#exe {","FF:::/LT/OSMain/OSEnd.CPZ,#exe {"$.
* If you output to the cmd line and wish to allow users to scroll around and view data, you can use $LK,"View","MN:View"$(). $LK,"Example","MN:WsPutMatrix"$
* Use $LK+S,"View","MN:View"$() in Pop-up macros to linger until the user presses $FG,2$ESC$FG$ or $FG,2$CTRL-Q$FG$.
* You can access the word under the cursor at $LK,"ws_cur_word","MN:ws_cur_word"$, but you should probably turn-off preemption or interrupts momentarily to copy it.
* You can reactivate $FG,2$WORDSTAT$FG$ after closing it by pressing $FG,2$CTRL-FUNCTION KEY$FG$.
* $LK,"Preempt","MN:Preempt"$() is used to keep a task from being interrupted and swapped-out. It has a similar effect to turning-off interrupts. Each task has it's own preemption control. A task with preemption turned-off can voluntarily $LK,"SwapInNext","MN:SwapInNext"$() with preemption off.
* You can set a color for different drives with $LK,"SetDriveTextAttr","MN:SetDriveTextAttr"$(). Place calls to this in $LK,"::HOME/User.CPZ","FI:::HOME/User.CPZ"$.
* If you toggle to plain text when you are working with graphics in a document, you can add duplicate entries for pictures by entering a "$FG,2$PI$FG$" command with the same number.
* If you toggle to plain text when working with graphics, you can add a str to the $FG,2$$$PI$$$FG$ entry to keep track of it. Try "$FG,2$$$PI,"<2>",2$$$FG$" where '2' is the picture number.
* I use spaces-to-tab operations on all my files to keep them small. You have to be careful, though, because spaces in strings will be converted. I use $FG,2$SHIFT-SPACE$FG$ ' ' in such cases. See $LK,"S2T","MN:S2T"$() for spaces-to-tabs.
* You can edit an existing Graphic Element by putting the cursor on it and pressing $FG,2$CTRL-R$FG$.
* You might want to stick with manually filling-in a GrElem by drawing lines instead of flood-fill or convert the GrElem to bitmaps. Bitmaps are a little slow and flood-fill behaves weird based on what's underneath. Artistically, you get good results with brush-strokes produced by drawing with lines.
* You can customize the "wallpaper". See $LK,"::/LT/Demo/Graphics/MyWallPaper.APZ","FI:::/LT/Demo/Graphics/MyWallPaper.APZ"$.
* You can adjust the screen refresh rate (software). It is automatically adjusted based on load. The range is $LK,"win_min_refresh","MN:win_min_refresh"$,$LK,"win_max_refresh","MN:win_max_refresh"$.
$FG,5$$IV,1$$TX+CX,"DEBUGGING"$$FG$$IV,0$
* While debugging, you specify addresses of assembly OSmain $FG,2$asm{}$FG$ routines with just the label, as in "$FG,2$CP_MALLOC+0x20$FG$". You specify $FG,2$C+$FG$ labels with "$FG,2$&$FG$" before functions as in "$FG,2$&Printf+0x10$FG$".
$LK,"D","MN:D"$() $LK,"LtfD","MN:LtfD"$() to hex dump mem with numbering from zero. With $LK,"LtfD","MN:LtfD"$ the values are updated continually and you can alter mem by editing.
$LK,"Dm","MN:Dm"$() $LK,"LtfDm","MN:LtfDm"$() to hex dump mem with addresses showing.
$LK,"Dasm","MN:Dasm"$() to disassemble mem.
$LK,"ProfBin","MN:ProfBin"$(),$LK,"ProfAll","MN:ProfAll"$() and $LK,"ProfRep","MN:ProfRep"$() provide code profiling. See $LK,"::/LT/Demo/AutoFile/Demo2.AUZ","FI:::/LT/Demo/AutoFile/Demo2.AUZ"$ (This is an "$LK,"AutoFile","FF:::/LT/Doc/OSGlossary.GLZ,AutoFile"$".)
* Use $LK,"DbgNum","MN:DbgNum"$(), $LK,"DbgStr","MN:DbgStr"$() and $LK,"DbgAdd","MN:DbgAdd"$() to print debug info bypassing the window framework. You can use $LK,"Raw","MN:Raw"$($FG,2$TRUE$FG$) to make all output bypass the window framework.
* Use $LK,"SysDbg","MN:SysDbg"$() to set a flag which you can read with $LK,"IsSysDbg","MN:IsSysDbg"$() when you wish to trigger some debug activity.
* There are flags for various trace options that can help debugging when there are compiler bugs.
$ID,2$
$LK,"Echo","MN:Echo"$() turns on or off raw data going into the lexical analyzer.
$LK,"LTrace","MN:LTrace"$() shows the tokens coming out of the lexical analyzer.
$LK,"CTrace","MN:CTrace"$() disassembles code generated from the C+ compiler.
$LK,"PTrace","MN:PTrace"$() shows "intermediate code" comming out of the first stage of the compiler (it's not 100% valid because it hasn't been fixed-up).
$LK,"OTrace","MN:OTrace"$() shows intermediate code coming-out after optimization. $LK,"OPassTraceMask","MN:OPassTraceMask"$() controls which passes are displayed.
These flags can be set and reset by placing them in "$FG,2$#exe{}$FG$" code blks.
$ID,-2$
* $FG,4$dbgo$FG$ is an alias for "$FG,2$cout$FG$" and can be used to place output. You can easily find and remove them doing a $LK,"Grep","MN:Grep"$().
* $LK,"SBpt","MN:SBpt"$() to set breakpoints. When the fault screen appears, use $LK,"Go","MN:Go"$() to continue. You can altering modify what is displayed each break-point by $LK,"HOME/Fault.CPZ","FI:HOME/Fault.CPZ"$ in your account's home directory.
* There is a heap check utility which can find leaks. Use $LK,"HeapLog","MN:HeapLog"$(), and $LK,"HeapLogRep","MN:HeapLogRep"$(). It's a really simple program which intercepts $LK,"MAlloc","MN:MAlloc"$() and $LK,"Free","MN:Free"$(). You can customize the code to find other heap issues.
* You can define functions for $FG,2$CTRL-ALT-LETTER$FG$ keys, but they must operate in a interrupt environment. You can do $LK,"Raw","MN:Raw"$() output. Scan for $LK,"ctrl_alt_letter_routines","MN:ctrl_alt_letter_routines"$[] and look at the code.
Binary file not shown.