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

File diff suppressed because it is too large Load Diff

View File

@@ -1,52 +1,49 @@
*** Auto generated by docgen.cmd *** *** Auto generated by docgen.cmd ***
# GetProDOSCatSize
Compute space needed for ProDOS Catalog # GetProDOSCatSize
## In : Compute space needed for ProDOS Catalog
**In:**
PUSHW = DevSize (in 512b blocks)
PUSHB = Catalog Size (in blocks)
PUSHB = Options
**Out:**
X=BlockCount (max 22)
Y,A=BufSize (max $4400)
PUSHW = DevSize (in 512b blocks) # BuildProDOSCat
PUSHB = Catalog Size (in blocks) **In:**
PUSHB = Options PUSHW = DevSize (in 512b blocks)
## Out : 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...
X=BlockCount (max 22) # TrkW16s
Y,A=BufSize (max $4400) Write a track (16 sectors)
# BuildProDOSCat **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...
## In : # TrkWNIB
Write a track (NIBBLE)
PUSHW = DevSize (in 512b blocks) **In:**
PUSHB = Catalog Size (in blocks) PUSHW = Ptr to NIBBLE buffer (0 ended)
PUSHB = Options PUSHB = TrackNum * 4 : 0->140+
PUSHW = VolName (PSTR) PUSHB = DSSS0000
PUSHW = DstBuf (Zero filled) **Out:**
Blk0 : ProDOS.BootBlk CC : success
Blk1 : SOS.BootBlk CS : A = Error
Blk2...n : Volume Directory A=0, currently starting/seeking...
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
**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...

View File

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

View File

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

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
bcc .2
.1 lda (ZPPtr1)
beq .2
K.StrCpy.I ldy #0 inc ZPPtr1
bne .1
inc ZPPtr1+1
bra .1
.1 lda (ZPPtr2),y .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.
*\-------------------------------------- *\--------------------------------------