Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-06-18 10:44:02 +02:00
parent 6990622f84
commit f4a5532052
15 changed files with 1155 additions and 1156 deletions

View File

@ -1,23 +1,23 @@
*** Auto generated by docgen.cmd *** *** Auto generated by docgen.cmd ***
# GetArg # GetArg
## ASM ## ASM
**In:** **In:**
A = argument index. A = argument index.
**Out:** **Out:**
CC : success CC : success
Y,A = PTR To Arg[A] Y,A = PTR To Arg[A]
CS : Out Of Bound CS : Out Of Bound
# FileSearch
# FileSearch
Search a file in the provided PATH list Search a file in the provided PATH list
And return, if found, the full path to it. And return, if found, the full path to it.
## C ## C
`int filesearch ( char * filename, char * searchpath, char * fullpath, stat * filestat);` `int filesearch ( char * filename, char * searchpath, char * fullpath, stat * filestat);`
## ASM
## ASM
**In:** **In:**
`>PUSHWI filestat` `>PUSHWI filestat`
`>PUSHWI fullpath` `>PUSHWI fullpath`
@ -28,35 +28,35 @@ CC : success
DstBuf = FilePath DstBuf = FilePath
DstStat = S.STAT DstStat = S.STAT
CS : not found CS : not found
# GetDevByID.A
# GetDevByID.A
**In:** **In:**
A = DevID A = DevID
**Out:** **Out:**
CC = OK, CS = ERROR CC = OK, CS = ERROR
Y,A = DEVSLOT Y,A = DEVSLOT
note: X Unmodified note: X Unmodified
# GetDevByName.YA
# GetDevByName.YA
**In:** **In:**
Y,A = Ptr to device name (C-String) Y,A = Ptr to device name (C-String)
**Out:** **Out:**
CC = OK, CS = ERROR CC = OK, CS = ERROR
X = DEVID X = DEVID
Y,A = DEVSLOT Y,A = DEVSLOT
# GetDevStatus.A
# GetDevStatus.A
**In:** **In:**
A = DevID A = DevID
**Out:** **Out:**
Y,A = S.DSTAT Y,A = S.DSTAT
# IOCTL # IOCTL
## C ## C
`int ioctl ( short int id, short int op, void *param);` `int ioctl ( short int id, short int op, void *param);`
## ASM
## ASM
**In:** **In:**
`PUSHWI param` `PUSHWI param`
`lda #op` `lda #op`
@ -64,8 +64,8 @@ note: X Unmodified
`>SYSCALL IOCTL` `>SYSCALL IOCTL`
**Out:** **Out:**
Y,A = ... Y,A = ...
# OpenDir.YA
# OpenDir.YA
**In:** **In:**
Y,A = PATH (C-String) Y,A = PATH (C-String)
**Out:** **Out:**
@ -73,8 +73,8 @@ note: X Unmodified
A = hDIR A = hDIR
CS : error CS : error
A = EC A = EC
# ReadDir.A
# ReadDir.A
**In:** **In:**
A = hDIR A = hDIR
**Out:** **Out:**
@ -84,52 +84,52 @@ note: X Unmodified
CS : error CS : error
A = EC A = EC
note : A = 0 means no more entry note : A = 0 means no more entry
# CloseDir.A
# CloseDir.A
**In:** **In:**
A = hDIR A = hDIR
**Out:** **Out:**
none, always succeed. none, always succeed.
# ExpandStr
# ExpandStr
**In:** **In:**
Y,A = PTR to String to Expand (C-String) Y,A = PTR to String to Expand (C-String)
**Out:** **Out:**
X = hMem to Expanded String (C-String) X = hMem to Expanded String (C-String)
Y,A = PTR to Expanded String Y,A = PTR to Expanded String
# PutEnv.YA
# PutEnv.YA
**In:** **In:**
Y,A = PTR to String NAME=VALUE (C-String) Y,A = PTR to String NAME=VALUE (C-String)
**Out:** **Out:**
# SetEnv
# SetEnv
**In:** **In:**
PUSHW = PTR To Value (PSTR) PUSHW = PTR To Value (PSTR)
PUSHW = PTR To Name (PSTR) PUSHW = PTR To Name (PSTR)
**Out:** **Out:**
# GetEnv.YA
# GetEnv.YA
**In:** **In:**
Y,A = PTR to NAME (PSTR) Y,A = PTR to NAME (PSTR)
**Out:** **Out:**
CC : Y,A = PTR to VALUE (PSTR) CC : Y,A = PTR to VALUE (PSTR)
CS : not found CS : not found
# UnsetEnv.YA
# UnsetEnv.YA
**In:** **In:**
Y,A = PTR To Name (PSTR) Y,A = PTR To Name (PSTR)
**Out:** **Out:**
# LoadTxtFile.YA
# LoadTxtFile.YA
Load TXT a file in memory (with ending 0) Load TXT a file in memory (with ending 0)
**In:** **In:**
Y,A = File Path Y,A = File Path
**Out:** **Out:**
Y,A = File Length (without ending 0) Y,A = File Length (without ending 0)
X = hMem of Loaded File X = hMem of Loaded File
# LoadFile
# LoadFile
Load a file in memory Load a file in memory
**In:** **In:**
PUSHW = AUXTYPE (Handled by.... PUSHW = AUXTYPE (Handled by....
@ -139,57 +139,57 @@ Load a file in memory
**Out:** **Out:**
Y,A = File Length Y,A = File Length
X = hMem of Loaded File X = hMem of Loaded File
# ChTyp
# ChTyp
**In:** **In:**
PUSHB = TYPE PUSHB = TYPE
PUSHW = PATH PUSHW = PATH
# ChMod # ChMod
**In:** **In:**
PUSHW = UID PUSHW = UID
PUSHW = PATH PUSHW = PATH
# ChOwn # ChOwn
**In:** **In:**
PUSHW = UID PUSHW = UID
PUSHW = PATH PUSHW = PATH
# ChGrp
# ChGrp
**In:** **In:**
PUSHW = GID PUSHW = GID
PUSHW = PATH PUSHW = PATH
# FAdd,FSub,FMult,FDiv,FPwr
# FAdd,FSub,FMult,FDiv,FPwr
Return X+Y, X-Y, X*Y, X/Y, X^Y Return X+Y, X-Y, X*Y, X/Y, X^Y
**In:** **In:**
PUSHF = X (Float) PUSHF = X (Float)
PUSHF = Y (Float) PUSHF = Y (Float)
**Out:** **Out:**
On stack (Float) On stack (Float)
# Log,Sqr,Exp,Cos,Sin,Tan,ATan
# Log,Sqr,Exp,Cos,Sin,Tan,ATan
Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x) Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
**In:** **In:**
PUSHF = X (Float) PUSHF = X (Float)
**Out:** **Out:**
On stack (Float) On stack (Float)
# Float
# Float
Return 'floated' long Return 'floated' long
**In:** **In:**
PUSHL = X (long) PUSHL = X (long)
**Out:** **Out:**
On stack (Float) On stack (Float)
# LRIntF
# LRIntF
Return Float rounded into a long Return Float rounded into a long
**In:** **In:**
PUSHF = X (Float) PUSHF = X (Float)
**Out:** **Out:**
On stack (long) On stack (long)
# GetMem0
# GetMem0
**In:** **In:**
Y,A = Size Requested Y,A = Size Requested
**Out:** **Out:**
@ -198,8 +198,8 @@ Return Float rounded into a long
* X = hMem * X = hMem
CS : CS :
A = EC A = EC
# GetMem
# GetMem
**In:** **In:**
Y,A = Size Requested Y,A = Size Requested
**Out:** **Out:**
@ -208,29 +208,29 @@ Return Float rounded into a long
* X = hMem * X = hMem
CS : CS :
A = EC A = EC
# FreeMem
# FreeMem
**In:** **In:**
A = hMem To Free A = hMem To Free
**Out:** **Out:**
none. none.
(X,Y unmodified) (X,Y unmodified)
# GetMemPtr
# GetMemPtr
**In:** **In:**
A = hMem A = hMem
**Out:** **Out:**
Y,A = PTR to MemBlock Y,A = PTR to MemBlock
(X unmodified) (X unmodified)
# GetMemByID
# GetMemByID
**In:** **In:**
A = hMem A = hMem
**Out:** **Out:**
Y,A = ZPMemMgrSPtr = PTR to S.MEM Y,A = ZPMemMgrSPtr = PTR to S.MEM
X unmodified X unmodified
# NewStr
# NewStr
Create a new copy of this C-String Create a new copy of this C-String
**In:** **In:**
Y,A = Ptr to source C-String Y,A = Ptr to source C-String
@ -240,8 +240,8 @@ Create a new copy of this C-String
X = hMem (PSTR) X = hMem (PSTR)
CS : error CS : error
A = SYS error code A = SYS error code
# SListGetByID
# SListGetByID
**In:** **In:**
PUSHB = hSList PUSHB = hSList
PUSHW = KeyID PUSHW = KeyID
@ -249,8 +249,8 @@ Create a new copy of this C-String
PUSHW = Key Ptr PUSHW = Key Ptr
**Out:** **Out:**
X,Y = Next KeyID X,Y = Next KeyID
# SListUpdateByID
# SListUpdateByID
**In:** **In:**
PUSHB = hSList PUSHB = hSList
PUSHW = KeyID PUSHW = KeyID
@ -258,8 +258,8 @@ Create a new copy of this C-String
**Out:** **Out:**
A = Key Length A = Key Length
X,Y = KeyID X,Y = KeyID
# SListAdd # SListAdd
**In:** **In:**
PUSHB = hSList PUSHB = hSList
PUSHW = Key Ptr PUSHW = Key Ptr
@ -267,8 +267,8 @@ Create a new copy of this C-String
**Out:** **Out:**
A = Key Length A = Key Length
X,Y = KeyID X,Y = KeyID
# SListLookup # SListLookup
**In:** **In:**
PUSHB = hSList PUSHB = hSList
PUSHW = Key Ptr PUSHW = Key Ptr
@ -276,25 +276,25 @@ Create a new copy of this C-String
**Out:** **Out:**
A = Key Length A = Key Length
X,Y = KeyID X,Y = KeyID
# SListNew # SListNew
**In:** **In:**
**Out:** **Out:**
A=hSList A=hSList
# SListFree # SListFree
**In:** **In:**
A=hSList A=hSList
**Out:** **Out:**
# GetStkObjProp
# GetStkObjProp
**In:** **In:**
A = hObject (AUX Memory) A = hObject (AUX Memory)
Y = Property Index Y = Property Index
**Out:** **Out:**
Y,A = Property Value Y,A = Property Value
# NewStkObj
# NewStkObj
**In:** **In:**
Y,A = Size Requested Y,A = Size Requested
**Out:** **Out:**
@ -303,15 +303,15 @@ Create a new copy of this C-String
* X = hMem * X = hMem
CS : CS :
A = EC A = EC
# FreeStkObj
# FreeStkObj
**In:** **In:**
A = hMem To Free (AUX Memory) A = hMem To Free (AUX Memory)
**Out:** **Out:**
none. none.
(X,Y unmodified) (X,Y unmodified)
# LoadStkObj
# LoadStkObj
Load a file in AUX memory (Stock Objects) Load a file in AUX memory (Stock Objects)
**In:** **In:**
PUSHW = AUXTYPE (Handled by.... PUSHW = AUXTYPE (Handled by....
@ -321,6 +321,7 @@ Load a file in AUX memory (Stock Objects)
**Out:** **Out:**
Y,A = File Length Y,A = File Length
X = hMem of Loaded Object in AUX mem X = hMem of Loaded Object in AUX mem
# ExecPSNewEnv.YA # ExecPSNewEnv.YA
# ExecPS.YA (Blocking Parent PID) # ExecPS.YA (Blocking Parent PID)
@ -328,132 +329,135 @@ Load a file in AUX memory (Stock Objects)
# CreatePSNewEnv.YA # CreatePSNewEnv.YA
# CreatePS.YA (Non Blocking) # CreatePS.YA (Non Blocking)
**In:** **In:**
Y,A = PTR To Cmd Line Y,A = PTR To Cmd Line
**Out:** **Out:**
A = Child PSID A = Child PSID
# GetMemStat.YA
# GetMemStat.YA
**In:** **In:**
Y,A = Ptr to 24 bytes buffer Y,A = Ptr to 24 bytes buffer
**Out:** **Out:**
Buffer filled with memory stats Buffer filled with memory stats
# GetPSStatus.A
# GetPSStatus.A
**In:** **In:**
A = PID A = PID
**Out:** **Out:**
A = Status Byte A = Status Byte
# GetPSStat.YA
# GetPSStat.YA
**In:** **In:**
Y,A = Ptr to 24 bytes buffer Y,A = Ptr to 24 bytes buffer
**Out:** **Out:**
Buffer filled with PS stats Buffer filled with PS stats
# Stat # Stat
Return information about a file Return information about a file
## In : **In:**
PUSHW = PTR to S.STAT buffer PUSHW = PTR to S.STAT buffer
PUSHW = PTR to Filename (C-String) PUSHW = PTR to Filename (C-String)
## Out : **Out:**
# MKDir.YA # MKDir.YA
**In:** **In:**
Y,A = DIR name Y,A = DIR name
**Out:** **Out:**
CC : success CC : success
CS : error CS : error
A = EC A = EC
# MkNod.YA
# MkNod.YA
return a hFile for a given Device Name return a hFile for a given Device Name
**In:** **In:**
Y,A=DevName Y,A=DevName
**Out:** **Out:**
CC = OK, CS = ERROR CC = OK, CS = ERROR
A = hFILE A = hFILE
# MKFIFO
# MKFIFO
return a hFILE to a new FIFO return a hFILE to a new FIFO
**In:** **In:**
**Out:** **Out:**
CC = OK, CS = ERROR CC = OK, CS = ERROR
A = hFILE A = hFILE
# FPutC # FPutC
Print A (char) to hFILE Print A (char) to hFILE
## C ## C
`int fputc ( int character, hFILE stream );` `int fputc ( int character, hFILE stream );`
## ASM
## ASM
**In:** **In:**
Y : character Y : character
A : stream A : stream
**Out:** **Out:**
CC = success CC = success
# PutChar # PutChar
## C ## C
`int putchar ( int character );` `int putchar ( int character );`
## ASM
## ASM
Print A (char) to StdOut Print A (char) to StdOut
**In:** **In:**
A : char to print A : char to print
**Out:** **Out:**
CC = success CC = success
# PutS # PutS
Write Str to StdOut, appends '\r\n' Write Str to StdOut, appends '\r\n'
## C
## C
`int puts ( const char * str );` `int puts ( const char * str );`
**In:** **In:**
Y,A : CPtr Y,A : CPtr
**Out:** **Out:**
CC = success CC = success
# FPutS # FPutS
Write Str to FILE Write Str to FILE
## C
## C
`int fputs ( const char * str, hFILE stream );` `int fputs ( const char * str, hFILE stream );`
**In:** **In:**
PUSHB : hFILE PUSHB : hFILE
Y,A: str Y,A: str
**Out:** **Out:**
CC = success CC = success
# PrintF/SPrintF/FPrintF # PrintF/SPrintF/FPrintF
Prints C-Style String Prints C-Style String
## C
## C
`int printf ( const char * format, ... );` `int printf ( const char * format, ... );`
`int sprintf ( char * str, const char * format, ... );` `int sprintf ( char * str, const char * format, ... );`
`int fprintf ( FILE * stream, const char * format, ... );` `int fprintf ( hFILE stream, const char * format, ... );`
## ASM
## ASM
**In:** **In:**
PrintF : PrintF : (example is for printing Y,A as integer : format="Y,A= %I", 2 bytes)
PUSH ... `>PUSHYA`
Y,A = PTR to CStr `>PUSHBI 2`
`>LDYAI format`
`>SYSCALL printf`
SPrintF : SPrintF :
PUSH ... `>PUSHYA`
PUSHW = PTR to CStr `>PUSHBI 2`
Y,A = Ptr to Dst Buffer `>PUSHWI format`
`>LDYAI str`
`>SYSCALL sprintf`
FPrintF : FPrintF :
PUSH ... `>PUSHYA`
PUSHW = PTR to CStr `>PUSHBI 2`
A = hFILE `>PUSHWI format`
`lda hFILE`
`>SYSCALL fprintf`
**Out:** **Out:**
CC : success CC : success, Y,A = bytes sent
CS : error code from Output CS : error, A = code from Output
Specifiers : Specifiers :
+ %b : pull 1 byte to Print BIN + %b : pull 1 byte to Print BIN
+ %B : pull 2 bytes to Print BIN + %B : pull 2 bytes to Print BIN
@ -487,35 +491,35 @@ Modifiers for len and padding :
+ %011s : 'ABCDEFGH000' + %011s : 'ABCDEFGH000'
+ %2f : '3.14' + %2f : '3.14'
# GetChar
# GetChar
Get char from StdIn Get char from StdIn
**In:** **In:**
none. none.
**Out:** **Out:**
CC = success CC = success
A = char A = char
# GetC # GetC
Get char from Node Get char from Node
## C ## C
`int getc ( FILE * stream );` `int getc ( FILE * stream );`
## ASM
## ASM
**In:** **In:**
A = hNODE A = hNODE
**Out:** **Out:**
CC = success CC = success
A = char A = char
# SScanF # SScanF
Read formatted data from string Read formatted data from string
## C ## C
`int sscanf ( const char * s, const char * format, ...);` `int sscanf ( const char * s, const char * format, ...);`
## ASM
## ASM
**In:** **In:**
`>PUSHBI Argument Byte count` `>PUSHBI Argument Byte count`
`>PUSHWI format` `>PUSHWI format`
@ -531,11 +535,10 @@ Read formatted data from string
`>LDYA s` `>LDYA s`
**Out:** **Out:**
Y,A = Number of arguments filled. Y,A = Number of arguments filled.
# FOpen # FOpen
Open a file Open a file
## In : **In:**
PUSHW = AUXTYPE PUSHW = AUXTYPE
PUSHB = TYPE PUSHB = TYPE
PUSHB = MODE PUSHB = MODE
@ -545,54 +548,49 @@ Open a file
SYS.FOpen.T : Open/Append in Text mode SYS.FOpen.T : Open/Append in Text mode
SYS.FOpen.X : Create if not exists SYS.FOpen.X : Create if not exists
PUSHW = PATH (PSTR) PUSHW = PATH (PSTR)
## Out : **Out:**
CC : A = hFILE CC : A = hFILE
CS : A = EC CS : A = EC
# FClose.A # FClose.A
Close a file Close a file
## In : **In:**
A = hFILE A = hFILE
## Out : **Out:**
# FRead # FRead
int fread ( void * ptr, int count, FILE * stream ); int fread ( void * ptr, int count, FILE * stream );
Read bytes from file Read bytes from file
## In : **In:**
PUSHW = Dest Ptr PUSHW = Dest Ptr
PUSHW = Bytes To Read PUSHW = Bytes To Read
PUSHB = hFILE PUSHB = hFILE
## Out : **Out:**
Y,A = Bytes Read Y,A = Bytes Read
# FWrite
# FWrite
int fwrite ( const void * ptr, int count, FILE * stream ); int fwrite ( const void * ptr, int count, FILE * stream );
Write bytes to file Write bytes to file
**In:** **In:**
PUSHW = Src Ptr PUSHW = Src Ptr
PUSHW = Bytes To Write PUSHW = Bytes To Write
PUSHB = hFILE PUSHB = hFILE
# Out: # Out:
Y,A = Bytes Written Y,A = Bytes Written
# FFlush.A
# FFlush.A
**In:** **In:**
A = hFILE A = hFILE
# FSeek
# FSeek
Set the file-position indicator for hFILE Set the file-position indicator for hFILE
**In:** **In:**
PUSHW = Ptr to Offset (DWORD) PUSHW = Ptr to Offset (DWORD)
PUSHB = From PUSHB = From
PUSHB = hFILE PUSHB = hFILE
# FEOF.A
# FEOF.A
Test the end-of-file indicator for hFILE Test the end-of-file indicator for hFILE
**In:** **In:**
A = hFILE A = hFILE
@ -601,135 +599,138 @@ Test the end-of-file indicator for hFILE
A=0 EOF A=0 EOF
A =0 NOT EOF A =0 NOT EOF
CS : CS :
# FTell
# FTell
Return the current value of the file-position indicator Return the current value of the file-position indicator
**In:** **In:**
PUSHW = Ptr to Offset (DWORD) PUSHW = Ptr to Offset (DWORD)
PUSHB = hFILE PUSHB = hFILE
**Out:** **Out:**
Offset = Offset Offset = Offset
# Remove.YA # Remove.YA
# Rename # Rename
Rename a file Rename a file
## In : **In:**
PUSHW = New Name PUSHW = New Name
PUSHW = Old Name PUSHW = Old Name
## Out : **Out:**
# StrToF # StrToF
Convert String to 40 bits Float Convert String to 40 bits Float
## C ## C
`float strtof (const char* str, char** endptr);` `float strtof (const char* str, char** endptr);`
## ASM
## ASM
**In:** **In:**
`>PUSHWI EndPtr` `>PUSHWI EndPtr`
`>LDYA str` `>LDYA str`
**Out:** **Out:**
On stack (float) On stack (float)
# AToF # AToF
Convert String to 40 bits Float Convert String to 40 bits Float
## C ## C
`float atof (const char* str);` `float atof (const char* str);`
## ASM
## ASM
**In:** **In:**
`>LDYA str` `>LDYA str`
**Out:** **Out:**
On stack (float) On stack (float)
# StrToL/StrToUL # StrToL/StrToUL
Convert String to 32 bits (unsigned) int Convert String to 32 bits (unsigned) int
## C
## C
`long strtol (const char* str, char** endptr, int base);` `long strtol (const char* str, char** endptr, int base);`
`unsigned long strtoul (const char* str, char** endptr, int base);` `unsigned long strtoul (const char* str, char** endptr, int base);`
## ASM
## ASM
**In:** **In:**
`>PUSHB Base` `>PUSHB Base`
`>PUSHWI EndPtr` `>PUSHWI EndPtr`
`>LDYA str` `>LDYA str`
**Out:** **Out:**
On stack (long) On stack (long)
# AToL # AToL
Convert String to 32 bits int Convert String to 32 bits int
## C ## C
`long atol ( const char * str );` `long atol ( const char * str );`
## ASM
## ASM
**In:** **In:**
`>LDYA str` `>LDYA str`
**Out:** **Out:**
On stack (long) On stack (long)
# AToI.YA # AToI.YA
## C ## C
`int atoi ( const char * str );` `int atoi ( const char * str );`
## ASM
## ASM
**In:** **In:**
`>LDYA str` `>LDYA str`
**Out:** **Out:**
Y,A = Int Y,A = Int
# RealPath.YA # RealPath.YA
Return the canonicalized absolute pathname Return the canonicalized absolute pathname
## In : **In:**
Y,A = Ptr to Relative Filename (C-String) Y,A = Ptr to Relative Filename (C-String)
## Out : **Out:**
CC : success CC : success
Y,A = Ptr to Full Path (C-String) Y,A = Ptr to Full Path (C-String)
X = hMem of Full Path X = hMem of Full Path
CS : A = Error Code CS : A = Error Code
# StrLen # StrLen
Returns Length of C-String Returns Length of C-String
## C ## C
`char * strcat ( char * destination, const char * source );` `char * strcat ( char * destination, const char * source );`
## ASM
## ASM
**In:** **In:**
Y,A = Ptr to CSTR Y,A = Ptr to CSTR
**Out:** **Out:**
Y,A = String length Y,A = String length
# StrCat # StrCat
Concatenate strings
Append SRC to DST
**In:**
PUSHW = Ptr to SRC (CSTR)
PUSHW = Ptr to DST (CSTR)
**Out:**
DST = DST+SRC
# StrCpy
Copy string
## C ## C
`char * strcat ( char * destination, const char * source );`
`char * strcpy ( char * destination, const char * source );`
## ASM ## ASM
**In:** **In:**
PUSHW = Ptr to SRC (CSTR) `>PUSHWI source`
PUSHW = Ptr to DST (CSTR) `>LDYAI destination`
`>SYSCALL strcat`
**Out:** **Out:**
DST = SRC Y,A = destination
# StrMatch
# StrCpy
Copy string
## C
`char * strcpy ( char * destination, const char * source );`
## ASM
**In:**
`>PUSHWI source`
`>LDYAI destination`
`>SYSCALL strcpy`
**Out:**
Y,A = destination
# StrMatch
Compare a String against pattern Compare a String against pattern
**In:** **In:**
PUSHW = PTR to Pattern (e.g. '*test?.txt') PUSHW = PTR to Pattern (e.g. '*test?.txt')
@ -737,23 +738,23 @@ Compare a String against pattern
**Out:** **Out:**
CC : match CC : match
CS : no match CS : no match
# StrUpr/StrLwr
# StrUpr/StrLwr
Convert string to UPPERCASE/lowercase Convert string to UPPERCASE/lowercase
**In:** **In:**
Y,A = PTR to String (CSTR) Y,A = PTR to String (CSTR)
**Out:** **Out:**
Uppercased/lowercased String in Buffer Uppercased/lowercased String in Buffer
# StrCmp
# StrCmp
Compare 2 strings Compare 2 strings
**In:** **In:**
PUSHW = Ptr to String1 (CSTR) PUSHW = Ptr to String1 (CSTR)
PUSHW = Ptr to String2 (CSTR) PUSHW = Ptr to String2 (CSTR)
**Out:** **Out:**
DST = SRC DST = SRC
# StrICmp
# StrICmp
Compare 2 strings Compare 2 strings
**In:** **In:**
PUSHW = Ptr to String1 (CSTR) PUSHW = Ptr to String1 (CSTR)
@ -761,54 +762,62 @@ Compare 2 strings
**Out:** **Out:**
CC, Y,A=0 CC, Y,A=0
CS, Y,A > 0 or < 0 CS, Y,A > 0 or < 0
# Time # Time
Get System Time in Buffer Get System Time in Buffer
## In :
## C
`time_t time (time_t* timer);`
##ASM
**In:**
Y,A = PTR to S.TIME Y,A = PTR to S.TIME
## Out : **Out:**
S.TIME filled with System date/time S.TIME filled with System date/time
# PTime2Time # PTime2Time
Convert ProDOS Time To S.TIME Convert ProDOS Time To S.TIME
## In :
## C
`time_t time (long ptime, time_t* timer);`
##ASM
**In :**
PUSHW = Dst PTR To S.TIME PUSHW = Dst PTR To S.TIME
PUSHW = Src PTR to ProDOS DATE/TIME (DWORD) PUSHW = Src PTR to ProDOS DATE/TIME (DWORD)
**Out:**
# CTime2Time # CTime2Time
Convert CTIME to S.TIME Convert CTIME to S.TIME
## In : **In:**
PUSHW = Dst PTR To S.TIME PUSHW = Dst PTR To S.TIME
PUSHW = Src CTIME DWORD PUSHW = Src CTIME DWORD
# StrFTime # StrFTime
## C ## C
Convert S.TIME struct to CSTR Convert S.TIME struct to CSTR
`size_t strftime (char* ptr, size_t maxsize, const char* format, const struct tm* timeptr );` `size_t strftime (char* ptr, size_t maxsize, const char* format, const struct tm* timeptr );`
## ASM
## ASM
**In:** **In:**
PUSHW = Dst PTR To CSTR Buf PUSHW = Dst PTR To CSTR Buf
PUSHW = Src PTR To Format String PUSHW = Src PTR To Format String
%a : Abbreviated weekday name : Thu + %a : Abbreviated weekday name : Thu
%A : Full weekday name : Thursday + %A : Full weekday name : Thursday
%b : Abbreviated month name : Aug + %b : Abbreviated month name : Aug
%B : Full month name : August + %B : Full month name : August
%d : Day of the month, zero-padded (01-31) + %d : Day of the month, zero-padded (01-31)
%H : Hour in 24h format (00-23) 14 + %H : Hour in 24h format (00-23) 14
%I : Hour in 12h format (01-12) 02 + %I : Hour in 12h format (01-12) 02
%m : Month as a decimal number (01-12) 08 + %m : Month as a decimal number (01-12) 08
%M : Minute (00-59) 55 + %M : Minute (00-59) 55
%p : AM or PM designation PM + %p : AM or PM designation PM
%S : Second (00-61) 02 + %S : Second (00-61) 02
%w : Weekday as a decimal number with Sunday as 0 (0-6) + %w : Weekday as a decimal number with Sunday as 0 (0-6)
%y : Year, last two digits (00-99) + %y : Year, last two digits (00-99)
%Y : Year four digits 2001 + %Y : Year four digits 2001
PUSHW = Src PTR To S.Time
PUSHW = Src PTR To S.Time
**Out:** **Out:**
none. always succeed. none. always succeed.

View File

@ -1,20 +1,17 @@
*** Auto generated by docgen.cmd *** *** Auto generated by docgen.cmd ***
# GetProDOSCatSize # GetProDOSCatSize
Compute space needed for ProDOS Catalog Compute space needed for ProDOS Catalog
## In : **In:**
PUSHW = DevSize (in 512b blocks) PUSHW = DevSize (in 512b blocks)
PUSHB = Catalog Size (in blocks) PUSHB = Catalog Size (in blocks)
PUSHB = Options PUSHB = Options
## Out : **Out:**
X=BlockCount (max 22) X=BlockCount (max 22)
Y,A=BufSize (max $4400) Y,A=BufSize (max $4400)
# BuildProDOSCat # BuildProDOSCat
**In:**
## In :
PUSHW = DevSize (in 512b blocks) PUSHW = DevSize (in 512b blocks)
PUSHB = Catalog Size (in blocks) PUSHB = Catalog Size (in blocks)
PUSHB = Options PUSHB = Options
@ -28,8 +25,8 @@
absolute MAX DstBuf size= absolute MAX DstBuf size=
7 for Disk II(280blk),3.5(1600),3.5HD(2880) 7 for Disk II(280blk),3.5(1600),3.5HD(2880)
22 for 32mb Hardisk... 22 for 32mb Hardisk...
# TrkW16s
# TrkW16s
Write a track (16 sectors) Write a track (16 sectors)
**In:** **In:**
PUSHW = Ptr to 16*256 buffer PUSHW = Ptr to 16*256 buffer
@ -39,8 +36,8 @@ Write a track (16 sectors)
CC : success CC : success
CS : A = Error CS : A = Error
A=0, currently starting/seeking... A=0, currently starting/seeking...
# TrkWNIB
# TrkWNIB
Write a track (NIBBLE) Write a track (NIBBLE)
**In:** **In:**
PUSHW = Ptr to NIBBLE buffer (0 ended) PUSHW = Ptr to NIBBLE buffer (0 ended)

View File

@ -1,48 +1,48 @@
*** Auto generated by docgen.cmd *** *** Auto generated by docgen.cmd ***
## MD5 ## MD5
Return MD5 Hash for input String Return MD5 Hash for input String
# C # C
`void md5 (const char* str, char* digest);` `void md5 (const char* str, char* digest);`
# ASM
# ASM
**In:** **In:**
`>PUSHW digest` `>PUSHW digest`
`>LDYA str` `>LDYA str`
**Out:** **Out:**
CC CC
## MD5Init ## MD5Init
Initialize a MD5 computation Initialize a MD5 computation
# C # C
`HANDLE md5init ();` `HANDLE md5init ();`
# ASM
# ASM
**In:** **In:**
**Out:** **Out:**
A = hMem To S.MD5 A = hMem To S.MD5
## MD5Update ## MD5Update
Add Data to MD5 computation Add Data to MD5 computation
# C # C
`int md5update (HANDLE md5, char* data, int len);` `int md5update (HANDLE md5, char* data, int len);`
# ASM
# ASM
**In:** **In:**
`>PUSHW len` `>PUSHW len`
`>PUSHW data` `>PUSHW data`
`>LDA.G md5` `>LDA.G md5`
**Out:** **Out:**
## MD5Finalize ## MD5Finalize
# C # C
`int md5finalize (HANDLE md5, char* digest);` `int md5finalize (HANDLE md5, char* digest);`
# ASM
# ASM
**In:** **In:**
`>PUSHW digest` `>PUSHW digest`
`>LDA.G md5` `>LDA.G md5`

View File

@ -1,13 +1,11 @@
*** Auto generated by docgen.cmd *** *** Auto generated by docgen.cmd ***
# ARP.Clear # ARP.Clear
Clear ARP Cache Clear ARP Cache
## In : **In:**
**Out:**
## Out :
# ARP.Query # ARP.Query
Query ARP Cache and returns HW address Query ARP Cache and returns HW address
**In:** **In:**
PUSHW PTR to MAC (to fill) PUSHW PTR to MAC (to fill)
@ -15,27 +13,25 @@
**Out:** **Out:**
CC: hit: MAC filled CC: hit: MAC filled
CS: missed CS: missed
# ARP.Add
# ARP.Add
Add a static ARP cache record Add a static ARP cache record
**In:** **In:**
PUSHW PTR to MAC PUSHW PTR to MAC
PUSHW PTR to IP PUSHW PTR to IP
# ARP.GetCAche
# ARP.GetCAche
Return a Ptr to ARP Cache Table Return a Ptr to ARP Cache Table
**In:** **In:**
**Out:** **Out:**
Y,A = PTR to ARP.CACHE Y,A = PTR to ARP.CACHE
# DNS.Clear # DNS.Clear
Clear DNS Cache Clear DNS Cache
## In : **In:**
**Out:**
## Out :
# DNS.Query # DNS.Query
Query DNS for specified host Query DNS for specified host
**In:** **In:**
PUSHW = PTR to IP to fill with cached data PUSHW = PTR to IP to fill with cached data
@ -43,135 +39,109 @@
**Out:** **Out:**
CC: hit: IP filled with address CC: hit: IP filled with address
CS: missed CS: missed
# DNS.Add
# DNS.Add
Add a static DNS record Add a static DNS record
**In:** **In:**
PUSHW = PTR to IP PUSHW = PTR to IP
PUSHW = hostname CSTR to Add PUSHW = hostname CSTR to Add
# DNS.GetCAche
# DNS.GetCAche
Return a Ptr to DNS Cache Table Return a Ptr to DNS Cache Table
**In:** **In:**
**Out:** **Out:**
Y,A = PTR to DNS.CACHE Y,A = PTR to DNS.CACHE
# SKT.New # SKT.New
Create a new socket Create a new socket
## In : **In:**
PUSHW = PTR to S.SOCKET template PUSHW = PTR to S.SOCKET template
## Out : **Out:**
YA = PTR to new S.SOCKET YA = PTR to new S.SOCKET
X = hSocket X = hSocket
# SKT.CloseA # SKT.CloseA
Close socket Close socket
## In : **In:**
A = hSocket A = hSocket
## Out : **Out:**
# SKT.GetA # SKT.GetA
Get Ptr to socket Get Ptr to socket
## In : **In:**
A = hSocket A = hSocket
## Out : **Out:**
Y,A = pS.SOCKET Y,A = pS.SOCKET
# SKT.GetTable # SKT.GetTable
Get socket table Get socket table
## In : **In:**
**Out:**
## Out :
Y,A = pS.SOCKET Y,A = pS.SOCKET
# SKT.AcceptA # SKT.AcceptA
Check for an incoming connection Check for an incoming connection
## In : **In:**
A = hListeningSocket A = hListeningSocket
## Out : **Out:**
A = hSocket A = hSocket
# SKT.MkNodA # SKT.MkNodA
Create a new file from TCP socket Create a new file from TCP socket
## In : **In:**
A = hSocket A = hSocket
## Out : **Out:**
A = hFile A = hFile
# SKT.Write (DGRAM,STREAM,RAW) # SKT.Write (DGRAM,STREAM,RAW)
Send block of data Send block of data
## In : **In:**
PUSHB = hSocket PUSHB = hSocket
PUSHW = pBuf PUSHW = pBuf
PUSHW = len PUSHW = len
## Out : **Out:**
# SKT.ReadA (DGRAM,RAW) # SKT.ReadA (DGRAM,RAW)
**In:**
## In :
A = hSocket A = hSocket
## Out : **Out:**
A = hFrame A = hFrame
# SKT.PutC (STREAM) # SKT.PutC (STREAM)
Write a Char To Stream Write a Char To Stream
## In : **In:**
PUSHB = hSocket PUSHB = hSocket
PUSHB = Char PUSHB = Char
## Out : **Out:**
# SKT.PutS (STREAM) # SKT.PutS (STREAM)
Write Line in pBuf Write Line in pBuf
## In : **In:**
PUSHB = hSocket PUSHB = hSocket
PUSHW = PSTR PUSHW = PSTR
## Out : **Out:**
# SKT.GetC.A (STREAM) # SKT.GetC.A (STREAM)
Read a Char From Stream in A Read a Char From Stream in A
## In : **In:**
A = hSocket A = hSocket
## Out : **Out:**
A = char A = char
# SKT.GetS (STREAM) # SKT.GetS (STREAM)
Read a CR terminated Line in pBuf Read a CR terminated Line in pBuf
## In : **In:**
PUSHB = hSocket PUSHB = hSocket
PUSHW = pBuf PUSHW = pBuf
PUSHW = len PUSHW = len
## Out : **Out:**
Y,A = bytes read Y,A = bytes read
# SKT.Read (STREAM) # SKT.Read (STREAM)
Read data in pBuf Read data in pBuf
## In : **In:**
PUSHB = hSocket PUSHB = hSocket
PUSHW = pBuf PUSHW = pBuf
PUSHW = len PUSHW = len
## Out : **Out:**
Y,A = bytes transfered Y,A = bytes transfered

View File

@ -79,8 +79,8 @@ for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do (
set bInList=0 set bInList=0
) )
) )
(echo !LINE!)>>!DOCFILE!
if "!line:~0,1!" EQU "#" echo.>>!DOCFILE! if "!line:~0,1!" EQU "#" echo.>>!DOCFILE!
(echo !LINE! )>>!DOCFILE!
) )
) )
) )

