diff --git a/_Docs/KERNEL.md b/_Docs/KERNEL.md index d4847da2..7aca7742 100644 --- a/_Docs/KERNEL.md +++ b/_Docs/KERNEL.md @@ -1,625 +1,450 @@ *** Auto generated by docgen.cmd *** - -#GetArgC -Returns argument count in the process command line. - -##In: -+ none. - -##Out: -+ A = Command line Arg Count (Including /path/cmd) - -#GetArgA - -##In: -+ A = argument index. - -##Out: -+ CC : success - + Y,A = PStr To Arg[A] -+ CS : Out Of Bound - -#FPutCAY -Print A (char) to File - -##In: -+ A : char to print -+ Y = hFILE - -##Out: -+ CC = success - -#PutCA -Print A (char) to StdOut - -##In: -+ A : char to print - -##Out: -+ CC = success - -#FGetCA -Get char from File - -##In: -+ A = hFILE - -##Out: -+ CC = success - + A = char - -#GetC -Get char from StdIn - -##In: -+ none. - -##Out: -+ CC = success - + A = char - -#FPutS -Write String to FILE - -##In: -+ PUSHW : CPtr -+ PUSHB : hFILE - -##Out: -+ CC = success - -#PutSYA -Write String to StdOut - -##In: -+ Y,A : CPtr - -##Out: -+ CC = success - -#FGetS -Read String From FILE - -##In: -+ PUSHW : CPtr -+ PUSHB : hFILE - -##Out: -+ CC = success - -#GetSYA -Read String From StdIn - -##In: -+ Y,A : CPtr - -##Out: -+ CC = success - -#SScanF -Scan a PStr (in progress) - -##In: -+ PUSHW PTR to target buffer -+ PUSHW PSTR pattern (ex: "%d.%d.%d.%d") - + %d : byte -+ PUSHW PSTR to scan (ex: "192.168.1.5") - -##Out: - -#PPrintFYA/CPrintFYA -Prints Pascal/C-Style String - -##In: -+ Y,A = PTR to PStr/CStr - + %a : pull 2 bytes to Print Access right String 'drwxrwxrwx' - + %b : pull 1 byte to Print BIN - + %B : pull 2 bytes to Print BIN - + %d : pull 1 byte unsigned DEC 0..255 - + %D : pull 2 bytes unsigned DEC 0..65535 - + %u : pull 2 bytes PTR to 4 bytes long unsigned DEC 0..4294967295 - + %e : pull 2 bytes PTR to 6 Bytes Real +1.23456789e+12 - + %f : pull 2 bytes PTR to 6 Bytes Real 3.1415 - + %h : pull 1 byte to Print HEX - + %H : pull 2 bytes to Print HEX - + %i : pull 1 byte to Print signed DEC -128..127 - + %I : pull 2 bytes to Print signed DEC -32768..32767 - + %L : pull 2 bytes PTR to 4 bytes signed DEC -2147483648..2147483647 - + %n : pull 1 byte to Print low Nibble HEX - + %N : pull 1 byte to Print high Nibble HEX - + %s : pull 2 bytes ptr to C-Style String - + %S : pull 2 bytes ptr to P-Style String - + \b : Print 'BS' (08) - + \e : Print 'ESC' ($1B,27) - + \f : Print 'FF' ($0C,12) - + \n : Print 'LF' ($0A,10) - + \r : Print 'CR' ($0D,13) - + \\\\ : Print \ - + \% : Print % -+ Modifiers for len and padding : - + %d : '9' '12' - + %2d : ' 9' '12' - + %02d : '09' '12' - + %11s : 'ABCDEFGH ' - + %011s : 'ABCDEFGH000' - + %2f : '3.14' - -##Out: -+ CC : success -+ CS : I/O error from COut - -#GetDevByIDA - -##IN: -+ A = DevID - -##OUT: -+ CC = OK, CS = ERROR -+ Y,A = DEVSLOT -+ note: X Unmodified - -#GetDevByNameYA - -##IN: -+ Y,A = Ptr to device name (PStr) - -##OUT: -+ CC = OK, CS = ERROR -+ X = DEVID -+ Y,A = DEVSLOT - -#GetDevStatusA - -##IN: -+ A = DevID - -##OUT: -+ CC = OK, CS = ERROR -+ Y,A = Ptr to S.DEVINFO - -#MkNodYA -return a hFile for a given Device Name - -##IN: -+ Y,A=DevName - -##OUT: -+ CC = OK, CS = ERROR -+ A = hFILE - -#MkNodA -return a hFile for a given Socket - -##IN: -+ A=hSocket - -##OUT: -+ CC = OK, CS = ERROR -+ A = hFILE - -#MKFIFO -return a S.FILE to a new FIFO - -##IN: - -##OUT: -+ CC = OK, CS = ERROR -+ A = hFILE - -#OpenDirYA - -##In: -+ Y,A = PATH (PSTR) - -##Out: -+ CC : success - + A = hDIR -+ CS : error - + A = EC - -#ReadDirA - -##In: -+ A = hDIR - -##Out: -+ CC : success - + X = hDIRENT - + Y,A = PTR to S.DIRENT -+ CS : error - + A = EC - + note : A = 0 means no more entry - -#CloseDirA - -##In: -+ A = hDIR - -##Out: -+ none, always succeed. - -#MKDirYA - -##In: -+ Y,A = DIR name - -##Out: -+ CC : success -+ CS : error - + A = EC - -#ExpandPStrYA - -##In: -+ Y,A = PTR to String to Expand (PSTR) - -##Out: -+ X = hMem to Expanded String (PSTR) -+ Y,A = PTR to Expanded String - -#PutEnvYA - -##In: -+ Y,A = PTR to String NAME=VALUE (PSTR) - -##Out: - -#SetEnv - -##In: -+ PUSHW = PTR To Value (PSTR) -+ PUSHW = PTR To Name (PSTR) - -##Out: - -#GetEnvYA - -##In: -+ Y,A = PTR to NAME (PSTR) - -##Out: -+ CC : Y,A = PTR to VALUE (PSTR) -+ CS : not found - -#UnsetEnvYA - -##In: -+ Y,A = PTR To Name (PSTR) - -##Out: - -#FOpen -Open a file - -##In : -+ PUSHW = AUXTYPE -+ PUSHB = TYPE -+ PUSHB = MODE - + SYS.FOpen.R : if R and exists -> ERROR - + SYS.FOpen.W : if W and exists -> CREATE - + SYS.FOpen.A : Append - + SYS.FOpen.T : Open/Append in Text mode - + SYS.FOpen.X : Create if not exists -+ PUSHW = PATH (PSTR) - -##Out : -+ CC : A = hFILE -+ CS : A = EC - -#FCloseA -Close a file - -##In : -+ A = hFILE - -##Out : - -#FReadA -Read ONE byte from file - -##In : -+ A = hFILE - -##Out : -+ A = Byte Read - -#FWriteAY - -##In: -+ A = hFILE -+ Y = char - -#Out: -+ Y,A = Bytes Written - -#FRead -Read bytes from file - -##In : -+ PUSHW = Dest Ptr -+ PUSHW = Bytes To Read -+ PUSHB = hFILE - -##Out : -+ Y,A = Bytes Read - -#FWrite - -##In: -+ PUSHW = Src Ptr -+ PUSHW = Bytes To Write -+ PUSHB = hFILE - -#Out: -+ Y,A = Bytes Written - -#FFlushA - -##In: -+ A = hFILE - -#FSeek - -##In: -+ PUSHW = OffsetHi -+ PUSHW = OffsetLo -+ PUSHB = From -+ PUSHB = hFILE - -#FTellA - -##In: -+ A = hFILE - -##Out: - + Y,A,X = Offset - -#FEOFA - -##In: -+ A = hFILE - -##Out: -+ CC : - + A=0 EOF - + A =0 NOT EOF -+ CS : - -#RemoveYA - -#Rename -Rename a file - -##In : -+ PUSHW = New Name -+ PUSHW = Old Name - -##Out : - -#Stat -Return information about a file - -##In : -+ PUSHW = PTR to S.STAT buffer -+ PUSHW = PTR to Filename (PSTR) - -##Out : - -#FileSearch -Search a file in the provided PATH list -And return, if found, the full path to it. - -##In: -+ PUSHW = Ptr to Search Path (PSTR) %LIB%;/SYS/SLIB -+ PUSHW = Ptr to File Name (PSTR) - -##Out: -+ CC : success - + Y,A = PSTR to FilePath (PSTR) - + X = hMem to FilePath -+ CS : not found - -#GetFullPathYA - -##In : -+ Y,A = Filename (PSTR) - -##Out : -+ CC : success - + Y,A = FullPath (PSTR) - + X = hMem of FullPath -+ CS : A = Error Code - -#LoadFile - -##In: -+ PUSHW = AUXTYPE (Handled by.... -+ PUSHB = TYPE ... -+ PUSHB = MODE ... -+ PUSHW = PATH ...FOpen) - -##Out: -+ Y,A = File Length -+ X = hMem of Loaded File - -#SaveFile - -##In: -+ PUSHW = SrcLen -+ PUSHW = SrcPtr -+ PUSHW = AUXTYPE (Handled by.... -+ PUSHB = TYPE ... -+ PUSHB = MODE ... -+ PUSHW = PATH ...FOpen) - -#GetMem - -##In: -+ PUSHW = Size Requested -+ PUSHB = Options - + S.MEM.F.INIT0 : init memory with 00 - + S.MEM.F.ALIGN : page aligned - -##Out: -+ CC : success - + YA = PTR to Mem -* X = hMem -+ CS : - + A = EC - -#FreeMemA - -##In: -+ A = hMem To Free - -##Out: -+ none. -+ (X,Y unmodified) - -#GetMemPtrA - -##In: -+ A = hMem - -##Out: -+ Y,A = PTR to MemBlock -+ (X unmodified) - -#GetMemByIDA - -##In: -+ A = hMem - -##Out: -+ Y,A = ZPMemMgrSPtr = PTR to S.MEM -+ X unmodified - -#GetMemStatYA - -##In: -+ Y,A = 24 bytes buffer - -##Out: -+ Buffer filled with memory stats - -#ExecProcessNewEnvYA - -#ExecProcessYA (Blocking Parent PID) - -#CreateProcessNewEnvYA - -#CreateProcessYA (Non Blocking) - -##In: - + Y,A = PTR To Cmd Line - -##Out: - + A = Child PSID - -#GetPSByIDA - -##In : -+ A = PID - -##Out : -+ Y,A = PTR to TSKSLOT - -#Sleep -Make current process suspend until next RUN - -##In : -+ (none) - -##Out : -+ (none) - -#NewPStrYA -Create a new copy of PSTR - -##In: -+ Y,A = PTR to buffer - -##Out: -+ CC : success - + Y,A = PTR to String - + X = hMem (PSTR) -+ CS : error - + A = SYS error code - -#PStrCpy -Copy string - -##In: -+ PUSHW = Ptr to SRC (PSTR) -+ PUSHW = Ptr to DST (PSTR) - -##Out: -+ DST = SRC (PSTR) - -#PStrCat -Append SRC to DST - -##In: -+ PUSHW = Ptr to SRC (PSTR) -+ PUSHW = Ptr to DST (PSTR) - -##Out: -+ DST = DST+SRC (PSTR) - -#PStrMatch -Compare a String against pattern - -##In: - + PUSHW = PTR to Pattern (e.g. '*test?.txt') - + PUSHW = PTR to Src String - -##Out: - + CC : match - + CS : no match - -#PStrUprYA/PStrLwrYA -Convert string to UPPERCASE/lowercase - -##In: - + Y,A = PTR to String (PSTR) - -##Out: - + Uppercased/lowercased String in Buffer - -#PStrFTime -Convert S.TIME struct to PSTR - -##In: -+ PUSHW = Dst PTR To PSTR Buf -+ PUSHW = Src PTR To Format String - + %a : Abbreviated weekday name : Thu - + %A : Full weekday name : Thursday - + %b : Abbreviated month name : Aug - + %B : Full month name : August - + %d : Day of the month, zero-padded (01-31) - + %H : Hour in 24h format (00-23) 14 - + %I : Hour in 12h format (01-12) 02 - + %m : Month as a decimal number (01-12) 08 - + %M : Minute (00-59) 55 - + %p : AM or PM designation PM - + %S : Second (00-61) 02 - + %w : Weekday as a decimal number with Sunday as 0 (0-6) - + %y : Year, last two digits (00-99) - + %Y : Year four digits 2001 -+ PUSHW = Src PTR To S.Time - -##Out: - + none. always succeed. - -#PStr2StrArrayYA -Convert a PSTR (e.g. : command Line) to a Array of PSTRs (Args[]) - -##In: -+ Y,A = PTR to String - -##Out: -+ CC : success - + Y,A = PTR to StrArray - + X = hMem -+ CS : error - + A = SYS error code +#GetArgC +Returns argument count in the process command line. +##In: ++ none. +##Out: ++ A = Command line Arg Count (Including /path/cmd) +#GetArgA +##In: ++ A = argument index. +##Out: ++ CC : success + + Y,A = PStr To Arg[A] ++ CS : Out Of Bound +#FPutCAY +Print A (char) to File +##In: ++ A : char to print ++ Y = hFILE +##Out: ++ CC = success +#PutCA +Print A (char) to StdOut +##In: ++ A : char to print +##Out: ++ CC = success +#FGetCA +Get char from File +##In: ++ A = hFILE +##Out: ++ CC = success + + A = char +#GetC +Get char from StdIn +##In: ++ none. +##Out: ++ CC = success + + A = char +#FPutS +Write String to FILE +##In: ++ PUSHW : CPtr ++ PUSHB : hFILE +##Out: ++ CC = success +#PutSYA +Write String to StdOut +##In: ++ Y,A : CPtr +##Out: ++ CC = success +#FGetS +Read String From FILE +##In: ++ PUSHW : CPtr ++ PUSHB : hFILE +##Out: ++ CC = success +#GetSYA +Read String From StdIn +##In: ++ Y,A : CPtr +##Out: ++ CC = success +#SScanF +Scan a PStr (in progress) +##In: ++ PUSHW PTR to target buffer ++ PUSHW PSTR pattern (ex: "%d.%d.%d.%d") + + %d : byte ++ PUSHW PSTR to scan (ex: "192.168.1.5") +##Out: +#PPrintFYA/CPrintFYA +Prints Pascal/C-Style String +##In: ++ Y,A = PTR to PStr/CStr + + %a : pull 2 bytes to Print Access right String 'drwxrwxrwx' + + %b : pull 1 byte to Print BIN + + %B : pull 2 bytes to Print BIN + + %d : pull 1 byte unsigned DEC 0..255 + + %D : pull 2 bytes unsigned DEC 0..65535 + + %u : pull 2 bytes PTR to 4 bytes long unsigned DEC 0..4294967295 + + %e : pull 2 bytes PTR to 6 Bytes Real +1.23456789e+12 + + %f : pull 2 bytes PTR to 6 Bytes Real 3.1415 + + %h : pull 1 byte to Print HEX + + %H : pull 2 bytes to Print HEX + + %i : pull 1 byte to Print signed DEC -128..127 + + %I : pull 2 bytes to Print signed DEC -32768..32767 + + %L : pull 2 bytes PTR to 4 bytes signed DEC -2147483648..2147483647 + + %n : pull 1 byte to Print low Nibble HEX + + %N : pull 1 byte to Print high Nibble HEX + + %s : pull 2 bytes ptr to C-Style String + + %S : pull 2 bytes ptr to P-Style String + + \b : Print 'BS' (08) + + \e : Print 'ESC' ($1B,27) + + \f : Print 'FF' ($0C,12) + + \n : Print 'LF' ($0A,10) + + \r : Print 'CR' ($0D,13) + + \\\\ : Print \ + + \% : Print % ++ Modifiers for len and padding : + + %d : '9' '12' + + %2d : ' 9' '12' + + %02d : '09' '12' + + %11s : 'ABCDEFGH ' + + %011s : 'ABCDEFGH000' + + %2f : '3.14' +##Out: ++ CC : success ++ CS : I/O error from COut +#GetDevByIDA +##IN: ++ A = DevID +##OUT: ++ CC = OK, CS = ERROR ++ Y,A = DEVSLOT ++ note: X Unmodified +#GetDevByNameYA +##IN: ++ Y,A = Ptr to device name (PStr) +##OUT: ++ CC = OK, CS = ERROR ++ X = DEVID ++ Y,A = DEVSLOT +#GetDevStatusA +##IN: ++ A = DevID +##OUT: ++ CC = OK, CS = ERROR ++ Y,A = Ptr to S.DEVINFO +#MkNodYA +return a hFile for a given Device Name +##IN: ++ Y,A=DevName +##OUT: ++ CC = OK, CS = ERROR ++ A = hFILE +#MkNodA +return a hFile for a given Socket +##IN: ++ A=hSocket +##OUT: ++ CC = OK, CS = ERROR ++ A = hFILE +#MKFIFO +return a S.FILE to a new FIFO +##IN: +##OUT: ++ CC = OK, CS = ERROR ++ A = hFILE +#OpenDirYA +##In: ++ Y,A = PATH (PSTR) +##Out: ++ CC : success + + A = hDIR ++ CS : error + + A = EC +#ReadDirA +##In: ++ A = hDIR +##Out: ++ CC : success + + X = hDIRENT + + Y,A = PTR to S.DIRENT ++ CS : error + + A = EC + + note : A = 0 means no more entry +#CloseDirA +##In: ++ A = hDIR +##Out: ++ none, always succeed. +#MKDirYA +##In: ++ Y,A = DIR name +##Out: ++ CC : success ++ CS : error + + A = EC +#ExpandPStrYA +##In: ++ Y,A = PTR to String to Expand (PSTR) +##Out: ++ X = hMem to Expanded String (PSTR) ++ Y,A = PTR to Expanded String +#PutEnvYA +##In: ++ Y,A = PTR to String NAME=VALUE (PSTR) +##Out: +#SetEnv +##In: ++ PUSHW = PTR To Value (PSTR) ++ PUSHW = PTR To Name (PSTR) +##Out: +#GetEnvYA +##In: ++ Y,A = PTR to NAME (PSTR) +##Out: ++ CC : Y,A = PTR to VALUE (PSTR) ++ CS : not found +#UnsetEnvYA +##In: ++ Y,A = PTR To Name (PSTR) +##Out: +#FOpen +Open a file +##In : ++ PUSHW = AUXTYPE ++ PUSHB = TYPE ++ PUSHB = MODE + + SYS.FOpen.R : if R and exists -> ERROR + + SYS.FOpen.W : if W and exists -> CREATE + + SYS.FOpen.A : Append + + SYS.FOpen.T : Open/Append in Text mode + + SYS.FOpen.X : Create if not exists ++ PUSHW = PATH (PSTR) +##Out : ++ CC : A = hFILE ++ CS : A = EC +#FCloseA +Close a file +##In : ++ A = hFILE +##Out : +#FReadA +Read ONE byte from file +##In : ++ A = hFILE +##Out : ++ A = Byte Read +#FWriteAY +##In: ++ A = hFILE ++ Y = char +#Out: ++ Y,A = Bytes Written +#FRead +Read bytes from file +##In : ++ PUSHW = Dest Ptr ++ PUSHW = Bytes To Read ++ PUSHB = hFILE +##Out : ++ Y,A = Bytes Read +#FWrite +##In: ++ PUSHW = Src Ptr ++ PUSHW = Bytes To Write ++ PUSHB = hFILE +#Out: ++ Y,A = Bytes Written +#FFlushA +##In: ++ A = hFILE +#FSeek +##In: ++ PUSHW = OffsetHi ++ PUSHW = OffsetLo ++ PUSHB = From ++ PUSHB = hFILE +#FTellA +##In: ++ A = hFILE +##Out: + + Y,A,X = Offset +#FEOFA +##In: ++ A = hFILE +##Out: ++ CC : + + A=0 EOF + + A =0 NOT EOF ++ CS : +#RemoveYA +#Rename +Rename a file +##In : ++ PUSHW = New Name ++ PUSHW = Old Name +##Out : +#Stat +Return information about a file +##In : ++ PUSHW = PTR to S.STAT buffer ++ PUSHW = PTR to Filename (PSTR) +##Out : +#FileSearch +Search a file in the provided PATH list +And return, if found, the full path to it. +##In: ++ PUSHW = Ptr to Search Path (PSTR) %LIB%;/SYS/SLIB ++ PUSHW = Ptr to File Name (PSTR) +##Out: ++ CC : success + + Y,A = PSTR to FilePath (PSTR) + + X = hMem to FilePath ++ CS : not found +#GetFullPathYA +##In : ++ Y,A = Filename (PSTR) +##Out : ++ CC : success + + Y,A = FullPath (PSTR) + + X = hMem of FullPath ++ CS : A = Error Code +#LoadFile +##In: ++ PUSHW = AUXTYPE (Handled by.... ++ PUSHB = TYPE ... ++ PUSHB = MODE ... ++ PUSHW = PATH ...FOpen) +##Out: ++ Y,A = File Length ++ X = hMem of Loaded File +#SaveFile +##In: ++ PUSHW = SrcLen ++ PUSHW = SrcPtr ++ PUSHW = AUXTYPE (Handled by.... ++ PUSHB = TYPE ... ++ PUSHB = MODE ... ++ PUSHW = PATH ...FOpen) +#GetMem +##In: ++ PUSHW = Size Requested ++ PUSHB = Options + + S.MEM.F.INIT0 : init memory with 00 + + S.MEM.F.ALIGN : page aligned +##Out: ++ CC : success + + YA = PTR to Mem +* X = hMem ++ CS : + + A = EC +#FreeMemA +##In: ++ A = hMem To Free +##Out: ++ none. ++ (X,Y unmodified) +#GetMemPtrA +##In: ++ A = hMem +##Out: ++ Y,A = PTR to MemBlock ++ (X unmodified) +#GetMemByIDA +##In: ++ A = hMem +##Out: ++ Y,A = ZPMemMgrSPtr = PTR to S.MEM ++ X unmodified +#GetMemStatYA +##In: ++ Y,A = 24 bytes buffer +##Out: ++ Buffer filled with memory stats +#ExecProcessNewEnvYA +#ExecProcessYA (Blocking Parent PID) +#CreateProcessNewEnvYA +#CreateProcessYA (Non Blocking) +##In: + + Y,A = PTR To Cmd Line +##Out: + + A = Child PSID +#GetPSByIDA +##In : ++ A = PID +##Out : ++ Y,A = PTR to TSKSLOT +#Sleep +Make current process suspend until next RUN +##In : ++ (none) +##Out : ++ (none) +#NewPStrYA +Create a new copy of PSTR +##In: ++ Y,A = PTR to buffer +##Out: ++ CC : success + + Y,A = PTR to String + + X = hMem (PSTR) ++ CS : error + + A = SYS error code +#PStrCpy +Copy string +##In: ++ PUSHW = Ptr to SRC (PSTR) ++ PUSHW = Ptr to DST (PSTR) +##Out: ++ DST = SRC (PSTR) +#PStrCat +Append SRC to DST +##In: ++ PUSHW = Ptr to SRC (PSTR) ++ PUSHW = Ptr to DST (PSTR) +##Out: ++ DST = DST+SRC (PSTR) +#PStrMatch +Compare a String against pattern +##In: + + PUSHW = PTR to Pattern (e.g. '*test?.txt') + + PUSHW = PTR to Src String +##Out: + + CC : match + + CS : no match +#PStrUprYA/PStrLwrYA +Convert string to UPPERCASE/lowercase +##In: + + Y,A = PTR to String (PSTR) +##Out: + + Uppercased/lowercased String in Buffer +#PStrFTime +Convert S.TIME struct to PSTR +##In: ++ PUSHW = Dst PTR To PSTR Buf ++ PUSHW = Src PTR To Format String + + %a : Abbreviated weekday name : Thu + + %A : Full weekday name : Thursday + + %b : Abbreviated month name : Aug + + %B : Full month name : August + + %d : Day of the month, zero-padded (01-31) + + %H : Hour in 24h format (00-23) 14 + + %I : Hour in 12h format (01-12) 02 + + %m : Month as a decimal number (01-12) 08 + + %M : Minute (00-59) 55 + + %p : AM or PM designation PM + + %S : Second (00-61) 02 + + %w : Weekday as a decimal number with Sunday as 0 (0-6) + + %y : Year, last two digits (00-99) + + %Y : Year four digits 2001 ++ PUSHW = Src PTR To S.Time +##Out: + + none. always succeed. +#PStr2StrArrayYA +Convert a PSTR (e.g. : command Line) to a Array of PSTRs (Args[]) +##In: ++ Y,A = PTR to String +##Out: ++ CC : success + + Y,A = PTR to StrArray + + X = hMem ++ CS : error + + A = SYS error code diff --git a/_Docs/LIBBLKDEV.md b/_Docs/LIBBLKDEV.md index ec4c91c6..7b8378d3 100644 --- a/_Docs/LIBBLKDEV.md +++ b/_Docs/LIBBLKDEV.md @@ -1,52 +1,41 @@ *** Auto generated by docgen.cmd *** - -#GetProDOSCatSize -+ Compute space needed for ProDOS Catalog - -##In : -+ PUSHW = DevSize (in 512b blocks) - -##Out : -+ X=BlockCount (max 22) -+ A=PageCount (max 44) - -#BuildProDOSCat - -##In : -+ PUSHW = DevSize (in 512b blocks) -+ PUSHW = VolName (PSTR) -+ PUSHW = DstBuf (Zero filled) - + Blk0 : ProDOS.BootBlk - + Blk1 : SOS.BootBlk - + Blk2,3,4,5 : Volume Directory - + Blk6.... : Volume Bitmap (4096/Blk) - + max devSize = 65535 -> max 16 Bitmap Blk - + absolute MAX DstBuf size= - + 7 for Disk II(280blk),3.5(1600),3.5HD(2880) - + 22 for 32mb Hardisk... - -#TrkW16s -Write a track (16 sectors) - -##In: -+ PUSHW = Ptr to 16*256 buffer -+ PUSHB = TrackNum * 4 : 0->140+ -+ PUSHB = DSSS0000 - -##Out: -+ CC : success -+ CS : A = Error - + A=0, currently starting/seeking... - -#TrkWNIB -Write a track (NIBBLE) - -##In: -+ PUSHW = Ptr to NIBBLE buffer (0 ended) -+ PUSHB = TrackNum * 4 : 0->140+ -+ PUSHB = DSSS0000 - -##Out: -+ CC : success -+ CS : A = Error - + A=0, currently starting/seeking... +#GetProDOSCatSize ++ Compute space needed for ProDOS Catalog +##In : ++ PUSHW = DevSize (in 512b blocks) +##Out : ++ X=BlockCount (max 22) ++ A=PageCount (max 44) +#BuildProDOSCat +##In : ++ PUSHW = DevSize (in 512b blocks) ++ PUSHW = VolName (PSTR) ++ PUSHW = DstBuf (Zero filled) + + Blk0 : ProDOS.BootBlk + + Blk1 : SOS.BootBlk + + Blk2,3,4,5 : Volume Directory + + Blk6.... : Volume Bitmap (4096/Blk) + + max devSize = 65535 -> max 16 Bitmap Blk + + absolute MAX DstBuf size= + + 7 for Disk II(280blk),3.5(1600),3.5HD(2880) + + 22 for 32mb Hardisk... +#TrkW16s +Write a track (16 sectors) +##In: ++ PUSHW = Ptr to 16*256 buffer ++ PUSHB = TrackNum * 4 : 0->140+ ++ PUSHB = DSSS0000 +##Out: ++ CC : success ++ CS : A = Error + + A=0, currently starting/seeking... +#TrkWNIB +Write a track (NIBBLE) +##In: ++ PUSHW = Ptr to NIBBLE buffer (0 ended) ++ PUSHB = TrackNum * 4 : 0->140+ ++ PUSHB = DSSS0000 +##Out: ++ CC : success ++ CS : A = Error + + A=0, currently starting/seeking... diff --git a/_Docs/LIBTCPIP.md b/_Docs/LIBTCPIP.md index 5e7283f6..0eb6441e 100644 --- a/_Docs/LIBTCPIP.md +++ b/_Docs/LIBTCPIP.md @@ -1,187 +1,126 @@ *** Auto generated by docgen.cmd *** - -#ARP.Clear -+ Clear ARP Cache - -##In : - -##Out : - -#ARP.Query -+ Query ARP Cache and returns HW address - -##In: -+ PUSHW PTR to MAC (to fill) -+ PUSHW PTR to IP - -##Out: -+ CC: hit: MAC filled -+ CS: missed - -#ARP.Add -+ Add a static ARP cache record - -##In: -+ PUSHW PTR to MAC -+ PUSHW PTR to IP - -#ARP.GetCache -+ Return a Ptr to ARP Cache Table - -##In: - -##Out: - + Y,A = PTR to ARP.CACHE - -#DNS.Clear -+ Clear DNS Cache - -##In : - -##Out : - -#DNS.Query -+ Query DNS for specified host - -##In: - + PUSHW = PTR to IP to fill with cached data -* PUSHW = hostname PTR to PSTR - -##Out: - + CC: hit: IP filled with address - + CS: missed - -#DNS.Add -+ Add a static DNS record - -##In: -+ PUSHW = PTR to IP -+ PUSHW = hostname PSTR to Add - -#DNS.GetCache -+ Return a Ptr to DNS Cache Table - -##In: - -##Out: - + Y,A = PTR to DNS.CACHE - -#SKT.New -+ Create a new socket - -##In : -+ PUSHW = PTR to S.SOCKET template - -##Out : -+ YA = PTR to new S.SOCKET -+ X = hSocket - -#SKT.CloseA -+ Close socket - -##In : -+ A = hSocket - -##Out : - -#SKT.GetA -+ Get Ptr to socket - -##In : -+ A = hSocket - -##Out : -+ Y,A = pS.SOCKET - -#SKT.GetTable -+ Get socket table - -##In : - -##Out : -+ Y,A = pS.SOCKET - -#SKT.AcceptA -+ Check for an incoming connection - -##In : -+ A = hListeningSocket - -##Out : -+ A = hSocket - -#SKT.MkNodA -+ Create a new file from TCP socket - -##In : -+ A = hSocket - -##Out : -+ A = hFile - -#SKT.Write (DGRAM,STREAM,RAW) -+ Send block of data - -##In : -+ PUSHB = hSocket -+ PUSHW = pBuf -+ PUSHW = len - -##Out : - -#SKT.ReadA (DGRAM,RAW) - -##In : -+ A = hSocket - -##Out : -+ A = hFrame - -#SKT.PutC (STREAM) -+ Write a Char To Stream - -##In : -+ PUSHB = hSocket -+ PUSHB = Char - -##Out : - -#SKT.PutS (STREAM) -+ Write Line in pBuf - -##In : -+ PUSHB = hSocket -+ PUSHW = PSTR - -##Out : - -#SKT.GetCA (STREAM) -+ Read a Char From Stream in A - -##In : -+ A = hSocket - -##Out : -+ A = char - -#SKT.GetS (STREAM) -+ Read a CR terminated Line in pBuf - -##In : -+ PUSHB = hSocket -+ PUSHW = pBuf -+ PUSHW = len - -##Out : -+ Y,A = bytes read - -#SKT.Read (STREAM) -+ Read data in pBuf - -##In : -+ PUSHB = hSocket -+ PUSHW = pBuf -+ PUSHW = len - -##Out : -+ Y,A = bytes transfered +#ARP.Clear ++ Clear ARP Cache +##In : +##Out : +#ARP.Query ++ Query ARP Cache and returns HW address +##In: ++ PUSHW PTR to MAC (to fill) ++ PUSHW PTR to IP +##Out: ++ CC: hit: MAC filled ++ CS: missed +#ARP.Add ++ Add a static ARP cache record +##In: ++ PUSHW PTR to MAC ++ PUSHW PTR to IP +#ARP.GetCache ++ Return a Ptr to ARP Cache Table +##In: +##Out: + + Y,A = PTR to ARP.CACHE +#DNS.Clear ++ Clear DNS Cache +##In : +##Out : +#DNS.Query ++ Query DNS for specified host +##In: + + PUSHW = PTR to IP to fill with cached data +* PUSHW = hostname PTR to PSTR +##Out: + + CC: hit: IP filled with address + + CS: missed +#DNS.Add ++ Add a static DNS record +##In: ++ PUSHW = PTR to IP ++ PUSHW = hostname PSTR to Add +#DNS.GetCache ++ Return a Ptr to DNS Cache Table +##In: +##Out: + + Y,A = PTR to DNS.CACHE +#SKT.New ++ Create a new socket +##In : ++ PUSHW = PTR to S.SOCKET template +##Out : ++ YA = PTR to new S.SOCKET ++ X = hSocket +#SKT.CloseA ++ Close socket +##In : ++ A = hSocket +##Out : +#SKT.GetA ++ Get Ptr to socket +##In : ++ A = hSocket +##Out : ++ Y,A = pS.SOCKET +#SKT.GetTable ++ Get socket table +##In : +##Out : ++ Y,A = pS.SOCKET +#SKT.AcceptA ++ Check for an incoming connection +##In : ++ A = hListeningSocket +##Out : ++ A = hSocket +#SKT.MkNodA ++ Create a new file from TCP socket +##In : ++ A = hSocket +##Out : ++ A = hFile +#SKT.Write (DGRAM,STREAM,RAW) ++ Send block of data +##In : ++ PUSHB = hSocket ++ PUSHW = pBuf ++ PUSHW = len +##Out : +#SKT.ReadA (DGRAM,RAW) +##In : ++ A = hSocket +##Out : ++ A = hFrame +#SKT.PutC (STREAM) ++ Write a Char To Stream +##In : ++ PUSHB = hSocket ++ PUSHB = Char +##Out : +#SKT.PutS (STREAM) ++ Write Line in pBuf +##In : ++ PUSHB = hSocket ++ PUSHW = PSTR +##Out : +#SKT.GetCA (STREAM) ++ Read a Char From Stream in A +##In : ++ A = hSocket +##Out : ++ A = char +#SKT.GetS (STREAM) ++ Read a CR terminated Line in pBuf +##In : ++ PUSHB = hSocket ++ PUSHW = pBuf ++ PUSHW = len +##Out : ++ Y,A = bytes read +#SKT.Read (STREAM) ++ Read data in pBuf +##In : ++ PUSHB = hSocket ++ PUSHW = pBuf ++ PUSHW = len +##Out : ++ Y,A = bytes transfered diff --git a/_Tools/docgen.cmd b/_Tools/docgen.cmd index 655f8190..f814b151 100644 --- a/_Tools/docgen.cmd +++ b/_Tools/docgen.cmd @@ -16,23 +16,18 @@ set /a c=0 set DOCFILE=%~dp0..\_Docs\KERNEL.md set SRCDIR=%~dp0..\SYS set FILTER=KERNEL.S*.txt - Call :SCAN set DOCFILE=%~dp0..\_Docs\LIBTCPIP.md set SRCDIR=%~dp0..\LIB set FILTER=LIBTCPIP.S*.txt - Call :SCAN set DOCFILE=%~dp0..\_Docs\LIBBLKDEV.md set SRCDIR=%~dp0..\LIB set FILTER=LIBBLKDEV.S*.txt - Call :SCAN -set FILTER=LIBTCPIP.S*.txt - echo. echo All done : !c! Files scanned. echo. @@ -43,7 +38,7 @@ exit 0 :SCAN -echo *** Auto generated by docgen.cmd *** >!DOCFILE! +(echo *** Auto generated by docgen.cmd *** )>!DOCFILE! echo. echo Scanning %FILTER% Files... @@ -71,8 +66,7 @@ for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do ( if "!line:~0,4!" EQU "* " set LINE= + !LINE:~4! if "!line:~0,3!" EQU "* " set LINE=+ !LINE:~3! if "!line:~0,2!" EQU "* " set LINE=!LINE:~2! - if "!line:~0,1!" EQU "#" echo.>>!DOCFILE! - (echo !LINE!)>>!DOCFILE! + (echo !LINE! )>>!DOCFILE! ) ) )