From bc9b641ebc7ffc0055942f2e90f678c3b343598b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20GIBERT?= Date: Sun, 17 Jun 2018 09:19:20 +0200 Subject: [PATCH] Kernel 0.9.2 --- .Docs/KERNEL.md | 745 ++++++++++++++++++++++++--------------------- .Docs/LIBBLKDEV.md | 62 ++-- .Docs/LIBTCPIP.md | 126 ++++---- 3 files changed, 484 insertions(+), 449 deletions(-) diff --git a/.Docs/KERNEL.md b/.Docs/KERNEL.md index ea7822c7..611850cc 100644 --- a/.Docs/KERNEL.md +++ b/.Docs/KERNEL.md @@ -1,8 +1,8 @@ *** Auto generated by docgen.cmd *** -## GetArg +# GetArg -# ASM +## ASM **In:** A = argument index. **Out:** @@ -14,302 +14,308 @@ CS : Out Of Bound Search a file in the provided PATH list And return, if found, the full path to it. **In:** -+ PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB -+ PUSHW = Ptr to File Name (CSTR) -+ PUSHW = Ptr to DstBuf -+ PUSHW = Ptr to DstStat + PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB + PUSHW = Ptr to File Name (CSTR) + PUSHW = Ptr to DstBuf + PUSHW = Ptr to DstStat **Out:** -+ CC : success - + DstBuf = FilePath - + DstStat = S.STAT -+ CS : not found + CC : success + DstBuf = FilePath + DstStat = S.STAT + CS : not found # GetDevByID.A **In:** -+ A = DevID +A = DevID **Out:** -+ CC = OK, CS = ERROR -+ Y,A = DEVSLOT -+ note: X Unmodified +CC = OK, CS = ERROR +Y,A = DEVSLOT +note: X Unmodified # GetDevByName.YA **In:** -+ Y,A = Ptr to device name (C-String) + Y,A = Ptr to device name (C-String) **Out:** -+ CC = OK, CS = ERROR -+ X = DEVID -+ Y,A = DEVSLOT + CC = OK, CS = ERROR + X = DEVID + Y,A = DEVSLOT # GetDevStatus.A **In:** -+ A = DevID + A = DevID **Out:** -+ Y,A = S.DSTAT + Y,A = S.DSTAT # IOCTL + +## C +`int ioctl ( short int id, short int op, void *param);` + +## ASM **In:** -+ PUSHB = DevID -+ PUSHB = Operation -+ PUSHW = Param Block +`PUSHWI param` +`lda #op` +`ldy id` +`>SYSCALL IOCTL` **Out:** -+ Y,A = ... + Y,A = ... # OpenDir.YA **In:** -+ Y,A = PATH (C-String) + Y,A = PATH (C-String) **Out:** -+ CC : success - + A = hDIR -+ CS : error - + A = EC + CC : success + A = hDIR + CS : error + A = EC # ReadDir.A **In:** -+ A = hDIR + A = hDIR **Out:** -+ CC : success - + X = hDIRENT - + Y,A = PTR to S.DIRENT -+ CS : error - + A = EC - + note : A = 0 means no more entry + CC : success + X = hDIRENT + Y,A = PTR to S.DIRENT + CS : error + A = EC + note : A = 0 means no more entry # CloseDir.A **In:** -+ A = hDIR + A = hDIR **Out:** -+ none, always succeed. + none, always succeed. # ExpandStr.YA **In:** -+ Y,A = PTR to String to Expand (C-String) + Y,A = PTR to String to Expand (C-String) **Out:** -+ X = hMem to Expanded String (C-String) -+ Y,A = PTR to Expanded String + X = hMem to Expanded String (C-String) + Y,A = PTR to Expanded String # PutEnv.YA **In:** -+ Y,A = PTR to String NAME=VALUE (C-String) + Y,A = PTR to String NAME=VALUE (C-String) **Out:** # SetEnv **In:** -+ PUSHW = PTR To Value (PSTR) -+ PUSHW = PTR To Name (PSTR) + PUSHW = PTR To Value (PSTR) + PUSHW = PTR To Name (PSTR) **Out:** # GetEnv.YA **In:** -+ Y,A = PTR to NAME (PSTR) + Y,A = PTR to NAME (PSTR) **Out:** -+ CC : Y,A = PTR to VALUE (PSTR) -+ CS : not found + CC : Y,A = PTR to VALUE (PSTR) + CS : not found # UnsetEnv.YA **In:** -+ Y,A = PTR To Name (PSTR) + Y,A = PTR To Name (PSTR) **Out:** # LoadTxtFile.YA Load TXT a file in memory (with ending 0) **In:** -+ Y,A = File Path + Y,A = File Path **Out:** -+ Y,A = File Length (without ending 0) -+ X = hMem of Loaded File + Y,A = File Length (without ending 0) + X = hMem of Loaded File # LoadFile Load a file in memory **In:** -+ PUSHW = AUXTYPE (Handled by.... -+ PUSHB = TYPE ... -+ PUSHB = MODE ... -+ PUSHW = PATH ...FOpen) + PUSHW = AUXTYPE (Handled by.... + PUSHB = TYPE ... + PUSHB = MODE ... + PUSHW = PATH ...FOpen) **Out:** -+ Y,A = File Length -+ X = hMem of Loaded File + Y,A = File Length + X = hMem of Loaded File # ChTyp **In:** -+ PUSHB = TYPE -+ PUSHW = PATH + PUSHB = TYPE + PUSHW = PATH # ChMod **In:** -+ PUSHW = UID -+ PUSHW = PATH + PUSHW = UID + PUSHW = PATH # ChOwn **In:** -+ PUSHW = UID -+ PUSHW = PATH + PUSHW = UID + PUSHW = PATH # ChGrp **In:** -+ PUSHW = GID -+ PUSHW = PATH + PUSHW = GID + PUSHW = PATH # FAdd,FSub,FMult,FDiv,FPwr Return X+Y, X-Y, X*Y, X/Y, X^Y **In:** -+ PUSHF = X (Float) -+ PUSHF = Y (Float) + PUSHF = X (Float) + PUSHF = Y (Float) **Out:** -+ On stack (Float) + On stack (Float) # Log,Sqr,Exp,Cos,Sin,Tan,ATan Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x) **In:** -+ PUSHF = X (Float) + PUSHF = X (Float) **Out:** -+ On stack (Float) + On stack (Float) # Float Return 'floated' long **In:** -+ PUSHL = X (long) + PUSHL = X (long) **Out:** -+ On stack (Float) + On stack (Float) # LRIntF Return Float rounded into a long **In:** -+ PUSHF = X (Float) + PUSHF = X (Float) **Out:** -+ On stack (long) + On stack (long) -# GetMem0.YA +# GetMem0 **In:** -+ Y,A = Size Requested + Y,A = Size Requested **Out:** -+ CC : success - + YA = PTR to Mem (ZERO Initialised) + CC : success + YA = PTR to Mem (ZERO Initialised) * X = hMem -+ CS : - + A = EC + CS : + A = EC -# GetMem.YA +# GetMem **In:** -+ Y,A = Size Requested + Y,A = Size Requested **Out:** -+ CC : success - + YA = PTR to Mem (Uninitialised) + CC : success + YA = PTR to Mem (Uninitialised) * X = hMem -+ CS : - + A = EC + CS : + A = EC -# FreeMem.A +# FreeMem **In:** -+ A = hMem To Free + A = hMem To Free **Out:** -+ none. -+ (X,Y unmodified) + none. + (X,Y unmodified) -# GetMemPtr.A +# GetMemPtr **In:** -+ A = hMem + A = hMem **Out:** -+ Y,A = PTR to MemBlock -+ (X unmodified) + Y,A = PTR to MemBlock + (X unmodified) -# GetMemByID.A +# GetMemByID **In:** -+ A = hMem + A = hMem **Out:** -+ Y,A = ZPMemMgrSPtr = PTR to S.MEM -+ X unmodified + Y,A = ZPMemMgrSPtr = PTR to S.MEM + X unmodified -# NewStr.YA +# NewStr Create a new copy of this C-String **In:** -+ Y,A = Ptr to source C-String + Y,A = Ptr to source C-String **Out:** -+ CC : success - + Y,A = PTR to String - + X = hMem (PSTR) -+ CS : error - + A = SYS error code + CC : success + Y,A = PTR to String + X = hMem (PSTR) + CS : error + A = SYS error code # SListGetByID **In:** -+ PUSHB = hSList -+ PUSHW = KeyID -+ PUSHW = Data Ptr -+ PUSHW = Key Ptr + PUSHB = hSList + PUSHW = KeyID + PUSHW = Data Ptr + PUSHW = Key Ptr **Out:** -+ X,Y = Next KeyID + X,Y = Next KeyID # SListUpdateByID **In:** -+ PUSHB = hSList -+ PUSHW = KeyID -+ PUSHW = Data Ptr + PUSHB = hSList + PUSHW = KeyID + PUSHW = Data Ptr **Out:** -+ A = Key Length -+ X,Y = KeyID + A = Key Length + X,Y = KeyID # SListAdd **In:** -+ PUSHB = hSList -+ PUSHW = Key Ptr -+ PUSHW = Data Ptr + PUSHB = hSList + PUSHW = Key Ptr + PUSHW = Data Ptr **Out:** -+ A = Key Length -+ X,Y = KeyID + A = Key Length + X,Y = KeyID # SListLookup **In:** -+ PUSHB = hSList -+ PUSHW = Key Ptr -+ PUSHW = Data Ptr + PUSHB = hSList + PUSHW = Key Ptr + PUSHW = Data Ptr **Out:** -+ A = Key Length -+ X,Y = KeyID + A = Key Length + X,Y = KeyID # SListNew **In:** **Out:** -+ A=hSList + A=hSList # SListFree **In:** -+ A=hSList + A=hSList **Out:** -# GetStkObjProperty.AY +# GetStkObjProp **In:** -+ A = hObject (AUX Memory) -+ Y = Property Index + A = hObject (AUX Memory) + Y = Property Index **Out:** -+ Y,A = Property Value + Y,A = Property Value -# NewStkObj.YA +# NewStkObj **In:** -+ Y,A = Size Requested + Y,A = Size Requested **Out:** -+ CC : success - + YA = PTR to Mem (Uninitialised) + CC : success + YA = PTR to Mem (Uninitialised) * X = hMem -+ CS : - + A = EC + CS : + A = EC -# FreeStkObj.A +# FreeStkObj **In:** -+ A = hMem To Free (AUX Memory) + A = hMem To Free (AUX Memory) **Out:** -+ none. -+ (X,Y unmodified) + none. + (X,Y unmodified) # LoadStkObj Load a file in AUX memory (Stock Objects) **In:** -+ PUSHW = AUXTYPE (Handled by.... -+ PUSHB = TYPE ... -+ PUSHB = MODE ... -+ PUSHW = PATH ...FOpen) + PUSHW = AUXTYPE (Handled by.... + PUSHB = TYPE ... + PUSHB = MODE ... + PUSHW = PATH ...FOpen) **Out:** -+ Y,A = File Length -+ X = hMem of Loaded Object in AUX mem + Y,A = File Length + X = hMem of Loaded Object in AUX mem # ExecPSNewEnv.YA @@ -319,208 +325,222 @@ Load a file in AUX memory (Stock Objects) # CreatePS.YA (Non Blocking) **In:** - + Y,A = PTR To Cmd Line + Y,A = PTR To Cmd Line **Out:** - + A = Child PSID + A = Child PSID # GetMemStat.YA **In:** -+ Y,A = Ptr to 24 bytes buffer + Y,A = Ptr to 24 bytes buffer **Out:** -+ Buffer filled with memory stats + Buffer filled with memory stats # GetPSStatus.A **In:** -+ A = PID + A = PID **Out:** -+ A = Status Byte + A = Status Byte # GetPSStat.YA **In:** -+ Y,A = Ptr to 24 bytes buffer + Y,A = Ptr to 24 bytes buffer **Out:** -+ Buffer filled with PS stats + Buffer filled with PS stats # Stat Return information about a file ## In : -+ PUSHW = PTR to S.STAT buffer -+ PUSHW = PTR to Filename (C-String) + PUSHW = PTR to S.STAT buffer + PUSHW = PTR to Filename (C-String) ## Out : # MKDir.YA **In:** -+ Y,A = DIR name + Y,A = DIR name **Out:** -+ CC : success -+ CS : error - + A = EC + CC : success + CS : error + A = EC # MkNod.YA return a hFile for a given Device Name **In:** -+ Y,A=DevName + Y,A=DevName **Out:** -+ CC = OK, CS = ERROR -+ A = hFILE + CC = OK, CS = ERROR + A = hFILE # MKFIFO return a hFILE to a new FIFO **In:** **Out:** -+ CC = OK, CS = ERROR -+ A = hFILE + CC = OK, CS = ERROR + A = hFILE -# FPutC.A -int fputc ( int character, hFILE stream ); +# FPutC Print A (char) to hFILE -**In:** -+ PUSHB : hFILE -+ A : char to print -**Out:** -+ CC = success -# PutChar.A -int putchar ( int character ); +## C +int fputc ( int character, hFILE stream ); + +## ASM +**In:** + Y : character + A : stream +**Out:** + CC = success + +# PutChar + +## C +`int putchar ( int character );` + +## ASM Print A (char) to StdOut **In:** -+ A : char to print + A : char to print **Out:** -+ CC = success + CC = success -# PutS.YA +# PutS int puts ( const char * str ); Write Str to StdOut, appends '\r\n' **In:** -+ Y,A : CPtr + Y,A : CPtr **Out:** -+ CC = success + CC = success -# FPutS.YA +# FPutS int fputs ( const char * str, hFILE stream ); Write Str to FILE **In:** -+ PUSHB : hFILE -+ Y,A: CPtr + PUSHB : hFILE + Y,A: str **Out:** -+ CC = success + CC = success -# PrintF.YA +# PrintF int printf ( const char * format, ... ); -# SPrintF.YA +# SPrintF int sprintf ( char * str, const char * format, ... ); -# FPrintF.A +# FPrintF int fprintf ( FILE * stream, const char * format, ... ); * Prints C-Style String **In:** -PrintF.YA : - + PUSH ... - + Y,A = PTR to CStr -SPrintF.YA : - + PUSH ... - + PUSHW = PTR to CStr - + Y,A = Ptr to Dst Buffer -FPrintF.YA : - + PUSH ... - + PUSHW = PTR to CStr - + A = hFILE +PrintF : + PUSH ... + Y,A = PTR to CStr +SPrintF : + PUSH ... + PUSHW = PTR to CStr + Y,A = Ptr to Dst Buffer +FPrintF : + PUSH ... + PUSHW = PTR to CStr + A = hFILE * **Out:** -+ CC : success -+ CS : error code from Output + CC : success + CS : error code from Output Specifiers : - + %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 4 bytes long unsigned DEC 0..4294967295 - + %e : pull 5 Bytes float (-)1.23456789e+12 - + %f : pull 5 Bytes float (-)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 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 % + %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 4 bytes long unsigned DEC 0..4294967295 + %e : pull 5 Bytes float (-)1.23456789e+12 + %f : pull 5 Bytes float (-)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 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' + %d : '9' '12' + %2d : ' 9' '12' + %02d : '09' '12' + %11s : 'ABCDEFGH ' + %011s : 'ABCDEFGH000' + %2f : '3.14' # GetChar Get char from StdIn **In:** -+ none. + none. **Out:** -+ CC = success - + A = char + CC = success + A = char # GetC.A Get char from Node **In:** -+ A = hNODE + A = hNODE **Out:** -+ CC = success - + A = char + CC = success + A = char -# SScanF.YA -Scan a C-String (in progress) +# SScanF +Read formatted data from string + +## C +`int sscanf ( const char * s, const char * format, ...);` + +## ASM **In:** -+ PUSHW PTR to target var -+ ... -+ PUSHW PTR pattern (ex: "%d.%d.%d.%d") - + %i : short int - + %d : byte - + %I : int - + %D : word -* %L : long int -* %U : dword - + %h : HEX byte - + %H : HEX word -+ Y,A = PTR to String to scan (ex: "192.168.1.5") +`>PUSHBI Argument Byte count` +`>PUSHWI format` + ex: "%d.%d.%d.%d" ++ %i : short int ++ %d : byte ++ %I : int ++ %D : word ++ %L : long int ++ %U : dword ++ %h : HEX byte ++ %H : HEX word +`>LDYA s` **Out:** +Y,A = Number of arguments filled. # 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) + 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 + CC : A = hFILE + CS : A = EC # FClose.A Close a file ## In : -+ A = hFILE + A = hFILE ## Out : @@ -529,52 +549,52 @@ int fread ( void * ptr, int count, FILE * stream ); Read bytes from file ## In : -+ PUSHW = Dest Ptr -+ PUSHW = Bytes To Read -+ PUSHB = hFILE + PUSHW = Dest Ptr + PUSHW = Bytes To Read + PUSHB = hFILE ## Out : -+ Y,A = Bytes Read + Y,A = Bytes Read # FWrite int fwrite ( const void * ptr, int count, FILE * stream ); Write bytes to file **In:** -+ PUSHW = Src Ptr -+ PUSHW = Bytes To Write -+ PUSHB = hFILE + PUSHW = Src Ptr + PUSHW = Bytes To Write + PUSHB = hFILE # Out: -+ Y,A = Bytes Written + Y,A = Bytes Written # FFlush.A **In:** -+ A = hFILE + A = hFILE # FSeek Set the file-position indicator for hFILE **In:** -+ PUSHW = Ptr to Offset (DWORD) -+ PUSHB = From -+ PUSHB = hFILE + PUSHW = Ptr to Offset (DWORD) + PUSHB = From + PUSHB = hFILE # FEOF.A Test the end-of-file indicator for hFILE **In:** -+ A = hFILE + A = hFILE **Out:** -+ CC : - + A=0 EOF - + A =0 NOT EOF -+ CS : + CC : + A=0 EOF + A =0 NOT EOF + CS : # FTell Return the current value of the file-position indicator **In:** -+ PUSHW = Ptr to Offset (DWORD) -+ PUSHB = hFILE + PUSHW = Ptr to Offset (DWORD) + PUSHB = hFILE **Out:** - + Offset = Offset + Offset = Offset # Remove.YA @@ -582,44 +602,44 @@ Return the current value of the file-position indicator Rename a file ## In : -+ PUSHW = New Name -+ PUSHW = Old Name + PUSHW = New Name + PUSHW = Old Name ## Out : -## StrToF +# StrToF Convert String to 40 bits Float -# C +## C `float strtof (const char* str, char** endptr);` -# ASM +## ASM **In:** `>PUSHWI EndPtr` `>LDYA str` **Out:** On stack (float) -## AToF +# AToF Convert String to 40 bits Float -# C +## C `float atof (const char* str);` -# ASM +## ASM **In:** `>LDYA str` **Out:** On stack (float) -## StrToL (StrToUL) +# StrToL/StrToUL Convert String to 32 bits (unsigned) int -# C +## C `long strtol (const char* str, char** endptr, int base);` `unsigned long strtoul (const char* str, char** endptr, int base);` -# ASM +## ASM **In:** `>PUSHB Base` `>PUSHWI EndPtr` @@ -630,10 +650,10 @@ On stack (long) # AToL Convert String to 32 bits int -# C +## C `long atol ( const char * str );` -# ASM +## ASM **In:** `>LDYA str` **Out:** @@ -641,125 +661,140 @@ On stack (long) # AToI.YA -# C -`long atol ( const char * str );` +## C +`int atoi ( const char * str );` -# ASM +## ASM **In:** `>LDYA str` **Out:** -+ Y,A = Int + Y,A = Int # RealPath.YA Return the canonicalized absolute pathname ## In : -+ Y,A = Ptr to Relative Filename (C-String) + Y,A = Ptr to Relative Filename (C-String) ## Out : -+ CC : success - + Y,A = Ptr to Full Path (C-String) - + X = hMem of Full Path -+ CS : A = Error Code + CC : success + Y,A = Ptr to Full Path (C-String) + X = hMem of Full Path + CS : A = Error Code -# StrLen.YA +# StrLen Returns Length of C-String + +## C +`char * strcat ( char * destination, const char * source );` + +## ASM **In:** -+ Y,A = Ptr to CSTR +Y,A = Ptr to CSTR **Out:** -+ Y,A = String length +Y,A = String length # StrCat Append SRC to DST **In:** -+ PUSHW = Ptr to SRC (CSTR) -+ PUSHW = Ptr to DST (CSTR) + PUSHW = Ptr to SRC (CSTR) + PUSHW = Ptr to DST (CSTR) **Out:** -+ DST = DST+SRC + DST = DST+SRC # StrCpy Copy string + +## C +`char * strcpy ( char * destination, const char * source );` + +## ASM **In:** -+ PUSHW = Ptr to SRC (CSTR) -+ PUSHW = Ptr to DST (CSTR) +PUSHW = Ptr to SRC (CSTR) +PUSHW = Ptr to DST (CSTR) **Out:** -+ DST = SRC +DST = SRC # StrMatch Compare a String against pattern **In:** - + PUSHW = PTR to Pattern (e.g. '*test?.txt') - + PUSHW = PTR to Src String + PUSHW = PTR to Pattern (e.g. '*test?.txt') + PUSHW = PTR to Src String **Out:** - + CC : match - + CS : no match + CC : match + CS : no match -# StrUpr.YA/StrLwr.YA +# StrUpr/StrLwr Convert string to UPPERCASE/lowercase **In:** - + Y,A = PTR to String (CSTR) +Y,A = PTR to String (CSTR) **Out:** - + Uppercased/lowercased String in Buffer +Uppercased/lowercased String in Buffer # StrCmp Compare 2 strings **In:** -+ PUSHW = Ptr to String1 (CSTR) -+ PUSHW = Ptr to String2 (CSTR) + PUSHW = Ptr to String1 (CSTR) + PUSHW = Ptr to String2 (CSTR) **Out:** -+ DST = SRC + DST = SRC # StrICmp Compare 2 strings **In:** -+ PUSHW = Ptr to String1 (CSTR) -+ PUSHW = Ptr to String2 (CSTR) + PUSHW = Ptr to String1 (CSTR) + PUSHW = Ptr to String2 (CSTR) **Out:** -+ CC, Y,A=0 -+ CS, Y,A > 0 or < 0 + CC, Y,A=0 + CS, Y,A > 0 or < 0 -# Time.YA -+ Get System Time in Buffer +# Time +Get System Time in Buffer ## In : -+ Y,A = PTR to S.TIME +Y,A = PTR to S.TIME ## Out : -+ S.TIME filled with System date/time +S.TIME filled with System date/time # PTime2Time -+ Convert ProDOS Time To S.TIME + Convert ProDOS Time To S.TIME ## In : -+ PUSHW = Dst PTR To S.TIME -+ PUSHW = Src PTR to ProDOS DATE/TIME (DWORD) + PUSHW = Dst PTR To S.TIME + PUSHW = Src PTR to ProDOS DATE/TIME (DWORD) # CTime2Time -+ Convert CTIME to S.TIME + Convert CTIME to S.TIME ## In : -+ PUSHW = Dst PTR To S.TIME -+ PUSHW = Src CTIME DWORD + PUSHW = Dst PTR To S.TIME + PUSHW = Src CTIME DWORD # StrFTime + +## C Convert S.TIME struct to CSTR -**In:** -+ PUSHW = Dst PTR To CSTR 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 +`size_t strftime (char* ptr, size_t maxsize, const char* format, const struct tm* timeptr );` + +## ASM +**In:** + PUSHW = Dst PTR To CSTR 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. + none. always succeed. diff --git a/.Docs/LIBBLKDEV.md b/.Docs/LIBBLKDEV.md index c21ea2ad..1bdb4c59 100644 --- a/.Docs/LIBBLKDEV.md +++ b/.Docs/LIBBLKDEV.md @@ -1,52 +1,52 @@ *** Auto generated by docgen.cmd *** # GetProDOSCatSize -+ Compute space needed for ProDOS Catalog + Compute space needed for ProDOS Catalog ## In : -+ PUSHW = DevSize (in 512b blocks) -+ PUSHB = Catalog Size (in blocks) -+ PUSHB = Options + PUSHW = DevSize (in 512b blocks) + PUSHB = Catalog Size (in blocks) + PUSHB = Options ## Out : -+ X=BlockCount (max 22) -+ Y,A=BufSize (max $4400) + X=BlockCount (max 22) + Y,A=BufSize (max $4400) # BuildProDOSCat ## In : -+ PUSHW = DevSize (in 512b blocks) -+ PUSHB = Catalog Size (in blocks) -+ PUSHB = Options -+ PUSHW = VolName (PSTR) -+ PUSHW = DstBuf (Zero filled) - + Blk0 : ProDOS.BootBlk - + Blk1 : SOS.BootBlk - + Blk2...n : Volume Directory - + Blkn+1.. : 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... + PUSHW = DevSize (in 512b blocks) + PUSHB = Catalog Size (in blocks) + PUSHB = Options + PUSHW = VolName (PSTR) + PUSHW = DstBuf (Zero filled) + Blk0 : ProDOS.BootBlk + Blk1 : SOS.BootBlk + Blk2...n : Volume Directory + Blkn+1.. : 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 + PUSHW = Ptr to 16*256 buffer + PUSHB = TrackNum * 4 : 0->140+ + PUSHB = DSSS0000 **Out:** -+ CC : success -+ CS : A = Error - + A=0, currently starting/seeking... + 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 + 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... + CC : success + CS : A = Error + A=0, currently starting/seeking... diff --git a/.Docs/LIBTCPIP.md b/.Docs/LIBTCPIP.md index 46bb70bb..0961bca6 100644 --- a/.Docs/LIBTCPIP.md +++ b/.Docs/LIBTCPIP.md @@ -1,177 +1,177 @@ *** Auto generated by docgen.cmd *** # ARP.Clear -+ Clear ARP Cache + Clear ARP Cache ## In : ## Out : # ARP.Query -+ Query ARP Cache and returns HW address + Query ARP Cache and returns HW address **In:** -+ PUSHW PTR to MAC (to fill) -+ PUSHW PTR to IP + PUSHW PTR to MAC (to fill) + PUSHW PTR to IP **Out:** -+ CC: hit: MAC filled -+ CS: missed + CC: hit: MAC filled + CS: missed # ARP.Add -+ Add a static ARP cache record + Add a static ARP cache record **In:** -+ PUSHW PTR to MAC -+ PUSHW PTR to IP + PUSHW PTR to MAC + PUSHW PTR to IP # ARP.GetCAche -+ Return a Ptr to ARP Cache Table + Return a Ptr to ARP Cache Table **In:** **Out:** - + Y,A = PTR to ARP.CACHE + Y,A = PTR to ARP.CACHE # DNS.Clear -+ Clear DNS Cache + Clear DNS Cache ## In : ## Out : # DNS.Query -+ Query DNS for specified host + Query DNS for specified host **In:** - + PUSHW = PTR to IP to fill with cached data + PUSHW = PTR to IP to fill with cached data * PUSHW = hostname PTR to PSTR **Out:** - + CC: hit: IP filled with address - + CS: missed + CC: hit: IP filled with address + CS: missed # DNS.Add -+ Add a static DNS record + Add a static DNS record **In:** -+ PUSHW = PTR to IP -+ PUSHW = hostname CSTR to Add + PUSHW = PTR to IP + PUSHW = hostname CSTR to Add # DNS.GetCAche -+ Return a Ptr to DNS Cache Table + Return a Ptr to DNS Cache Table **In:** **Out:** - + Y,A = PTR to DNS.CACHE + Y,A = PTR to DNS.CACHE # SKT.New -+ Create a new socket + Create a new socket ## In : -+ PUSHW = PTR to S.SOCKET template + PUSHW = PTR to S.SOCKET template ## Out : -+ YA = PTR to new S.SOCKET -+ X = hSocket + YA = PTR to new S.SOCKET + X = hSocket # SKT.CloseA -+ Close socket + Close socket ## In : -+ A = hSocket + A = hSocket ## Out : # SKT.GetA -+ Get Ptr to socket + Get Ptr to socket ## In : -+ A = hSocket + A = hSocket ## Out : -+ Y,A = pS.SOCKET + Y,A = pS.SOCKET # SKT.GetTable -+ Get socket table + Get socket table ## In : ## Out : -+ Y,A = pS.SOCKET + Y,A = pS.SOCKET # SKT.AcceptA -+ Check for an incoming connection + Check for an incoming connection ## In : -+ A = hListeningSocket + A = hListeningSocket ## Out : -+ A = hSocket + A = hSocket # SKT.MkNodA -+ Create a new file from TCP socket + Create a new file from TCP socket ## In : -+ A = hSocket + A = hSocket ## Out : -+ A = hFile + A = hFile # SKT.Write (DGRAM,STREAM,RAW) -+ Send block of data + Send block of data ## In : -+ PUSHB = hSocket -+ PUSHW = pBuf -+ PUSHW = len + PUSHB = hSocket + PUSHW = pBuf + PUSHW = len ## Out : # SKT.ReadA (DGRAM,RAW) ## In : -+ A = hSocket + A = hSocket ## Out : -+ A = hFrame + A = hFrame # SKT.PutC (STREAM) -+ Write a Char To Stream + Write a Char To Stream ## In : -+ PUSHB = hSocket -+ PUSHB = Char + PUSHB = hSocket + PUSHB = Char ## Out : # SKT.PutS (STREAM) -+ Write Line in pBuf + Write Line in pBuf ## In : -+ PUSHB = hSocket -+ PUSHW = PSTR + PUSHB = hSocket + PUSHW = PSTR ## Out : # SKT.GetC.A (STREAM) -+ Read a Char From Stream in A + Read a Char From Stream in A ## In : -+ A = hSocket + A = hSocket ## Out : -+ A = char + A = char # SKT.GetS (STREAM) -+ Read a CR terminated Line in pBuf + Read a CR terminated Line in pBuf ## In : -+ PUSHB = hSocket -+ PUSHW = pBuf -+ PUSHW = len + PUSHB = hSocket + PUSHW = pBuf + PUSHW = len ## Out : -+ Y,A = bytes read + Y,A = bytes read # SKT.Read (STREAM) -+ Read data in pBuf + Read data in pBuf ## In : -+ PUSHB = hSocket -+ PUSHW = pBuf -+ PUSHW = len + PUSHB = hSocket + PUSHW = pBuf + PUSHW = len ## Out : -+ Y,A = bytes transfered + Y,A = bytes transfered