View File

@ -79,11 +79,11 @@ LIB.UNLOAD clc
*/-------------------------------------- */--------------------------------------
* # GetProDOSCatSize * # GetProDOSCatSize
* Compute space needed for ProDOS Catalog * Compute space needed for ProDOS Catalog
* ## In : * **In:**
* PUSHW = DevSize (in 512b blocks) * PUSHW = DevSize (in 512b blocks)
* PUSHB = Catalog Size (in blocks) * PUSHB = Catalog Size (in blocks)
* PUSHB = Options * PUSHB = Options
* ## Out : * **Out:**
* X=BlockCount (max 22) * X=BlockCount (max 22)
* Y,A=BufSize (max $4400) * Y,A=BufSize (max $4400)
*\-------------------------------------- *\--------------------------------------
@ -119,7 +119,7 @@ GetProDOSCatSize.I
rts rts
*/-------------------------------------- */--------------------------------------
* # BuildProDOSCat * # BuildProDOSCat
* ## In : * **In:**
* PUSHW = DevSize (in 512b blocks) * PUSHW = DevSize (in 512b blocks)
* PUSHB = Catalog Size (in blocks) * PUSHB = Catalog Size (in blocks)
* PUSHB = Options * PUSHB = Options

View File

@ -42,7 +42,7 @@ LIB.UNLOAD clc
rts rts
*/-------------------------------------- */--------------------------------------
* # Pak * # Pak
* ## In : * **In:**
* PUSHW = Src PTR * PUSHW = Src PTR
* PUSHW = Src Length * PUSHW = Src Length
* PUSHW = Dst PTR Output Buffer * PUSHW = Dst PTR Output Buffer

