mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-29 01:33:40 +00:00
Kernel 0.9.2
This commit is contained in:
parent
6990622f84
commit
f4a5532052
357
.Docs/KERNEL.md
357
.Docs/KERNEL.md
@ -1,23 +1,23 @@
|
||||
*** Auto generated by docgen.cmd ***
|
||||
|
||||
# GetArg
|
||||
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
A = argument index.
|
||||
**Out:**
|
||||
CC : success
|
||||
Y,A = PTR To Arg[A]
|
||||
CS : Out Of Bound
|
||||
# FileSearch
|
||||
|
||||
# FileSearch
|
||||
Search a file in the provided PATH list
|
||||
And return, if found, the full path to it.
|
||||
|
||||
## C
|
||||
|
||||
`int filesearch ( char * filename, char * searchpath, char * fullpath, stat * filestat);`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`>PUSHWI filestat`
|
||||
`>PUSHWI fullpath`
|
||||
@ -28,35 +28,35 @@ CC : success
|
||||
DstBuf = FilePath
|
||||
DstStat = S.STAT
|
||||
CS : not found
|
||||
# GetDevByID.A
|
||||
|
||||
# GetDevByID.A
|
||||
**In:**
|
||||
A = DevID
|
||||
**Out:**
|
||||
CC = OK, CS = ERROR
|
||||
Y,A = DEVSLOT
|
||||
note: X Unmodified
|
||||
# GetDevByName.YA
|
||||
|
||||
# GetDevByName.YA
|
||||
**In:**
|
||||
Y,A = Ptr to device name (C-String)
|
||||
**Out:**
|
||||
CC = OK, CS = ERROR
|
||||
X = DEVID
|
||||
Y,A = DEVSLOT
|
||||
# GetDevStatus.A
|
||||
|
||||
# GetDevStatus.A
|
||||
**In:**
|
||||
A = DevID
|
||||
**Out:**
|
||||
Y,A = S.DSTAT
|
||||
|
||||
# IOCTL
|
||||
|
||||
## C
|
||||
|
||||
`int ioctl ( short int id, short int op, void *param);`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`PUSHWI param`
|
||||
`lda #op`
|
||||
@ -64,8 +64,8 @@ note: X Unmodified
|
||||
`>SYSCALL IOCTL`
|
||||
**Out:**
|
||||
Y,A = ...
|
||||
# OpenDir.YA
|
||||
|
||||
# OpenDir.YA
|
||||
**In:**
|
||||
Y,A = PATH (C-String)
|
||||
**Out:**
|
||||
@ -73,8 +73,8 @@ note: X Unmodified
|
||||
A = hDIR
|
||||
CS : error
|
||||
A = EC
|
||||
# ReadDir.A
|
||||
|
||||
# ReadDir.A
|
||||
**In:**
|
||||
A = hDIR
|
||||
**Out:**
|
||||
@ -84,52 +84,52 @@ note: X Unmodified
|
||||
CS : error
|
||||
A = EC
|
||||
note : A = 0 means no more entry
|
||||
# CloseDir.A
|
||||
|
||||
# CloseDir.A
|
||||
**In:**
|
||||
A = hDIR
|
||||
**Out:**
|
||||
none, always succeed.
|
||||
# ExpandStr
|
||||
|
||||
# ExpandStr
|
||||
**In:**
|
||||
Y,A = PTR to String to Expand (C-String)
|
||||
**Out:**
|
||||
X = hMem to Expanded String (C-String)
|
||||
Y,A = PTR to Expanded String
|
||||
# PutEnv.YA
|
||||
|
||||
# PutEnv.YA
|
||||
**In:**
|
||||
Y,A = PTR to String NAME=VALUE (C-String)
|
||||
**Out:**
|
||||
# SetEnv
|
||||
|
||||
# SetEnv
|
||||
**In:**
|
||||
PUSHW = PTR To Value (PSTR)
|
||||
PUSHW = PTR To Name (PSTR)
|
||||
**Out:**
|
||||
# GetEnv.YA
|
||||
|
||||
# GetEnv.YA
|
||||
**In:**
|
||||
Y,A = PTR to NAME (PSTR)
|
||||
**Out:**
|
||||
CC : Y,A = PTR to VALUE (PSTR)
|
||||
CS : not found
|
||||
# UnsetEnv.YA
|
||||
|
||||
# UnsetEnv.YA
|
||||
**In:**
|
||||
Y,A = PTR To Name (PSTR)
|
||||
**Out:**
|
||||
# LoadTxtFile.YA
|
||||
|
||||
# LoadTxtFile.YA
|
||||
Load TXT a file in memory (with ending 0)
|
||||
**In:**
|
||||
Y,A = File Path
|
||||
**Out:**
|
||||
Y,A = File Length (without ending 0)
|
||||
X = hMem of Loaded File
|
||||
# LoadFile
|
||||
|
||||
# LoadFile
|
||||
Load a file in memory
|
||||
**In:**
|
||||
PUSHW = AUXTYPE (Handled by....
|
||||
@ -139,57 +139,57 @@ Load a file in memory
|
||||
**Out:**
|
||||
Y,A = File Length
|
||||
X = hMem of Loaded File
|
||||
# ChTyp
|
||||
|
||||
# ChTyp
|
||||
**In:**
|
||||
PUSHB = TYPE
|
||||
PUSHW = PATH
|
||||
|
||||
# ChMod
|
||||
|
||||
**In:**
|
||||
PUSHW = UID
|
||||
PUSHW = PATH
|
||||
|
||||
# ChOwn
|
||||
|
||||
**In:**
|
||||
PUSHW = UID
|
||||
PUSHW = PATH
|
||||
# ChGrp
|
||||
|
||||
# ChGrp
|
||||
**In:**
|
||||
PUSHW = GID
|
||||
PUSHW = PATH
|
||||
# FAdd,FSub,FMult,FDiv,FPwr
|
||||
|
||||
# FAdd,FSub,FMult,FDiv,FPwr
|
||||
Return X+Y, X-Y, X*Y, X/Y, X^Y
|
||||
**In:**
|
||||
PUSHF = X (Float)
|
||||
PUSHF = Y (Float)
|
||||
**Out:**
|
||||
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)
|
||||
**In:**
|
||||
PUSHF = X (Float)
|
||||
**Out:**
|
||||
On stack (Float)
|
||||
# Float
|
||||
|
||||
# Float
|
||||
Return 'floated' long
|
||||
**In:**
|
||||
PUSHL = X (long)
|
||||
**Out:**
|
||||
On stack (Float)
|
||||
# LRIntF
|
||||
|
||||
# LRIntF
|
||||
Return Float rounded into a long
|
||||
**In:**
|
||||
PUSHF = X (Float)
|
||||
**Out:**
|
||||
On stack (long)
|
||||
# GetMem0
|
||||
|
||||
# GetMem0
|
||||
**In:**
|
||||
Y,A = Size Requested
|
||||
**Out:**
|
||||
@ -198,8 +198,8 @@ Return Float rounded into a long
|
||||
* X = hMem
|
||||
CS :
|
||||
A = EC
|
||||
# GetMem
|
||||
|
||||
# GetMem
|
||||
**In:**
|
||||
Y,A = Size Requested
|
||||
**Out:**
|
||||
@ -208,29 +208,29 @@ Return Float rounded into a long
|
||||
* X = hMem
|
||||
CS :
|
||||
A = EC
|
||||
# FreeMem
|
||||
|
||||
# FreeMem
|
||||
**In:**
|
||||
A = hMem To Free
|
||||
**Out:**
|
||||
none.
|
||||
(X,Y unmodified)
|
||||
# GetMemPtr
|
||||
|
||||
# GetMemPtr
|
||||
**In:**
|
||||
A = hMem
|
||||
**Out:**
|
||||
Y,A = PTR to MemBlock
|
||||
(X unmodified)
|
||||
# GetMemByID
|
||||
|
||||
# GetMemByID
|
||||
**In:**
|
||||
A = hMem
|
||||
**Out:**
|
||||
Y,A = ZPMemMgrSPtr = PTR to S.MEM
|
||||
X unmodified
|
||||
# NewStr
|
||||
|
||||
# NewStr
|
||||
Create a new copy of this C-String
|
||||
**In:**
|
||||
Y,A = Ptr to source C-String
|
||||
@ -240,8 +240,8 @@ Create a new copy of this C-String
|
||||
X = hMem (PSTR)
|
||||
CS : error
|
||||
A = SYS error code
|
||||
# SListGetByID
|
||||
|
||||
# SListGetByID
|
||||
**In:**
|
||||
PUSHB = hSList
|
||||
PUSHW = KeyID
|
||||
@ -249,8 +249,8 @@ Create a new copy of this C-String
|
||||
PUSHW = Key Ptr
|
||||
**Out:**
|
||||
X,Y = Next KeyID
|
||||
# SListUpdateByID
|
||||
|
||||
# SListUpdateByID
|
||||
**In:**
|
||||
PUSHB = hSList
|
||||
PUSHW = KeyID
|
||||
@ -258,8 +258,8 @@ Create a new copy of this C-String
|
||||
**Out:**
|
||||
A = Key Length
|
||||
X,Y = KeyID
|
||||
|
||||
# SListAdd
|
||||
|
||||
**In:**
|
||||
PUSHB = hSList
|
||||
PUSHW = Key Ptr
|
||||
@ -267,8 +267,8 @@ Create a new copy of this C-String
|
||||
**Out:**
|
||||
A = Key Length
|
||||
X,Y = KeyID
|
||||
|
||||
# SListLookup
|
||||
|
||||
**In:**
|
||||
PUSHB = hSList
|
||||
PUSHW = Key Ptr
|
||||
@ -276,25 +276,25 @@ Create a new copy of this C-String
|
||||
**Out:**
|
||||
A = Key Length
|
||||
X,Y = KeyID
|
||||
|
||||
# SListNew
|
||||
|
||||
**In:**
|
||||
**Out:**
|
||||
A=hSList
|
||||
|
||||
# SListFree
|
||||
|
||||
**In:**
|
||||
A=hSList
|
||||
**Out:**
|
||||
# GetStkObjProp
|
||||
|
||||
# GetStkObjProp
|
||||
**In:**
|
||||
A = hObject (AUX Memory)
|
||||
Y = Property Index
|
||||
**Out:**
|
||||
Y,A = Property Value
|
||||
# NewStkObj
|
||||
|
||||
# NewStkObj
|
||||
**In:**
|
||||
Y,A = Size Requested
|
||||
**Out:**
|
||||
@ -303,15 +303,15 @@ Create a new copy of this C-String
|
||||
* X = hMem
|
||||
CS :
|
||||
A = EC
|
||||
# FreeStkObj
|
||||
|
||||
# FreeStkObj
|
||||
**In:**
|
||||
A = hMem To Free (AUX Memory)
|
||||
**Out:**
|
||||
none.
|
||||
(X,Y unmodified)
|
||||
# LoadStkObj
|
||||
|
||||
# LoadStkObj
|
||||
Load a file in AUX memory (Stock Objects)
|
||||
**In:**
|
||||
PUSHW = AUXTYPE (Handled by....
|
||||
@ -321,6 +321,7 @@ Load a file in AUX memory (Stock Objects)
|
||||
**Out:**
|
||||
Y,A = File Length
|
||||
X = hMem of Loaded Object in AUX mem
|
||||
|
||||
# ExecPSNewEnv.YA
|
||||
|
||||
# ExecPS.YA (Blocking Parent PID)
|
||||
@ -328,132 +329,135 @@ Load a file in AUX memory (Stock Objects)
|
||||
# CreatePSNewEnv.YA
|
||||
|
||||
# CreatePS.YA (Non Blocking)
|
||||
|
||||
**In:**
|
||||
Y,A = PTR To Cmd Line
|
||||
**Out:**
|
||||
A = Child PSID
|
||||
# GetMemStat.YA
|
||||
|
||||
# GetMemStat.YA
|
||||
**In:**
|
||||
Y,A = Ptr to 24 bytes buffer
|
||||
**Out:**
|
||||
Buffer filled with memory stats
|
||||
# GetPSStatus.A
|
||||
|
||||
# GetPSStatus.A
|
||||
**In:**
|
||||
A = PID
|
||||
**Out:**
|
||||
A = Status Byte
|
||||
# GetPSStat.YA
|
||||
|
||||
# GetPSStat.YA
|
||||
**In:**
|
||||
Y,A = Ptr to 24 bytes buffer
|
||||
**Out:**
|
||||
Buffer filled with PS stats
|
||||
|
||||
# Stat
|
||||
|
||||
Return information about a file
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHW = PTR to S.STAT buffer
|
||||
PUSHW = PTR to Filename (C-String)
|
||||
## Out :
|
||||
**Out:**
|
||||
|
||||
# MKDir.YA
|
||||
|
||||
**In:**
|
||||
Y,A = DIR name
|
||||
**Out:**
|
||||
CC : success
|
||||
CS : error
|
||||
A = EC
|
||||
# MkNod.YA
|
||||
|
||||
# MkNod.YA
|
||||
return a hFile for a given Device Name
|
||||
**In:**
|
||||
Y,A=DevName
|
||||
**Out:**
|
||||
CC = OK, CS = ERROR
|
||||
A = hFILE
|
||||
# MKFIFO
|
||||
|
||||
# MKFIFO
|
||||
return a hFILE to a new FIFO
|
||||
**In:**
|
||||
**Out:**
|
||||
CC = OK, CS = ERROR
|
||||
A = hFILE
|
||||
|
||||
# FPutC
|
||||
|
||||
Print A (char) to hFILE
|
||||
|
||||
## C
|
||||
|
||||
`int fputc ( int character, hFILE stream );`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
Y : character
|
||||
A : stream
|
||||
**Out:**
|
||||
CC = success
|
||||
|
||||
# PutChar
|
||||
|
||||
## C
|
||||
|
||||
`int putchar ( int character );`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
Print A (char) to StdOut
|
||||
**In:**
|
||||
A : char to print
|
||||
**Out:**
|
||||
CC = success
|
||||
|
||||
# PutS
|
||||
|
||||
Write Str to StdOut, appends '\r\n'
|
||||
## C
|
||||
|
||||
## C
|
||||
`int puts ( const char * str );`
|
||||
**In:**
|
||||
Y,A : CPtr
|
||||
**Out:**
|
||||
CC = success
|
||||
|
||||
# FPutS
|
||||
|
||||
Write Str to FILE
|
||||
## C
|
||||
|
||||
## C
|
||||
`int fputs ( const char * str, hFILE stream );`
|
||||
**In:**
|
||||
PUSHB : hFILE
|
||||
Y,A: str
|
||||
**Out:**
|
||||
CC = success
|
||||
|
||||
# PrintF/SPrintF/FPrintF
|
||||
|
||||
Prints C-Style String
|
||||
## C
|
||||
|
||||
## C
|
||||
`int printf ( const char * format, ... );`
|
||||
`int sprintf ( char * str, const char * format, ... );`
|
||||
`int fprintf ( FILE * stream, const char * format, ... );`
|
||||
## ASM
|
||||
`int fprintf ( hFILE stream, const char * format, ... );`
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
PrintF :
|
||||
PUSH ...
|
||||
Y,A = PTR to CStr
|
||||
PrintF : (example is for printing Y,A as integer : format="Y,A= %I", 2 bytes)
|
||||
`>PUSHYA`
|
||||
`>PUSHBI 2`
|
||||
`>LDYAI format`
|
||||
`>SYSCALL printf`
|
||||
SPrintF :
|
||||
PUSH ...
|
||||
PUSHW = PTR to CStr
|
||||
Y,A = Ptr to Dst Buffer
|
||||
`>PUSHYA`
|
||||
`>PUSHBI 2`
|
||||
`>PUSHWI format`
|
||||
`>LDYAI str`
|
||||
`>SYSCALL sprintf`
|
||||
FPrintF :
|
||||
PUSH ...
|
||||
PUSHW = PTR to CStr
|
||||
A = hFILE
|
||||
`>PUSHYA`
|
||||
`>PUSHBI 2`
|
||||
`>PUSHWI format`
|
||||
`lda hFILE`
|
||||
`>SYSCALL fprintf`
|
||||
**Out:**
|
||||
CC : success
|
||||
CS : error code from Output
|
||||
CC : success, Y,A = bytes sent
|
||||
CS : error, A = code from Output
|
||||
Specifiers :
|
||||
+ %b : pull 1 byte to Print BIN
|
||||
+ %B : pull 2 bytes to Print BIN
|
||||
@ -487,35 +491,35 @@ Modifiers for len and padding :
|
||||
+ %011s : 'ABCDEFGH000'
|
||||
+ %2f : '3.14'
|
||||
|
||||
# GetChar
|
||||
|
||||
# GetChar
|
||||
Get char from StdIn
|
||||
**In:**
|
||||
none.
|
||||
**Out:**
|
||||
CC = success
|
||||
A = char
|
||||
|
||||
# GetC
|
||||
|
||||
Get char from Node
|
||||
|
||||
## C
|
||||
|
||||
`int getc ( FILE * stream );`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
A = hNODE
|
||||
**Out:**
|
||||
CC = success
|
||||
A = char
|
||||
|
||||
# SScanF
|
||||
|
||||
Read formatted data from string
|
||||
|
||||
## C
|
||||
|
||||
`int sscanf ( const char * s, const char * format, ...);`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`>PUSHBI Argument Byte count`
|
||||
`>PUSHWI format`
|
||||
@ -531,11 +535,10 @@ Read formatted data from string
|
||||
`>LDYA s`
|
||||
**Out:**
|
||||
Y,A = Number of arguments filled.
|
||||
|
||||
# FOpen
|
||||
|
||||
Open a file
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHW = AUXTYPE
|
||||
PUSHB = TYPE
|
||||
PUSHB = MODE
|
||||
@ -545,54 +548,49 @@ Open a file
|
||||
SYS.FOpen.T : Open/Append in Text mode
|
||||
SYS.FOpen.X : Create if not exists
|
||||
PUSHW = PATH (PSTR)
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
CC : A = hFILE
|
||||
CS : A = EC
|
||||
|
||||
# FClose.A
|
||||
|
||||
Close a file
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
A = hFILE
|
||||
## Out :
|
||||
**Out:**
|
||||
|
||||
# FRead
|
||||
|
||||
int fread ( void * ptr, int count, FILE * stream );
|
||||
Read bytes from file
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHW = Dest Ptr
|
||||
PUSHW = Bytes To Read
|
||||
PUSHB = hFILE
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
Y,A = Bytes Read
|
||||
# FWrite
|
||||
|
||||
# FWrite
|
||||
int fwrite ( const void * ptr, int count, FILE * stream );
|
||||
Write bytes to file
|
||||
**In:**
|
||||
PUSHW = Src Ptr
|
||||
PUSHW = Bytes To Write
|
||||
PUSHB = hFILE
|
||||
|
||||
# Out:
|
||||
|
||||
Y,A = Bytes Written
|
||||
# FFlush.A
|
||||
|
||||
# FFlush.A
|
||||
**In:**
|
||||
A = hFILE
|
||||
# FSeek
|
||||
|
||||
# FSeek
|
||||
Set the file-position indicator for hFILE
|
||||
**In:**
|
||||
PUSHW = Ptr to Offset (DWORD)
|
||||
PUSHB = From
|
||||
PUSHB = hFILE
|
||||
# FEOF.A
|
||||
|
||||
# FEOF.A
|
||||
Test the end-of-file indicator for hFILE
|
||||
**In:**
|
||||
A = hFILE
|
||||
@ -601,135 +599,138 @@ Test the end-of-file indicator for hFILE
|
||||
A=0 EOF
|
||||
A =0 NOT EOF
|
||||
CS :
|
||||
# FTell
|
||||
|
||||
# FTell
|
||||
Return the current value of the file-position indicator
|
||||
**In:**
|
||||
PUSHW = Ptr to Offset (DWORD)
|
||||
PUSHB = hFILE
|
||||
**Out:**
|
||||
Offset = Offset
|
||||
|
||||
# Remove.YA
|
||||
|
||||
# Rename
|
||||
|
||||
Rename a file
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHW = New Name
|
||||
PUSHW = Old Name
|
||||
## Out :
|
||||
**Out:**
|
||||
|
||||
# StrToF
|
||||
|
||||
Convert String to 40 bits Float
|
||||
|
||||
## C
|
||||
|
||||
`float strtof (const char* str, char** endptr);`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`>PUSHWI EndPtr`
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
On stack (float)
|
||||
|
||||
# AToF
|
||||
|
||||
Convert String to 40 bits Float
|
||||
|
||||
## C
|
||||
|
||||
`float atof (const char* str);`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
On stack (float)
|
||||
|
||||
# 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`
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
On stack (long)
|
||||
|
||||
# AToL
|
||||
|
||||
Convert String to 32 bits int
|
||||
|
||||
## C
|
||||
|
||||
`long atol ( const char * str );`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
On stack (long)
|
||||
|
||||
# AToI.YA
|
||||
|
||||
## C
|
||||
|
||||
`int atoi ( const char * str );`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
Y,A = Int
|
||||
|
||||
# RealPath.YA
|
||||
|
||||
Return the canonicalized absolute pathname
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
Y,A = Ptr to Relative Filename (C-String)
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
CC : success
|
||||
Y,A = Ptr to Full Path (C-String)
|
||||
X = hMem of Full Path
|
||||
CS : A = Error Code
|
||||
|
||||
# StrLen
|
||||
|
||||
Returns Length of C-String
|
||||
|
||||
## C
|
||||
|
||||
`char * strcat ( char * destination, const char * source );`
|
||||
## ASM
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
Y,A = Ptr to CSTR
|
||||
**Out:**
|
||||
Y,A = String length
|
||||
|
||||
# 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
|
||||
`char * strcat ( char * destination, const char * source );`
|
||||
|
||||
`char * strcpy ( char * destination, const char * source );`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
PUSHW = Ptr to SRC (CSTR)
|
||||
PUSHW = Ptr to DST (CSTR)
|
||||
`>PUSHWI source`
|
||||
`>LDYAI destination`
|
||||
`>SYSCALL strcat`
|
||||
**Out:**
|
||||
DST = SRC
|
||||
# StrMatch
|
||||
Y,A = destination
|
||||
|
||||
# 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
|
||||
**In:**
|
||||
PUSHW = PTR to Pattern (e.g. '*test?.txt')
|
||||
@ -737,23 +738,23 @@ Compare a String against pattern
|
||||
**Out:**
|
||||
CC : match
|
||||
CS : no match
|
||||
# StrUpr/StrLwr
|
||||
|
||||
# StrUpr/StrLwr
|
||||
Convert string to UPPERCASE/lowercase
|
||||
**In:**
|
||||
Y,A = PTR to String (CSTR)
|
||||
**Out:**
|
||||
Uppercased/lowercased String in Buffer
|
||||
# StrCmp
|
||||
|
||||
# StrCmp
|
||||
Compare 2 strings
|
||||
**In:**
|
||||
PUSHW = Ptr to String1 (CSTR)
|
||||
PUSHW = Ptr to String2 (CSTR)
|
||||
**Out:**
|
||||
DST = SRC
|
||||
# StrICmp
|
||||
|
||||
# StrICmp
|
||||
Compare 2 strings
|
||||
**In:**
|
||||
PUSHW = Ptr to String1 (CSTR)
|
||||
@ -761,54 +762,62 @@ Compare 2 strings
|
||||
**Out:**
|
||||
CC, Y,A=0
|
||||
CS, Y,A > 0 or < 0
|
||||
|
||||
# Time
|
||||
|
||||
Get System Time in Buffer
|
||||
## In :
|
||||
|
||||
## C
|
||||
`time_t time (time_t* timer);`
|
||||
|
||||
##ASM
|
||||
**In:**
|
||||
Y,A = PTR to S.TIME
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
S.TIME filled with System date/time
|
||||
|
||||
# PTime2Time
|
||||
|
||||
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 = Src PTR to ProDOS DATE/TIME (DWORD)
|
||||
**Out:**
|
||||
|
||||
# CTime2Time
|
||||
|
||||
Convert CTIME to S.TIME
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHW = Dst PTR To S.TIME
|
||||
PUSHW = Src CTIME DWORD
|
||||
|
||||
# StrFTime
|
||||
|
||||
## C
|
||||
|
||||
Convert S.TIME struct to CSTR
|
||||
`size_t strftime (char* ptr, size_t maxsize, const char* format, const struct tm* timeptr );`
|
||||
## ASM
|
||||
|
||||
## 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
|
||||
+ %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.
|
||||
|
@ -1,20 +1,17 @@
|
||||
*** Auto generated by docgen.cmd ***
|
||||
|
||||
# GetProDOSCatSize
|
||||
|
||||
Compute space needed for ProDOS Catalog
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHW = DevSize (in 512b blocks)
|
||||
PUSHB = Catalog Size (in blocks)
|
||||
PUSHB = Options
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
X=BlockCount (max 22)
|
||||
Y,A=BufSize (max $4400)
|
||||
|
||||
# BuildProDOSCat
|
||||
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHW = DevSize (in 512b blocks)
|
||||
PUSHB = Catalog Size (in blocks)
|
||||
PUSHB = Options
|
||||
@ -28,8 +25,8 @@
|
||||
absolute MAX DstBuf size=
|
||||
7 for Disk II(280blk),3.5(1600),3.5HD(2880)
|
||||
22 for 32mb Hardisk...
|
||||
# TrkW16s
|
||||
|
||||
# TrkW16s
|
||||
Write a track (16 sectors)
|
||||
**In:**
|
||||
PUSHW = Ptr to 16*256 buffer
|
||||
@ -39,8 +36,8 @@ Write a track (16 sectors)
|
||||
CC : success
|
||||
CS : A = Error
|
||||
A=0, currently starting/seeking...
|
||||
# TrkWNIB
|
||||
|
||||
# TrkWNIB
|
||||
Write a track (NIBBLE)
|
||||
**In:**
|
||||
PUSHW = Ptr to NIBBLE buffer (0 ended)
|
||||
|
@ -1,48 +1,48 @@
|
||||
*** Auto generated by docgen.cmd ***
|
||||
|
||||
## MD5
|
||||
|
||||
Return MD5 Hash for input String
|
||||
|
||||
# C
|
||||
|
||||
`void md5 (const char* str, char* digest);`
|
||||
# ASM
|
||||
|
||||
# ASM
|
||||
**In:**
|
||||
`>PUSHW digest`
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
CC
|
||||
|
||||
## MD5Init
|
||||
|
||||
Initialize a MD5 computation
|
||||
|
||||
# C
|
||||
|
||||
`HANDLE md5init ();`
|
||||
# ASM
|
||||
|
||||
# ASM
|
||||
**In:**
|
||||
**Out:**
|
||||
A = hMem To S.MD5
|
||||
|
||||
## MD5Update
|
||||
|
||||
Add Data to MD5 computation
|
||||
|
||||
# C
|
||||
|
||||
`int md5update (HANDLE md5, char* data, int len);`
|
||||
# ASM
|
||||
|
||||
# ASM
|
||||
**In:**
|
||||
`>PUSHW len`
|
||||
`>PUSHW data`
|
||||
`>LDA.G md5`
|
||||
**Out:**
|
||||
|
||||
## MD5Finalize
|
||||
|
||||
# C
|
||||
|
||||
`int md5finalize (HANDLE md5, char* digest);`
|
||||
# ASM
|
||||
|
||||
# ASM
|
||||
**In:**
|
||||
`>PUSHW digest`
|
||||
`>LDA.G md5`
|
||||
|
@ -1,13 +1,11 @@
|
||||
*** Auto generated by docgen.cmd ***
|
||||
|
||||
# ARP.Clear
|
||||
|
||||
Clear ARP Cache
|
||||
## In :
|
||||
|
||||
## Out :
|
||||
**In:**
|
||||
**Out:**
|
||||
|
||||
# ARP.Query
|
||||
|
||||
Query ARP Cache and returns HW address
|
||||
**In:**
|
||||
PUSHW PTR to MAC (to fill)
|
||||
@ -15,27 +13,25 @@
|
||||
**Out:**
|
||||
CC: hit: MAC filled
|
||||
CS: missed
|
||||
# ARP.Add
|
||||
|
||||
# ARP.Add
|
||||
Add a static ARP cache record
|
||||
**In:**
|
||||
PUSHW PTR to MAC
|
||||
PUSHW PTR to IP
|
||||
# ARP.GetCAche
|
||||
|
||||
# ARP.GetCAche
|
||||
Return a Ptr to ARP Cache Table
|
||||
**In:**
|
||||
**Out:**
|
||||
Y,A = PTR to ARP.CACHE
|
||||
|
||||
# DNS.Clear
|
||||
|
||||
Clear DNS Cache
|
||||
## In :
|
||||
|
||||
## Out :
|
||||
**In:**
|
||||
**Out:**
|
||||
|
||||
# DNS.Query
|
||||
|
||||
Query DNS for specified host
|
||||
**In:**
|
||||
PUSHW = PTR to IP to fill with cached data
|
||||
@ -43,135 +39,109 @@
|
||||
**Out:**
|
||||
CC: hit: IP filled with address
|
||||
CS: missed
|
||||
# DNS.Add
|
||||
|
||||
# DNS.Add
|
||||
Add a static DNS record
|
||||
**In:**
|
||||
PUSHW = PTR to IP
|
||||
PUSHW = hostname CSTR to Add
|
||||
# DNS.GetCAche
|
||||
|
||||
# DNS.GetCAche
|
||||
Return a Ptr to DNS Cache Table
|
||||
**In:**
|
||||
**Out:**
|
||||
Y,A = PTR to DNS.CACHE
|
||||
|
||||
# SKT.New
|
||||
|
||||
Create a new socket
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHW = PTR to S.SOCKET template
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
YA = PTR to new S.SOCKET
|
||||
X = hSocket
|
||||
|
||||
# SKT.CloseA
|
||||
|
||||
Close socket
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
A = hSocket
|
||||
## Out :
|
||||
**Out:**
|
||||
|
||||
# SKT.GetA
|
||||
|
||||
Get Ptr to socket
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
A = hSocket
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
Y,A = pS.SOCKET
|
||||
|
||||
# SKT.GetTable
|
||||
|
||||
Get socket table
|
||||
## In :
|
||||
|
||||
## Out :
|
||||
|
||||
**In:**
|
||||
**Out:**
|
||||
Y,A = pS.SOCKET
|
||||
|
||||
# SKT.AcceptA
|
||||
|
||||
Check for an incoming connection
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
A = hListeningSocket
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
A = hSocket
|
||||
|
||||
# SKT.MkNodA
|
||||
|
||||
Create a new file from TCP socket
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
A = hSocket
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
A = hFile
|
||||
|
||||
# SKT.Write (DGRAM,STREAM,RAW)
|
||||
|
||||
Send block of data
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHB = hSocket
|
||||
PUSHW = pBuf
|
||||
PUSHW = len
|
||||
## Out :
|
||||
**Out:**
|
||||
|
||||
# SKT.ReadA (DGRAM,RAW)
|
||||
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
A = hSocket
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
A = hFrame
|
||||
|
||||
# SKT.PutC (STREAM)
|
||||
|
||||
Write a Char To Stream
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHB = hSocket
|
||||
PUSHB = Char
|
||||
## Out :
|
||||
**Out:**
|
||||
|
||||
# SKT.PutS (STREAM)
|
||||
|
||||
Write Line in pBuf
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHB = hSocket
|
||||
PUSHW = PSTR
|
||||
## Out :
|
||||
**Out:**
|
||||
|
||||
# SKT.GetC.A (STREAM)
|
||||
|
||||
Read a Char From Stream in A
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
A = hSocket
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
A = char
|
||||
|
||||
# SKT.GetS (STREAM)
|
||||
|
||||
Read a CR terminated Line in pBuf
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHB = hSocket
|
||||
PUSHW = pBuf
|
||||
PUSHW = len
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
Y,A = bytes read
|
||||
|
||||
# SKT.Read (STREAM)
|
||||
|
||||
Read data in pBuf
|
||||
## In :
|
||||
|
||||
**In:**
|
||||
PUSHB = hSocket
|
||||
PUSHW = pBuf
|
||||
PUSHW = len
|
||||
## Out :
|
||||
|
||||
**Out:**
|
||||
Y,A = bytes transfered
|
||||
|
@ -79,8 +79,8 @@ for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do (
|
||||
set bInList=0
|
||||
)
|
||||
)
|
||||
(echo !LINE!)>>!DOCFILE!
|
||||
if "!line:~0,1!" EQU "#" echo.>>!DOCFILE!
|
||||
(echo !LINE! )>>!DOCFILE!
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -79,11 +79,11 @@ LIB.UNLOAD clc
|
||||
*/--------------------------------------
|
||||
* # GetProDOSCatSize
|
||||
* Compute space needed for ProDOS Catalog
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = DevSize (in 512b blocks)
|
||||
* PUSHB = Catalog Size (in blocks)
|
||||
* PUSHB = Options
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* X=BlockCount (max 22)
|
||||
* Y,A=BufSize (max $4400)
|
||||
*\--------------------------------------
|
||||
@ -119,7 +119,7 @@ GetProDOSCatSize.I
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # BuildProDOSCat
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = DevSize (in 512b blocks)
|
||||
* PUSHB = Catalog Size (in blocks)
|
||||
* PUSHB = Options
|
||||
|
@ -42,7 +42,7 @@ LIB.UNLOAD clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # Pak
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = Src PTR
|
||||
* PUSHW = Src Length
|
||||
* PUSHW = Dst PTR Output Buffer
|
||||
|
@ -5,8 +5,8 @@ AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* # ARP.Clear
|
||||
* Clear ARP Cache
|
||||
* ## In :
|
||||
* ## Out :
|
||||
* **In:**
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
ARP.Clear ldx #K.ARPCACHE.SIZE*S.ARPCACHE
|
||||
.1 stz ARP.CACHE-1,x
|
||||
|
@ -5,8 +5,8 @@ AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* # DNS.Clear
|
||||
* Clear DNS Cache
|
||||
* ## In :
|
||||
* ## Out :
|
||||
* **In:**
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
DNS.Clear ldx #K.DNSCACHE.SIZE*S.DNSCACHE
|
||||
.1 stz DNS.CACHE-1,x
|
||||
|
@ -5,9 +5,9 @@ AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* # SKT.New
|
||||
* Create a new socket
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = PTR to S.SOCKET template
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* YA = PTR to new S.SOCKET
|
||||
* X = hSocket
|
||||
*\--------------------------------------
|
||||
@ -122,9 +122,9 @@ SKT.New.Listen sec
|
||||
*/--------------------------------------
|
||||
* # SKT.CloseA
|
||||
* Close socket
|
||||
* ## In :
|
||||
* **In:**
|
||||
* A = hSocket
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
SKT.CloseA jsr SKT.GetA.I get SKT in ZPPtrSKT, S.SOCKET.SOCK in A
|
||||
bcs .99
|
||||
@ -186,9 +186,9 @@ SKT.CloseA jsr SKT.GetA.I get SKT in ZPPtrSKT, S.SOCKET.SOCK in A
|
||||
*/--------------------------------------
|
||||
* # SKT.GetA
|
||||
* Get Ptr to socket
|
||||
* ## In :
|
||||
* **In:**
|
||||
* A = hSocket
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* Y,A = pS.SOCKET
|
||||
*\--------------------------------------
|
||||
SKT.GetA jsr SKT.GetA.I
|
||||
@ -243,8 +243,8 @@ SKT.GetA.I and #$7f
|
||||
*/--------------------------------------
|
||||
* # SKT.GetTable
|
||||
* Get socket table
|
||||
* ## In :
|
||||
* ## Out :
|
||||
* **In:**
|
||||
* **Out:**
|
||||
* Y,A = pS.SOCKET
|
||||
*\--------------------------------------
|
||||
SKT.GetTable lda hSocketTable
|
||||
@ -254,9 +254,9 @@ SKT.GetTable lda hSocketTable
|
||||
*/--------------------------------------
|
||||
* # SKT.AcceptA
|
||||
* Check for an incoming connection
|
||||
* ## In :
|
||||
* **In:**
|
||||
* A = hListeningSocket
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* A = hSocket
|
||||
*\--------------------------------------
|
||||
SKT.AcceptA jsr SKT.GetA.I
|
||||
@ -295,9 +295,9 @@ SKT.AcceptA jsr SKT.GetA.I
|
||||
*/--------------------------------------
|
||||
* # SKT.MkNodA
|
||||
* Create a new file from TCP socket
|
||||
* ## In :
|
||||
* **In:**
|
||||
* A = hSocket
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* A = hFile
|
||||
*\--------------------------------------
|
||||
SKT.MkNodA sta .1+1
|
||||
@ -338,11 +338,11 @@ SKT.MkNodA sta .1+1
|
||||
*/--------------------------------------
|
||||
* # SKT.Write (DGRAM,STREAM,RAW)
|
||||
* Send block of data
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHB = hSocket
|
||||
* PUSHW = pBuf
|
||||
* PUSHW = len
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
SKT.Write >PULLW ZPDataInLen
|
||||
>PULLW ZPDataInPtr
|
||||
@ -442,9 +442,9 @@ SKT.Write.TCP ldy #S.SOCKET.TCP.STATUS
|
||||
.99 rts
|
||||
*/--------------------------------------
|
||||
* # SKT.ReadA (DGRAM,RAW)
|
||||
* ## In :
|
||||
* **In:**
|
||||
* A = hSocket
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* A = hFrame
|
||||
*\--------------------------------------
|
||||
SKT.ReadA jsr SKT.GetA.I
|
||||
@ -479,10 +479,10 @@ SKT.ReadA jsr SKT.GetA.I
|
||||
*/--------------------------------------
|
||||
* # SKT.PutC (STREAM)
|
||||
* Write a Char To Stream
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHB = hSocket
|
||||
* PUSHB = Char
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
SKT.PutC >PULLB TmpByte
|
||||
|
||||
@ -499,10 +499,10 @@ SKT.PutC >PULLB TmpByte
|
||||
*/--------------------------------------
|
||||
* # SKT.PutS (STREAM)
|
||||
* Write Line in pBuf
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHB = hSocket
|
||||
* PUSHW = PSTR
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
SKT.PutS >PULLW ZPDataOutPtr
|
||||
lda (ZPDataInPtr)
|
||||
@ -529,9 +529,9 @@ SKT.PutS.1 >PULLA
|
||||
*/--------------------------------------
|
||||
* # SKT.GetC.A (STREAM)
|
||||
* Read a Char From Stream in A
|
||||
* ## In :
|
||||
* **In:**
|
||||
* A = hSocket
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* A = char
|
||||
*\--------------------------------------
|
||||
SKT.GetC.A stz bTextMode
|
||||
@ -553,11 +553,11 @@ SKT.GetC.A stz bTextMode
|
||||
*/--------------------------------------
|
||||
* # SKT.GetS (STREAM)
|
||||
* Read a CR terminated Line in pBuf
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHB = hSocket
|
||||
* PUSHW = pBuf
|
||||
* PUSHW = len
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* Y,A = bytes read
|
||||
*\--------------------------------------
|
||||
SKT.GetS sec
|
||||
@ -565,11 +565,11 @@ SKT.GetS sec
|
||||
*/--------------------------------------
|
||||
* # SKT.Read (STREAM)
|
||||
* Read data in pBuf
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHB = hSocket
|
||||
* PUSHW = pBuf
|
||||
* PUSHW = len
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* Y,A = bytes transfered
|
||||
*\--------------------------------------
|
||||
SKT.Read clc
|
||||
|
@ -4,20 +4,20 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
* # FStat
|
||||
* Return information about a hfile
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = PTR to S.STAT buffer
|
||||
* PUSHB = hFile
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
*--------------------------------------
|
||||
*jsr PFT.CheckNodeSTK
|
||||
|
||||
*/--------------------------------------
|
||||
* # Stat
|
||||
* Return information about a file
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = PTR to S.STAT buffer
|
||||
* PUSHW = PTR to Filename (C-String)
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
K.Stat jsr PFT.CheckPathSTK
|
||||
jsr STDIO.PullMLIPath
|
||||
|
@ -108,23 +108,29 @@ K.FPutS.1 jsr K.GetMemPtr.A
|
||||
* ## C
|
||||
* `int printf ( 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
|
||||
* **In:**
|
||||
* PrintF :
|
||||
* PUSH ...
|
||||
* Y,A = PTR to CStr
|
||||
* PrintF : (example is for printing Y,A as integer : format="Y,A= %I", 2 bytes)
|
||||
* `>PUSHYA`
|
||||
* `>PUSHBI 2`
|
||||
* `>LDYAI format`
|
||||
* `>SYSCALL printf`
|
||||
* SPrintF :
|
||||
* PUSH ...
|
||||
* PUSHW = PTR to CStr
|
||||
* Y,A = Ptr to Dst Buffer
|
||||
* `>PUSHYA`
|
||||
* `>PUSHBI 2`
|
||||
* `>PUSHWI format`
|
||||
* `>LDYAI str`
|
||||
* `>SYSCALL sprintf`
|
||||
* FPrintF :
|
||||
* PUSH ...
|
||||
* PUSHW = PTR to CStr
|
||||
* A = hFILE
|
||||
* `>PUSHYA`
|
||||
* `>PUSHBI 2`
|
||||
* `>PUSHWI format`
|
||||
* `lda hFILE`
|
||||
* `>SYSCALL fprintf`
|
||||
* **Out:**
|
||||
* CC : success
|
||||
* CS : error code from Output
|
||||
* CC : success, Y,A = bytes sent
|
||||
* CS : error, A = code from Output
|
||||
* Specifiers :
|
||||
* + %b : pull 1 byte to Print BIN
|
||||
* + %B : pull 2 bytes to Print BIN
|
||||
@ -868,7 +874,7 @@ K.SScanF.GetVAL tya Y=char count parsed
|
||||
*/--------------------------------------
|
||||
* # FOpen
|
||||
* Open a file
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = AUXTYPE
|
||||
* PUSHB = TYPE
|
||||
* PUSHB = MODE
|
||||
@ -878,7 +884,7 @@ K.SScanF.GetVAL tya Y=char count parsed
|
||||
* SYS.FOpen.T : Open/Append in Text mode
|
||||
* SYS.FOpen.X : Create if not exists
|
||||
* PUSHW = PATH (PSTR)
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* CC : A = hFILE
|
||||
* CS : A = EC
|
||||
*\--------------------------------------
|
||||
@ -983,9 +989,9 @@ K.FOpen.AUXTYPE .BS 2
|
||||
*/--------------------------------------
|
||||
* # FClose.A
|
||||
* Close a file
|
||||
* ## In :
|
||||
* **In:**
|
||||
* A = hFILE
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
K.FClose.A jsr PFT.CheckNodeA
|
||||
sta K.FClose.A.8+1
|
||||
@ -1029,11 +1035,11 @@ K.FClose.A.9 rts
|
||||
* # FRead
|
||||
* int fread ( void * ptr, int count, FILE * stream );
|
||||
* Read bytes from file
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = Dest Ptr
|
||||
* PUSHW = Bytes To Read
|
||||
* PUSHB = hFILE
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* Y,A = Bytes Read
|
||||
*\--------------------------------------
|
||||
K.FRead jsr PFT.CheckNodeSTK
|
||||
@ -1218,10 +1224,10 @@ K.Remove.YA jsr PFT.CheckPathYA
|
||||
*/--------------------------------------
|
||||
* # Rename
|
||||
* Rename a file
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = New Name
|
||||
* PUSHW = Old Name
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
K.Rename jsr PFT.CheckPathSTK
|
||||
jsr STDIO.PullMLIPath
|
||||
|
@ -274,9 +274,9 @@ STDLIB.32.Clear ldx #3
|
||||
*/--------------------------------------
|
||||
* # RealPath.YA
|
||||
* Return the canonicalized absolute pathname
|
||||
* ## In :
|
||||
* **In:**
|
||||
* Y,A = Ptr to Relative Filename (C-String)
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* CC : success
|
||||
* Y,A = Ptr to Full Path (C-String)
|
||||
* X = hMem of Full Path
|
||||
|
@ -29,22 +29,19 @@ K.StrLen >STYA ZPPtr1
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # StrCat
|
||||
* Append SRC to DST
|
||||
* Concatenate strings
|
||||
* ## C
|
||||
* `char * strcat ( char * destination, const char * source );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHW = Ptr to SRC (CSTR)
|
||||
* PUSHW = Ptr to DST (CSTR)
|
||||
* `>PUSHWI source`
|
||||
* `>LDYAI destination`
|
||||
* `>SYSCALL strcat`
|
||||
* **Out:**
|
||||
* DST = DST+SRC
|
||||
* Y,A = destination
|
||||
*\--------------------------------------
|
||||
K.StrCat jsr MEM.PullP1P2
|
||||
|
||||
.1 lda (ZPPtr1)
|
||||
beq K.StrCpy.I
|
||||
|
||||
inc ZPPtr1
|
||||
bne .1
|
||||
inc ZPPtr1+1
|
||||
bra .1
|
||||
K.StrCat sec
|
||||
.HS 90 BCC
|
||||
*/--------------------------------------
|
||||
* # StrCpy
|
||||
* Copy string
|
||||
@ -52,23 +49,36 @@ K.StrCat jsr MEM.PullP1P2
|
||||
* `char * strcpy ( char * destination, const char * source );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHW = Ptr to SRC (CSTR)
|
||||
* PUSHW = Ptr to DST (CSTR)
|
||||
* `>PUSHWI source`
|
||||
* `>LDYAI destination`
|
||||
* `>SYSCALL strcpy`
|
||||
* **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
|
||||
beq .8
|
||||
iny
|
||||
bne .1
|
||||
bne .3
|
||||
inc ZPPtr2+1
|
||||
inc ZPPtr1+1
|
||||
bra .1
|
||||
bra .3
|
||||
|
||||
.8 rts
|
||||
*/--------------------------------------
|
||||
|
@ -11,9 +11,12 @@ DAY0 .EQ 4 day 0 was a thursday
|
||||
*/--------------------------------------
|
||||
* # Time
|
||||
* Get System Time in Buffer
|
||||
* ## In :
|
||||
* ## C
|
||||
* `time_t time (time_t* timer);`
|
||||
* ##ASM
|
||||
* **In:**
|
||||
* Y,A = PTR to S.TIME
|
||||
* ## Out :
|
||||
* **Out:**
|
||||
* S.TIME filled with System date/time
|
||||
*\--------------------------------------
|
||||
K.Time >STYA ZPPtr2
|
||||
@ -24,9 +27,13 @@ K.Time >STYA ZPPtr2
|
||||
*/--------------------------------------
|
||||
* # PTime2Time
|
||||
* 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 = Src PTR to ProDOS DATE/TIME (DWORD)
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
K.PTime2Time jsr MEM.PullP1P2
|
||||
TIME.PTime2TimeP1P2
|
||||
@ -153,7 +160,7 @@ K.ComputeWDAY lda #3 Thursday : 4 (-1 for mod 7)
|
||||
*/--------------------------------------
|
||||
* # CTime2Time
|
||||
* Convert CTIME to S.TIME
|
||||
* ## In :
|
||||
* **In:**
|
||||
* PUSHW = Dst PTR To S.TIME
|
||||
* PUSHW = Src CTIME DWORD
|
||||
*\--------------------------------------
|
||||
@ -383,20 +390,20 @@ K.CTime.Year .BS 1
|
||||
* **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
|
||||
* + %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.
|
||||
|
Loading…
Reference in New Issue
Block a user