View File

@ -5,8 +5,8 @@ AUTO 4,1
*/-------------------------------------- */--------------------------------------
* # ARP.Clear * # ARP.Clear
* Clear ARP Cache * Clear ARP Cache
* ## In : * **In:**
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
ARP.Clear ldx #K.ARPCACHE.SIZE*S.ARPCACHE ARP.Clear ldx #K.ARPCACHE.SIZE*S.ARPCACHE
.1 stz ARP.CACHE-1,x .1 stz ARP.CACHE-1,x

View File

@ -5,8 +5,8 @@ AUTO 4,1
*/-------------------------------------- */--------------------------------------
* # DNS.Clear * # DNS.Clear
* Clear DNS Cache * Clear DNS Cache
* ## In : * **In:**
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
DNS.Clear ldx #K.DNSCACHE.SIZE*S.DNSCACHE DNS.Clear ldx #K.DNSCACHE.SIZE*S.DNSCACHE
.1 stz DNS.CACHE-1,x .1 stz DNS.CACHE-1,x

View File

@ -5,9 +5,9 @@ AUTO 4,1
*/-------------------------------------- */--------------------------------------
* # SKT.New * # SKT.New
* Create a new socket * Create a new socket
* ## In : * **In:**
* PUSHW = PTR to S.SOCKET template * PUSHW = PTR to S.SOCKET template
* ## Out : * **Out:**
* YA = PTR to new S.SOCKET * YA = PTR to new S.SOCKET
* X = hSocket * X = hSocket
*\-------------------------------------- *\--------------------------------------
@ -122,9 +122,9 @@ SKT.New.Listen sec
*/-------------------------------------- */--------------------------------------
* # SKT.CloseA * # SKT.CloseA
* Close socket * Close socket
* ## In : * **In:**
* A = hSocket * A = hSocket
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
SKT.CloseA jsr SKT.GetA.I get SKT in ZPPtrSKT, S.SOCKET.SOCK in A SKT.CloseA jsr SKT.GetA.I get SKT in ZPPtrSKT, S.SOCKET.SOCK in A
bcs .99 bcs .99
@ -186,9 +186,9 @@ SKT.CloseA jsr SKT.GetA.I get SKT in ZPPtrSKT, S.SOCKET.SOCK in A
*/-------------------------------------- */--------------------------------------
* # SKT.GetA * # SKT.GetA
* Get Ptr to socket * Get Ptr to socket
* ## In : * **In:**
* A = hSocket * A = hSocket
* ## Out : * **Out:**
* Y,A = pS.SOCKET * Y,A = pS.SOCKET
*\-------------------------------------- *\--------------------------------------
SKT.GetA jsr SKT.GetA.I SKT.GetA jsr SKT.GetA.I
@ -243,8 +243,8 @@ SKT.GetA.I and #$7f
*/-------------------------------------- */--------------------------------------
* # SKT.GetTable * # SKT.GetTable
* Get socket table * Get socket table
* ## In : * **In:**
* ## Out : * **Out:**
* Y,A = pS.SOCKET * Y,A = pS.SOCKET
*\-------------------------------------- *\--------------------------------------
SKT.GetTable lda hSocketTable SKT.GetTable lda hSocketTable
@ -254,9 +254,9 @@ SKT.GetTable lda hSocketTable
*/-------------------------------------- */--------------------------------------
* # SKT.AcceptA * # SKT.AcceptA
* Check for an incoming connection * Check for an incoming connection
* ## In : * **In:**
* A = hListeningSocket * A = hListeningSocket
* ## Out : * **Out:**
* A = hSocket * A = hSocket
*\-------------------------------------- *\--------------------------------------
SKT.AcceptA jsr SKT.GetA.I SKT.AcceptA jsr SKT.GetA.I
@ -295,9 +295,9 @@ SKT.AcceptA jsr SKT.GetA.I
*/-------------------------------------- */--------------------------------------
* # SKT.MkNodA * # SKT.MkNodA
* Create a new file from TCP socket * Create a new file from TCP socket
* ## In : * **In:**
* A = hSocket * A = hSocket
* ## Out : * **Out:**
* A = hFile * A = hFile
*\-------------------------------------- *\--------------------------------------
SKT.MkNodA sta .1+1 SKT.MkNodA sta .1+1
@ -338,11 +338,11 @@ SKT.MkNodA sta .1+1
*/-------------------------------------- */--------------------------------------
* # SKT.Write (DGRAM,STREAM,RAW) * # SKT.Write (DGRAM,STREAM,RAW)
* Send block of data * Send block of data
* ## In : * **In:**
* PUSHB = hSocket * PUSHB = hSocket
* PUSHW = pBuf * PUSHW = pBuf
* PUSHW = len * PUSHW = len
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
SKT.Write >PULLW ZPDataInLen SKT.Write >PULLW ZPDataInLen
>PULLW ZPDataInPtr >PULLW ZPDataInPtr
@ -442,9 +442,9 @@ SKT.Write.TCP ldy #S.SOCKET.TCP.STATUS
.99 rts .99 rts
*/-------------------------------------- */--------------------------------------
* # SKT.ReadA (DGRAM,RAW) * # SKT.ReadA (DGRAM,RAW)
* ## In : * **In:**
* A = hSocket * A = hSocket
* ## Out : * **Out:**
* A = hFrame * A = hFrame
*\-------------------------------------- *\--------------------------------------
SKT.ReadA jsr SKT.GetA.I SKT.ReadA jsr SKT.GetA.I
@ -479,10 +479,10 @@ SKT.ReadA jsr SKT.GetA.I
*/-------------------------------------- */--------------------------------------
* # SKT.PutC (STREAM) * # SKT.PutC (STREAM)
* Write a Char To Stream * Write a Char To Stream
* ## In : * **In:**
* PUSHB = hSocket * PUSHB = hSocket
* PUSHB = Char * PUSHB = Char
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
SKT.PutC >PULLB TmpByte SKT.PutC >PULLB TmpByte
@ -499,10 +499,10 @@ SKT.PutC >PULLB TmpByte
*/-------------------------------------- */--------------------------------------
* # SKT.PutS (STREAM) * # SKT.PutS (STREAM)
* Write Line in pBuf * Write Line in pBuf
* ## In : * **In:**
* PUSHB = hSocket * PUSHB = hSocket
* PUSHW = PSTR * PUSHW = PSTR
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
SKT.PutS >PULLW ZPDataOutPtr SKT.PutS >PULLW ZPDataOutPtr
lda (ZPDataInPtr) lda (ZPDataInPtr)
@ -529,9 +529,9 @@ SKT.PutS.1 >PULLA
*/-------------------------------------- */--------------------------------------
* # SKT.GetC.A (STREAM) * # SKT.GetC.A (STREAM)
* Read a Char From Stream in A * Read a Char From Stream in A
* ## In : * **In:**
* A = hSocket * A = hSocket
* ## Out : * **Out:**
* A = char * A = char
*\-------------------------------------- *\--------------------------------------
SKT.GetC.A stz bTextMode SKT.GetC.A stz bTextMode
@ -553,11 +553,11 @@ SKT.GetC.A stz bTextMode
*/-------------------------------------- */--------------------------------------
* # SKT.GetS (STREAM) * # SKT.GetS (STREAM)
* Read a CR terminated Line in pBuf * Read a CR terminated Line in pBuf
* ## In : * **In:**
* PUSHB = hSocket * PUSHB = hSocket
* PUSHW = pBuf * PUSHW = pBuf
* PUSHW = len * PUSHW = len
* ## Out : * **Out:**
* Y,A = bytes read * Y,A = bytes read
*\-------------------------------------- *\--------------------------------------
SKT.GetS sec SKT.GetS sec
@ -565,11 +565,11 @@ SKT.GetS sec
*/-------------------------------------- */--------------------------------------
* # SKT.Read (STREAM) * # SKT.Read (STREAM)
* Read data in pBuf * Read data in pBuf
* ## In : * **In:**
* PUSHB = hSocket * PUSHB = hSocket
* PUSHW = pBuf * PUSHW = pBuf
* PUSHW = len * PUSHW = len
* ## Out : * **Out:**
* Y,A = bytes transfered * Y,A = bytes transfered
*\-------------------------------------- *\--------------------------------------
SKT.Read clc SKT.Read clc

View File

@ -4,20 +4,20 @@ AUTO 4,1
*-------------------------------------- *--------------------------------------
* # FStat * # FStat
* Return information about a hfile * Return information about a hfile
* ## In : * **In:**
* PUSHW = PTR to S.STAT buffer * PUSHW = PTR to S.STAT buffer
* PUSHB = hFile * PUSHB = hFile
* ## Out : * **Out:**
*-------------------------------------- *--------------------------------------
*jsr PFT.CheckNodeSTK *jsr PFT.CheckNodeSTK
*/-------------------------------------- */--------------------------------------
* # Stat * # Stat
* Return information about a file * Return information about a file
* ## In : * **In:**
* PUSHW = PTR to S.STAT buffer * PUSHW = PTR to S.STAT buffer
* PUSHW = PTR to Filename (C-String) * PUSHW = PTR to Filename (C-String)
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
K.Stat jsr PFT.CheckPathSTK K.Stat jsr PFT.CheckPathSTK
jsr STDIO.PullMLIPath jsr STDIO.PullMLIPath

View File

@ -108,23 +108,29 @@ K.FPutS.1 jsr K.GetMemPtr.A
* ## C * ## C
* `int printf ( const char * format, ... );` * `int printf ( const char * format, ... );`
* `int sprintf ( char * str, const char * format, ... );` * `int sprintf ( char * str, const char * format, ... );`
* `int fprintf ( FILE * stream, const char * format, ... );` * `int fprintf ( hFILE stream, const char * format, ... );`
* ## ASM * ## ASM
* **In:** * **In:**
* PrintF : * PrintF : (example is for printing Y,A as integer : format="Y,A= %I", 2 bytes)
* PUSH ... * `>PUSHYA`
* Y,A = PTR to CStr * `>PUSHBI 2`
* `>LDYAI format`
* `>SYSCALL printf`
* SPrintF : * SPrintF :
* PUSH ... * `>PUSHYA`
* PUSHW = PTR to CStr * `>PUSHBI 2`
* Y,A = Ptr to Dst Buffer * `>PUSHWI format`
* `>LDYAI str`
* `>SYSCALL sprintf`
* FPrintF : * FPrintF :
* PUSH ... * `>PUSHYA`
* PUSHW = PTR to CStr * `>PUSHBI 2`
* A = hFILE * `>PUSHWI format`
* `lda hFILE`
* `>SYSCALL fprintf`
* **Out:** * **Out:**
* CC : success * CC : success, Y,A = bytes sent
* CS : error code from Output * CS : error, A = code from Output
* Specifiers : * Specifiers :
* + %b : pull 1 byte to Print BIN * + %b : pull 1 byte to Print BIN
* + %B : pull 2 bytes to Print BIN * + %B : pull 2 bytes to Print BIN
@ -200,11 +206,11 @@ K.PrintF.1 ldy #0
cmp #'0' ...a 0...mmm... padding char? cmp #'0' ...a 0...mmm... padding char?
bne .4 bne .4
ldx K.PrintF.PadL K.PrintF.PadL is not nul, so this 0 is second digit ldx K.PrintF.PadL K.PrintF.PadL is not nul, so this 0 is second digit
bne .5 bne .5
* lda #'0' * lda #'0'
sta K.PrintF.PadC no, this is the first 0, so make it K.PrintF.PadC sta K.PrintF.PadC no, this is the first 0, so make it K.PrintF.PadC
bra .2 bra .2
.4 jsr MEM.IsDigit .4 jsr MEM.IsDigit
@ -868,7 +874,7 @@ K.SScanF.GetVAL tya Y=char count parsed
*/-------------------------------------- */--------------------------------------
* # FOpen * # FOpen
* Open a file * Open a file
* ## In : * **In:**
* PUSHW = AUXTYPE * PUSHW = AUXTYPE
* PUSHB = TYPE * PUSHB = TYPE
* PUSHB = MODE * PUSHB = MODE
@ -878,7 +884,7 @@ K.SScanF.GetVAL tya Y=char count parsed
* SYS.FOpen.T : Open/Append in Text mode * SYS.FOpen.T : Open/Append in Text mode
* SYS.FOpen.X : Create if not exists * SYS.FOpen.X : Create if not exists
* PUSHW = PATH (PSTR) * PUSHW = PATH (PSTR)
* ## Out : * **Out:**
* CC : A = hFILE * CC : A = hFILE
* CS : A = EC * CS : A = EC
*\-------------------------------------- *\--------------------------------------
@ -983,9 +989,9 @@ K.FOpen.AUXTYPE .BS 2
*/-------------------------------------- */--------------------------------------
* # FClose.A * # FClose.A
* Close a file * Close a file
* ## In : * **In:**
* A = hFILE * A = hFILE
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
K.FClose.A jsr PFT.CheckNodeA K.FClose.A jsr PFT.CheckNodeA
sta K.FClose.A.8+1 sta K.FClose.A.8+1
@ -1029,11 +1035,11 @@ K.FClose.A.9 rts
* # FRead * # FRead
* int fread ( void * ptr, int count, FILE * stream ); * int fread ( void * ptr, int count, FILE * stream );
* Read bytes from file * Read bytes from file
* ## In : * **In:**
* PUSHW = Dest Ptr * PUSHW = Dest Ptr
* PUSHW = Bytes To Read * PUSHW = Bytes To Read
* PUSHB = hFILE * PUSHB = hFILE
* ## Out : * **Out:**
* Y,A = Bytes Read * Y,A = Bytes Read
*\-------------------------------------- *\--------------------------------------
K.FRead jsr PFT.CheckNodeSTK K.FRead jsr PFT.CheckNodeSTK
@ -1218,10 +1224,10 @@ K.Remove.YA jsr PFT.CheckPathYA
*/-------------------------------------- */--------------------------------------
* # Rename * # Rename
* Rename a file * Rename a file
* ## In : * **In:**
* PUSHW = New Name * PUSHW = New Name
* PUSHW = Old Name * PUSHW = Old Name
* ## Out : * **Out:**
*\-------------------------------------- *\--------------------------------------
K.Rename jsr PFT.CheckPathSTK K.Rename jsr PFT.CheckPathSTK
jsr STDIO.PullMLIPath jsr STDIO.PullMLIPath

View File

@ -274,9 +274,9 @@ STDLIB.32.Clear ldx #3
*/-------------------------------------- */--------------------------------------
* # RealPath.YA * # RealPath.YA
* Return the canonicalized absolute pathname * Return the canonicalized absolute pathname
* ## In : * **In:**
* Y,A = Ptr to Relative Filename (C-String) * Y,A = Ptr to Relative Filename (C-String)
* ## Out : * **Out:**
* CC : success * CC : success
* Y,A = Ptr to Full Path (C-String) * Y,A = Ptr to Full Path (C-String)
* X = hMem of Full Path * X = hMem of Full Path

View File

@ -29,22 +29,19 @@ K.StrLen >STYA ZPPtr1
rts rts
*/-------------------------------------- */--------------------------------------
* # StrCat * # StrCat
* Append SRC to DST * Concatenate strings
* ## C
* `char * strcat ( char * destination, const char * source );`
* ## ASM
* **In:** * **In:**
* PUSHW = Ptr to SRC (CSTR) * `>PUSHWI source`
* PUSHW = Ptr to DST (CSTR) * `>LDYAI destination`
* `>SYSCALL strcat`
* **Out:** * **Out:**
* DST = DST+SRC * Y,A = destination
*\-------------------------------------- *\--------------------------------------
K.StrCat jsr MEM.PullP1P2 K.StrCat sec
.HS 90 BCC
.1 lda (ZPPtr1)
beq K.StrCpy.I
inc ZPPtr1
bne .1
inc ZPPtr1+1
bra .1
*/-------------------------------------- */--------------------------------------
* # StrCpy * # StrCpy
* Copy string * Copy string
@ -52,23 +49,36 @@ K.StrCat jsr MEM.PullP1P2
* `char * strcpy ( char * destination, const char * source );` * `char * strcpy ( char * destination, const char * source );`
* ## ASM * ## ASM
* **In:** * **In:**
* PUSHW = Ptr to SRC (CSTR) * `>PUSHWI source`
* PUSHW = Ptr to DST (CSTR) * `>LDYAI destination`
* `>SYSCALL strcpy`
* **Out:** * **Out:**
* DST = SRC * Y,A = destination
*\-------------------------------------- *\--------------------------------------
K.StrCpy jsr MEM.PullP1P2 K.StrCpy clc
>STYA ZPPtr1
>PULLW ZPPtr2
K.StrCpy.I ldy #0 bcc .2
.1 lda (ZPPtr2),y .1 lda (ZPPtr1)
beq .2
inc ZPPtr1
bne .1
inc ZPPtr1+1
bra .1
.2 ldy #0
.3 lda (ZPPtr2),y
sta (ZPPtr1),y sta (ZPPtr1),y
beq .8 beq .8
iny iny
bne .1 bne .3
inc ZPPtr2+1 inc ZPPtr2+1
inc ZPPtr1+1 inc ZPPtr1+1
bra .1 bra .3
.8 rts .8 rts
*/-------------------------------------- */--------------------------------------

View File

@ -11,9 +11,12 @@ DAY0 .EQ 4 day 0 was a thursday
*/-------------------------------------- */--------------------------------------
* # Time * # Time
* Get System Time in Buffer * Get System Time in Buffer
* ## In : * ## C
* `time_t time (time_t* timer);`
* ##ASM
* **In:**
* Y,A = PTR to S.TIME * Y,A = PTR to S.TIME
* ## Out : * **Out:**
* S.TIME filled with System date/time * S.TIME filled with System date/time
*\-------------------------------------- *\--------------------------------------
K.Time >STYA ZPPtr2 K.Time >STYA ZPPtr2
@ -24,9 +27,13 @@ K.Time >STYA ZPPtr2
*/-------------------------------------- */--------------------------------------
* # PTime2Time * # PTime2Time
* Convert ProDOS Time To S.TIME * Convert ProDOS Time To S.TIME
* ## In : * ## C
* `time_t time (long ptime, time_t* timer);`
* ##ASM
* **In :**
* PUSHW = Dst PTR To S.TIME * PUSHW = Dst PTR To S.TIME
* PUSHW = Src PTR to ProDOS DATE/TIME (DWORD) * PUSHW = Src PTR to ProDOS DATE/TIME (DWORD)
* **Out:**
*\-------------------------------------- *\--------------------------------------
K.PTime2Time jsr MEM.PullP1P2 K.PTime2Time jsr MEM.PullP1P2
TIME.PTime2TimeP1P2 TIME.PTime2TimeP1P2
@ -153,7 +160,7 @@ K.ComputeWDAY lda #3 Thursday : 4 (-1 for mod 7)
*/-------------------------------------- */--------------------------------------
* # CTime2Time * # CTime2Time
* Convert CTIME to S.TIME * Convert CTIME to S.TIME
* ## In : * **In:**
* PUSHW = Dst PTR To S.TIME * PUSHW = Dst PTR To S.TIME
* PUSHW = Src CTIME DWORD * PUSHW = Src CTIME DWORD
*\-------------------------------------- *\--------------------------------------
@ -381,23 +388,23 @@ K.CTime.Year .BS 1
* `size_t strftime (char* ptr, size_t maxsize, const char* format, const struct tm* timeptr );` * `size_t strftime (char* ptr, size_t maxsize, const char* format, const struct tm* timeptr );`
* ## ASM * ## ASM
* **In:** * **In:**
* PUSHW = Dst PTR To CSTR Buf * PUSHW = Dst PTR To CSTR Buf
* PUSHW = Src PTR To Format String * PUSHW = Src PTR To Format String
* %a : Abbreviated weekday name : Thu * + %a : Abbreviated weekday name : Thu
* %A : Full weekday name : Thursday * + %A : Full weekday name : Thursday
* %b : Abbreviated month name : Aug * + %b : Abbreviated month name : Aug
* %B : Full month name : August * + %B : Full month name : August
* %d : Day of the month, zero-padded (01-31) * + %d : Day of the month, zero-padded (01-31)
* %H : Hour in 24h format (00-23) 14 * + %H : Hour in 24h format (00-23) 14
* %I : Hour in 12h format (01-12) 02 * + %I : Hour in 12h format (01-12) 02
* %m : Month as a decimal number (01-12) 08 * + %m : Month as a decimal number (01-12) 08
* %M : Minute (00-59) 55 * + %M : Minute (00-59) 55
* %p : AM or PM designation PM * + %p : AM or PM designation PM
* %S : Second (00-61) 02 * + %S : Second (00-61) 02
* %w : Weekday as a decimal number with Sunday as 0 (0-6) * + %w : Weekday as a decimal number with Sunday as 0 (0-6)
* %y : Year, last two digits (00-99) * + %y : Year, last two digits (00-99)
* %Y : Year four digits 2001 * + %Y : Year four digits 2001
* PUSHW = Src PTR To S.Time * PUSHW = Src PTR To S.Time
* **Out:** * **Out:**
* none. always succeed. * none. always succeed.
*\-------------------------------------- *\--------------------------------------