Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-06-18 08:22:50 +02:00
parent bc9b641ebc
commit bc5af2e958
23 changed files with 664 additions and 610 deletions

View File

@ -1,57 +1,57 @@
*** 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.
**In:** **In:**
PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB
PUSHW = Ptr to File Name (CSTR) PUSHW = Ptr to File Name (CSTR)
PUSHW = Ptr to DstBuf PUSHW = Ptr to DstBuf
PUSHW = Ptr to DstStat PUSHW = Ptr to DstStat
**Out:** **Out:**
CC : success 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`
@ -59,8 +59,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:**
@ -68,8 +68,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:**
@ -79,52 +79,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.YA # ExpandStr.YA
**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....
@ -134,57 +134,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:**
@ -193,8 +193,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:**
@ -203,29 +203,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
@ -235,8 +235,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
@ -244,8 +244,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
@ -253,8 +253,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
@ -262,8 +262,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
@ -271,25 +271,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:**
@ -298,15 +298,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....
@ -316,7 +316,6 @@ 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)
@ -324,188 +323,197 @@ 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:**
Y : character
A : stream
**Out:**
CC = success
**In:**
Y : character
A : stream
**Out:**
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
int puts ( const char * str );
Write Str to StdOut, appends '\r\n' Write Str to StdOut, appends '\r\n'
**In:** ## C
Y,A : CPtr
**Out:**
CC = success
`int puts ( const char * str );`
**In:**
Y,A : CPtr
**Out:**
CC = success
# FPutS # FPutS
int fputs ( const char * str, hFILE stream );
Write Str to FILE Write Str to FILE
## C
`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
int printf ( const char * format, ... );
# SPrintF
int sprintf ( char * str, const char * format, ... );
# FPrintF
int fprintf ( FILE * stream, const char * format, ... );
*
Prints C-Style String Prints C-Style String
## C
`int printf ( const char * format, ... );`
`int sprintf ( char * str, const char * format, ... );`
`int fprintf ( FILE * stream, const char * format, ... );`
## ASM
**In:** **In:**
PrintF : PrintF :
PUSH ... PUSH ...
Y,A = PTR to CStr Y,A = PTR to CStr
SPrintF : SPrintF :
PUSH ... PUSH ...
PUSHW = PTR to CStr PUSHW = PTR to CStr
Y,A = Ptr to Dst Buffer Y,A = Ptr to Dst Buffer
FPrintF : FPrintF :
PUSH ... PUSH ...
PUSHW = PTR to CStr PUSHW = PTR to CStr
A = hFILE A = hFILE
*
**Out:** **Out:**
CC : success CC : success
CS : error code from Output CS : error 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
%d : pull 1 byte unsigned DEC 0..255 + %d : pull 1 byte unsigned DEC 0..255
%D : pull 2 bytes unsigned DEC 0..65535 + %D : pull 2 bytes unsigned DEC 0..65535
%u : pull 4 bytes long unsigned DEC 0..4294967295 + %u : pull 4 bytes long unsigned DEC 0..4294967295
%e : pull 5 Bytes float (-)1.23456789e+12 + %e : pull 5 Bytes float (-)1.23456789e+12
%f : pull 5 Bytes float (-)3.1415 + %f : pull 5 Bytes float (-)3.1415
%h : pull 1 byte to Print HEX + %h : pull 1 byte to Print HEX
%H : pull 2 bytes to Print HEX + %H : pull 2 bytes to Print HEX
%i : pull 1 byte to Print signed DEC -128..127 + %i : pull 1 byte to Print signed DEC -128..127
%I : pull 2 bytes to Print signed DEC -32768..32767 + %I : pull 2 bytes to Print signed DEC -32768..32767
%L : pull 4 bytes signed DEC -2147483648..2147483647 + %L : pull 4 bytes signed DEC -2147483648..2147483647
%n : pull 1 byte to Print low Nibble HEX + %n : pull 1 byte to Print low Nibble HEX
%N : pull 1 byte to Print high Nibble HEX + %N : pull 1 byte to Print high Nibble HEX
%s : pull 2 bytes ptr to C-Style String + %s : pull 2 bytes ptr to C-Style String
%S : pull 2 bytes ptr to P-Style String + %S : pull 2 bytes ptr to P-Style String
\b : Print 'BS' (08) + \b : Print 'BS' (08)
\e : Print 'ESC' ($1B,27) + \e : Print 'ESC' ($1B,27)
\f : Print 'FF' ($0C,12) + \f : Print 'FF' ($0C,12)
\n : Print 'LF' ($0A,10) + \n : Print 'LF' ($0A,10)
\r : Print 'CR' ($0D,13) + \r : Print 'CR' ($0D,13)
\\\\ : Print \ + \\\\ : Print \
\% : Print % + \\% : Print %
Modifiers for len and padding : Modifiers for len and padding :
%d : '9' '12' + %d : '9' '12'
%2d : ' 9' '12' + %2d : ' 9' '12'
%02d : '09' '12' + %02d : '09' '12'
%11s : 'ABCDEFGH ' + %11s : 'ABCDEFGH '
%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.A
Get char from Node Get char from Node
## C
`int getc ( FILE * stream );`
## 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`
ex: "%d.%d.%d.%d"
+ %i : short int + %i : short int
+ %d : byte + %d : byte
+ %I : int + %I : int
@ -514,14 +522,15 @@ Read formatted data from string
+ %U : dword + %U : dword
+ %h : HEX byte + %h : HEX byte
+ %H : HEX word + %H : HEX word
`>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
@ -531,54 +540,54 @@ 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
@ -587,135 +596,135 @@ 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
Append SRC to DST Append SRC to DST
**In:** **In:**
PUSHW = Ptr to SRC (CSTR) PUSHW = Ptr to SRC (CSTR)
PUSHW = Ptr to DST (CSTR) PUSHW = Ptr to DST (CSTR)
**Out:** **Out:**
DST = DST+SRC DST = DST+SRC
# StrCpy # StrCpy
Copy string Copy string
## C ## C
`char * strcpy ( char * destination, const char * source );`
`char * strcpy ( char * destination, const char * source );`
## ASM ## ASM
**In:** **In:**
PUSHW = Ptr to SRC (CSTR) PUSHW = Ptr to SRC (CSTR)
PUSHW = Ptr to DST (CSTR) PUSHW = Ptr to DST (CSTR)
**Out:** **Out:**
DST = SRC DST = SRC
# StrMatch # 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')
@ -723,23 +732,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)
@ -747,37 +756,37 @@ 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 : ## 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 : ## 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)
# 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

View File

@ -1,20 +1,20 @@
*** 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 +28,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 +39,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,13 @@
*** 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 +15,27 @@
**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 +43,135 @@
**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

Binary file not shown.

Binary file not shown.

View File

@ -70,11 +70,17 @@ for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do (
) )
if !bInDoc! EQU 1 ( if !bInDoc! EQU 1 (
if !bOut! EQU 1 ( if !bOut! EQU 1 (
if "!line:~0,4!" EQU "* " set LINE= + !LINE:~4!
if "!line:~0,3!" EQU "* " set LINE=+ !LINE:~3!
if "!line:~0,2!" EQU "* " set LINE=!LINE:~2! if "!line:~0,2!" EQU "* " set LINE=!LINE:~2!
if "!line:~0,1!" EQU "#" echo.>>!DOCFILE! if "!line:~0,1!" EQU "+" (
set bInList=1
) else (
if !bInList! EQU 1 (
echo.>>!DOCFILE!
set bInList=0
)
)
(echo !LINE!)>>!DOCFILE! (echo !LINE!)>>!DOCFILE!
if "!line:~0,1!" EQU "#" echo.>>!DOCFILE!
) )
) )
) )

View File

@ -299,7 +299,7 @@ CS.QUIT ldy #hFrame
.1 ldy #hSocket .1 ldy #hSocket
lda (pData),y lda (pData),y
>DEBUG
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.CLOSEA >LIBCALL hLIBTCPIP,LIBTCPIP.SKT.CLOSEA
lda hLIBTCPIP lda hLIBTCPIP

View File

@ -70,27 +70,27 @@ A2osX.S.DISABLE .EQ $FF
* .EQ $00 * .EQ $00
* .EQ $02 * .EQ $02
SYS.Stat .EQ $04 SYS.Stat .EQ $04
SYS.MKDir.YA .EQ $06 SYS.MKDir .EQ $06
SYS.MKNod.YA .EQ $08 SYS.MKNod .EQ $08
SYS.MKFIFO .EQ $0A SYS.MKFIFO .EQ $0A
* .EQ $0C * .EQ $0C
* .EQ $0E * .EQ $0E
SYS.OpenDir.YA .EQ $10 SYS.OpenDir .EQ $10
SYS.ReadDir.A .EQ $12 SYS.ReadDir .EQ $12
SYS.CloseDir.A .EQ $14 SYS.CloseDir .EQ $14
* .EQ $16 * .EQ $16
* .EQ $18 * .EQ $18
* .EQ $1A * .EQ $1A
* .EQ $1C * .EQ $1C
* .EQ $1E * .EQ $1E
SYS.FPutC.AY .EQ $20 SYS.FPutC .EQ $20
SYS.PutChar.A .EQ $22 SYS.PutChar .EQ $22
SYS.GetC.A .EQ $24 SYS.GetC .EQ $24
SYS.GetChar .EQ $26 SYS.GetChar .EQ $26
SYS.FPutS .EQ $28 SYS.FPutS .EQ $28
SYS.PutS.YA .EQ $2A SYS.PutS .EQ $2A
* .EQ $2C * .EQ $2C
* .EQ $2E * .EQ $2E
@ -100,7 +100,7 @@ SYS.FOpen.W .EQ $02 Open For Write
SYS.FOpen.A .EQ $04 Append SYS.FOpen.A .EQ $04 Append
SYS.FOpen.T .EQ $08 Open/Append in Text mode SYS.FOpen.T .EQ $08 Open/Append in Text mode
SYS.FOpen.X .EQ $80 Create if not exists SYS.FOpen.X .EQ $80 Create if not exists
SYS.FClose.A .EQ $32 SYS.FClose .EQ $32
SYS.FRead .EQ $34 SYS.FRead .EQ $34
SYS.FWrite .EQ $36 SYS.FWrite .EQ $36
SYS.FFlush .EQ $38 SYS.FFlush .EQ $38
@ -111,29 +111,29 @@ SYS.FSeek.END .EQ $02
SYS.FTell .EQ $3C SYS.FTell .EQ $3C
SYS.FEOF .EQ $3E SYS.FEOF .EQ $3E
SYS.Remove.YA .EQ $40 SYS.Remove .EQ $40
SYS.Rename .EQ $42 SYS.Rename .EQ $42
* .EQ $44 * .EQ $44
* .EQ $46 * .EQ $46
SYS.GetDevByID.A .EQ $48 SYS.GetDevByID .EQ $48
SYS.GetDevByName.YA .EQ $4A SYS.GetDevByName .EQ $4A
SYS.GetDevStatus.A .EQ $4C SYS.GetDevStatus .EQ $4C
SYS.IOCTL .EQ $4E SYS.IOCTL .EQ $4E
* .EQ $50 * .EQ $50
SYS.SScanF.YA .EQ $52 SYS.SScanF .EQ $52
* .EQ $54 * .EQ $54
* .EQ $56 * .EQ $56
SYS.PrintF.YA .EQ $58 SYS.PrintF .EQ $58
SYS.SPrintF.YA .EQ $5A SYS.SPrintF .EQ $5A
SYS.FPrintF.A .EQ $5C SYS.FPrintF .EQ $5C
* .EQ $5E * .EQ $5E
* .EQ $60 * .EQ $60
* .EQ $62 * .EQ $62
SYS.LoadFile .EQ $64 SYS.LoadFile .EQ $64
SYS.LoadTxtFile.YA .EQ $66 SYS.LoadTxtFile .EQ $66
SYS.ChTyp .EQ $68 SYS.ChTyp .EQ $68
SYS.ChMod .EQ $6A SYS.ChMod .EQ $6A
@ -141,51 +141,51 @@ SYS.ChOwn .EQ $6C
SYS.ChGrp .EQ $6E SYS.ChGrp .EQ $6E
SYS.AToF .EQ $70 SYS.AToF .EQ $70
SYS.AToI.YA .EQ $72 SYS.AToI .EQ $72
SYS.AToL .EQ $74 SYS.AToL .EQ $74
SYS.StrToF .EQ $76 SYS.StrToF .EQ $76
SYS.StrToL .EQ $78 SYS.StrToL .EQ $78
* .EQ $7A * .EQ $7A
SYS.RealPath.YA .EQ $7C SYS.RealPath .EQ $7C
* .EQ $7E * .EQ $7E
*-------------------------------------- *--------------------------------------
SYS.StrLen.YA .EQ $80 SYS.StrLen .EQ $80
SYS.StrCpy .EQ $82 SYS.StrCpy .EQ $82
SYS.StrCat .EQ $84 SYS.StrCat .EQ $84
SYS.StrMatch .EQ $86 SYS.StrMatch .EQ $86
SYS.StrUpr.YA .EQ $88 SYS.StrUpr .EQ $88
SYS.StrLwr.YA .EQ $8A SYS.StrLwr .EQ $8A
SYS.StrCmp .EQ $8C SYS.StrCmp .EQ $8C
SYS.StrICmp .EQ $8E SYS.StrICmp .EQ $8E
SYS.Time.YA .EQ $90 SYS.Time .EQ $90
SYS.CTime2Time .EQ $92 SYS.CTime2Time .EQ $92
SYS.PTime2Time .EQ $94 SYS.PTime2Time .EQ $94
SYS.StrFTime .EQ $96 SYS.StrFTime .EQ $96
SYS.LoadLib.YA .EQ $98 SYS.LoadLib .EQ $98
SYS.UnloadLib.A .EQ $9A SYS.UnloadLib .EQ $9A
SYS.LoadDrv.YA .EQ $9C SYS.LoadDrv .EQ $9C
SYS.FileSearch .EQ $9E SYS.FileSearch .EQ $9E
*-------------------------------------- *--------------------------------------
SYS.ExecPSNewEnv.YA .EQ $A0 SYS.ExecPSNewEnv .EQ $A0
SYS.ExecPS.YA .EQ $A2 SYS.ExecPS .EQ $A2
SYS.CreatePSNewEnv.YA .EQ $A4 SYS.CreatePSNewEnv .EQ $A4
SYS.CreatePS.YA .EQ $A6 SYS.CreatePS .EQ $A6
* .EQ $A8 * .EQ $A8
SYS.GetMemStat.YA .EQ $AA SYS.GetMemStat .EQ $AA
SYS.GetPSStatus.A .EQ $AC SYS.GetPSStatus .EQ $AC
SYS.GetPSStat.YA .EQ $AE SYS.GetPSStat .EQ $AE
* .EQ $B0 * .EQ $B0
SYS.GetArg.A .EQ $B2 SYS.GetArg .EQ $B2
SYS.ExpandStr.YA .EQ $B4 SYS.ExpandStr .EQ $B4
* .EQ $B6 * .EQ $B6
SYS.PutEnv.YA .EQ $B8 SYS.PutEnv .EQ $B8
SYS.SetEnv .EQ $BA SYS.SetEnv .EQ $BA
SYS.GetEnv.YA .EQ $BC SYS.GetEnv .EQ $BC
SYS.UnsetEnv.YA .EQ $BE SYS.UnsetEnv .EQ $BE
*-------------------------------------- *--------------------------------------
SYS.FAdd .EQ $C0 SYS.FAdd .EQ $C0
SYS.FSub .EQ $C2 SYS.FSub .EQ $C2
@ -207,14 +207,14 @@ SYS.Tan .EQ $DA
SYS.ATan .EQ $DC SYS.ATan .EQ $DC
* .EQ $DF * .EQ $DF
*-------------------------------------- *--------------------------------------
SYS.GetStkObjProperty.AY .EQ $E0 SYS.GetStkObjProp .EQ $E0
SYS.FreeMem.A .EQ $E2 SYS.FreeMem .EQ $E2
SYS.GetMemPtr.A .EQ $E4 SYS.GetMemPtr .EQ $E4
SYS.GetMemByID.A .EQ $E6 SYS.GetMemByID .EQ $E6
SYS.GetMem.YA .EQ $E8 SYS.GetMem .EQ $E8
SYS.GetMem0.YA .EQ $EA SYS.GetMem0 .EQ $EA
SYS.NewStr.YA .EQ $EC SYS.NewStr .EQ $EC
SYS.SListAdd .EQ $EE SYS.SListAdd .EQ $EE
SYS.SListLookup .EQ $F0 SYS.SListLookup .EQ $F0
@ -222,10 +222,10 @@ SYS.SListGetByID .EQ $F2
SYS.SListUpdateByID .EQ $F4 SYS.SListUpdateByID .EQ $F4
SYS.SListNew .EQ $F6 SYS.SListNew .EQ $F6
SYS.SListFree.A .EQ $F8 SYS.SListFree .EQ $F8
SYS.LoadStkObj .EQ $FA SYS.LoadStkObj .EQ $FA
SYS.NewStkObj.YA .EQ $FC SYS.NewStkObj .EQ $FC
SYS.FreeStkObj.A .EQ $FE SYS.FreeStkObj .EQ $FE
*-------------------------------------- *--------------------------------------
SYS.Kernel.JMP .EQ $E000 SYS.Kernel.JMP .EQ $E000
SYS.GuiOSD.JMP .EQ $E200 SYS.GuiOSD.JMP .EQ $E200
@ -346,9 +346,6 @@ S.DEV.S.WENABL .EQ %00000100
S.DEV.S.IRQ .EQ %00000010 S.DEV.S.IRQ .EQ %00000010
S.DEV.S.OPENED .EQ %00000001 S.DEV.S.OPENED .EQ %00000001
S.DEV.F .EQ 5 S.DEV.F .EQ 5
*S.DEV.F.PRT .EQ %10000000
*S.DEV.F.BLK .EQ %01000000
*S.DEV.F.DII .EQ %00100000
S.DEV.BUSID .EQ 6 S.DEV.BUSID .EQ 6
S.DEV.DEVID .EQ 7 S.DEV.DEVID .EQ 7
S.DEV.ROM.JMP .EQ 8 word S.DEV.ROM.JMP .EQ 8 word
@ -356,18 +353,18 @@ S.DEV.ROM.JMP .EQ 8 word
S.DEV.NAME .EQ 11 4+\0 MAX S.DEV.NAME .EQ 11 4+\0 MAX
* *
S.DEV .EQ 16 S.DEV .EQ 16
*----------- Smartport ---------------- *--------------------------------------
DEVMGR.STATUS .EQ 0 IOCTL.STATUS .EQ 0
DEVMGR.READBLOCK .EQ 2 IOCTL.READBLOCK .EQ 2
DEVMGR.WRITEBLOCK .EQ 4 IOCTL.WRITEBLOCK .EQ 4
DEVMGR.FORMAT .EQ 6 IOCTL.FORMAT .EQ 6
DEVMGR.CONTROL .EQ 8 IOCTL.CONTROL .EQ 8
DEVMGR.INIT .EQ 10 IOCTL.INIT .EQ 10
DEVMGR.OPEN .EQ 12 IOCTL.OPEN .EQ 12
DEVMGR.CLOSE .EQ 14 IOCTL.CLOSE .EQ 14
DEVMGR.READ .EQ 16 IOCTL.READ .EQ 16
DEVMGR.WRITE .EQ 18 IOCTL.WRITE .EQ 18
DEVMGR.IRQ .EQ 20 IOCTL.IRQ .EQ 20
*-------------------------------------- *--------------------------------------
S.DSTAT.S .EQ 0 S.DSTAT.S .EQ 0
S.DSTAT.S.BLOCK .EQ %10000000 S.DSTAT.S.BLOCK .EQ %10000000

View File

@ -12,7 +12,7 @@ HST.GetByName >PULLW ZPPtrDNS
tay tay
lda ZPPtrIP+1 lda ZPPtrIP+1
adc #0 adc #0
>PUSHYA >PUSHYA @IP[3]
lda ZPPtrIP lda ZPPtrIP
clc clc
@ -20,20 +20,21 @@ HST.GetByName >PULLW ZPPtrDNS
tay tay
lda ZPPtrIP+1 lda ZPPtrIP+1
adc #0 adc #0
>PUSHYA >PUSHYA @IP[2]
>LDYA ZPPtrIP >LDYA ZPPtrIP
iny iny
bne .1 bne .1
inc inc
.1 >PUSHYA .1 >PUSHYA @IP[1]
>PUSHW ZPPtrIP >PUSHW ZPPtrIP @IP[0]
>PUSHBI 8 4 PTRs on stack
>PUSHW L.HST.SScanF >PUSHW L.HST.SScanF
>LDYA ZPPtrDNS >LDYA ZPPtrDNS
>SYSCALL SScanF.YA >SYSCALL SScanF
bcc .9 bcc .9
jmp DNS.QUERY.I jmp DNS.QUERY.I
.9 rts .9 rts

View File

@ -126,49 +126,20 @@ SKT.New.Listen sec
* A = hSocket * A = hSocket
* ## Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
SKT.CloseA and #$7f SKT.CloseA jsr SKT.GetA.I get SKT in ZPPtrSKT, S.SOCKET.SOCK in A
cmp #K.SKTTABLE.SIZE bcs .99
bcs .9
jsr SKT.GetA.I
bcs .9
cmp #S.SOCKET.SOCK.DGRAM
beq .1
cmp #S.SOCKET.SOCK.RAW
beq .1
cmp #S.SOCKET.SOCK.STREAM cmp #S.SOCKET.SOCK.STREAM
bne .9 beq .10 TCP
bcc .9 no #S.SOCKET.SOCK.DGRAM, nor #S.SOCKET.SOCK.RAW
ldy #S.SOCKET.SO
lda (ZPPtrSKT),y
bit #S.SOCKET.SO.ACCEPTCONN
bne *
ldy #S.SOCKET.TCP.OPTIONS
lda (ZPPtrSKT),y
ora #S.TCP.OPTIONS.FIN
sta (ZPPtrSKT),y
jsr TCP.OUT SKT.Close, Try to push FIN
clc
rts
.9 lda #ERR.SKT.BAD
sec
rts
.1 ldy #S.SOCKET.HQ.TAIL .1 ldy #S.SOCKET.HQ.TAIL
lda (ZPPtrSKT),y lda (ZPPtrSKT),y
ldy #S.SOCKET.HQ.HEAD ldy #S.SOCKET.HQ.HEAD
cmp (ZPPtrSKT),y cmp (ZPPtrSKT),y
beq .8 beq .8 No frame in Queue, close..
pha pha save tail...
clc clc
adc #S.SOCKET.HQ adc #S.SOCKET.HQ
tax tax
@ -178,8 +149,8 @@ SKT.CloseA and #$7f
beq .2 beq .2
lda #0 lda #0
.2
ldy #S.SOCKET.HQ.TAIL .2 ldy #S.SOCKET.HQ.TAIL
sta (ZPPtrSKT),y sta (ZPPtrSKT),y
txa txa
@ -192,6 +163,26 @@ SKT.CloseA and #$7f
sta (ZPPtrSKT) sta (ZPPtrSKT)
clc clc
rts rts
.9 lda #ERR.SKT.BAD
sec
.99 rts
.10 ldy #S.SOCKET.SO
lda (ZPPtrSKT),y
bit #S.SOCKET.SO.ACCEPTCONN
bne * TO DO: Listening socket
ldy #S.SOCKET.TCP.OPTIONS
lda (ZPPtrSKT),y
ora #S.TCP.OPTIONS.FIN
sta (ZPPtrSKT),y
jsr TCP.OUT SKT.Close, Try to push FIN
clc
rts
*/-------------------------------------- */--------------------------------------
* # SKT.GetA * # SKT.GetA
* Get Ptr to socket * Get Ptr to socket
@ -631,6 +622,7 @@ SKT.AddToQueueA sta .2+1
cmp #S.SOCKET.HQ.MAX cmp #S.SOCKET.HQ.MAX
bne .1 bne .1
lda #0 lda #0
.1 ldy #S.SOCKET.HQ.TAIL .1 ldy #S.SOCKET.HQ.TAIL
cmp (ZPPtrSKT),y cmp (ZPPtrSKT),y
beq .9 Queue full!! beq .9 Queue full!!

View File

@ -11,6 +11,13 @@
+ **A2OSX.BUILD.po** : **(0.9.2)** 800k BOOT disk image with S-C MASM 3.0 and all binaries (BOOT+DEV) + **A2OSX.BUILD.po** : **(0.9.2)** 800k BOOT disk image with S-C MASM 3.0 and all binaries (BOOT+DEV)
+ **A2OSX.SRC.po** : **(0.9.2)** 800k disk image with all sources + **A2OSX.SRC.po** : **(0.9.2)** 800k disk image with all sources
## Latest News 2018-06-17
Ok, as i'm still the lone developer here, i decided to break the kernel, HAHAHAHAHAHA!!!!
I updated the Calling Convention (see projects), i now setup the header in each KERNEL.S.* file accordingly to generate doc, then i change the code...
So ....nothing works anymore on the A2OSX.BUILD media...
## Latest News 2018-06-13 ## Latest News 2018-06-13
Previous (relatively!) stable version 0.9.1 has been archived, see link above. Previous (relatively!) stable version 0.9.1 has been archived, see link above.

View File

@ -2,8 +2,8 @@ NEW
PREFIX /A2OSX.BUILD PREFIX /A2OSX.BUILD
AUTO 4,1 AUTO 4,1
*/-------------------------------------- */--------------------------------------
* ## GetArg * # GetArg
* # ASM * ## ASM
* **In:** * **In:**
* A = argument index. * A = argument index.
* **Out:** * **Out:**

View File

@ -2,13 +2,13 @@ NEW
PREFIX /A2OSX.BUILD PREFIX /A2OSX.BUILD
AUTO 4,1 AUTO 4,1
*-------------------------------------- *--------------------------------------
* K.LoadLib.YA * K.LoadLib
* in : * in :
* Y,A = PTR To "LibName.o" C-String * Y,A = PTR To "LibName.o" C-String
* out : * out :
* A = hMem To loaded LIB * A = hMem To loaded LIB
*-------------------------------------- *--------------------------------------
K.LoadLib.YA jsr BIN.FindLIB.YA K.LoadLib jsr BIN.FindLIB.YA
bcs .9 bcs .9
jsr BIN.Load.YA Y,A = "/PATH/BIN" jsr BIN.Load.YA Y,A = "/PATH/BIN"
@ -35,12 +35,12 @@ K.LoadLib.YA jsr BIN.FindLIB.YA
sec sec
rts rts
*-------------------------------------- *--------------------------------------
* K.UnloadLib.A * K.UnloadLib
* in : * in :
* A = hMem To Lib * A = hMem To Lib
* out : * out :
*-------------------------------------- *--------------------------------------
K.UnloadLib.A pha K.UnloadLib pha
jsr K.GetMemByID.A jsr K.GetMemByID.A
>STYA ZPPtr1 >STYA ZPPtr1
ldy #S.MEM.REFCNT ldy #S.MEM.REFCNT
@ -65,13 +65,13 @@ K.UnloadLib.A pha
pla pla
jmp K.FreeMem.A jmp K.FreeMem.A
*-------------------------------------- *--------------------------------------
* K.LoadDrv.YA * K.LoadDrv
* in : * in :
* Y,A = PTR to "NAME.DRV [PARAM]" C-String * Y,A = PTR to "NAME.DRV [PARAM]" C-String
* out : * out :
* none * none
*-------------------------------------- *--------------------------------------
K.LoadDrv.YA >STYA .2+1 Save "BIN\0ARGS\0\0" K.LoadDrv >STYA .2+1 Save "BIN\0ARGS\0\0"
jsr BIN.FindDRV.YA jsr BIN.FindDRV.YA
bcs .9 bcs .9
@ -117,9 +117,9 @@ K.LoadDrv.YA >STYA .2+1 Save "BIN\0ARGS\0\0"
.88 jmp (pDrv) .88 jmp (pDrv)
*-------------------------------------- *--------------------------------------
BIN.FindLIB.YA clc BIN.FindLIB clc
.HS B0 bcs .HS B0 bcs
BIN.FindDRV.YA sec BIN.FindDRV sec
>STYA BIN.CmdLine >STYA BIN.CmdLine
@ -127,7 +127,7 @@ BIN.FindDRV.YA sec
bcc .1 bcc .1
>LDYAI BIN.Find.ENV.DRV >LDYAI BIN.Find.ENV.DRV
.1 jsr K.GetEnv.YA get value for Search Path .1 jsr K.GetEnv get value for Search Path
bcs .9 bcs .9
>PUSHYA >PUSHYA
@ -142,16 +142,19 @@ BIN.FindDRV.YA sec
* # 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
* `int filesearch ( char * filename, char * searchpath, char * fullpath, stat * filestat);`
* ## ASM
* **In:** * **In:**
* PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB * `>PUSHWI filestat`
* PUSHW = Ptr to File Name (CSTR) * `>PUSHWI fullpath`
* PUSHW = Ptr to DstBuf * `>PUSHWI searchpath`
* PUSHW = Ptr to DstStat * `>LDYAI filename`
* **Out:** * **Out:**
* CC : success * CC : success
* DstBuf = FilePath * DstBuf = FilePath
* DstStat = S.STAT * DstStat = S.STAT
* CS : not found * CS : not found
*\-------------------------------------- *\--------------------------------------
K.FileSearch >PULLW .4+1 DstStat K.FileSearch >PULLW .4+1 DstStat
>PULLW .2+1 DstBuf >PULLW .2+1 DstBuf

View File

@ -280,16 +280,15 @@ DevMgr.NUL.Code .DA .1 STATUS
.DA A2osX.BADCALL CLOSE .DA A2osX.BADCALL CLOSE
.DA A2osX.BADCALL READ .DA A2osX.BADCALL READ
.DA .8 WRITE .DA .8 WRITE
.8 clc
rts
*-------------------------------------- *--------------------------------------
.1 >LDYAI .2 .1 >LDYAI .2
clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
.2 .DA #S.DEV.S.WRITE+S.DEV.S.READ .2 .DA #S.DEV.S.WRITE+S.DEV.S.READ
.DA #0,#0,#0 .DA #0,#0,#0
>PSTR "NULL DEVICE " >PSTR "NULL DEVICE"
.BS 5
.DA #S.DSTAT.T.CHAR .DA #S.DSTAT.T.CHAR
.DA #0 .DA #0
.DA KVER .DA KVER

View File

@ -4,11 +4,11 @@ AUTO 4,1
*/-------------------------------------- */--------------------------------------
* # 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
*\-------------------------------------- *\--------------------------------------
K.GetDevByID.A cmp DevMgr.Count K.GetDevByID.A cmp DevMgr.Count
bcs K.GetDevDNF bcs K.GetDevDNF
@ -88,20 +88,23 @@ K.GetDevStatus.A
jmp (pDev) jmp (pDev)
*/-------------------------------------- */--------------------------------------
* # IOCTL * # IOCTL
* ## C
* `int ioctl ( short int id, short int op, void *param);`
* ## ASM
* **In:** * **In:**
* PUSHB = DevID * `PUSHWI param`
* PUSHB = Operation * `lda #op`
* PUSHW = Param Block * `ldy id`
* `>SYSCALL IOCTL`
* **Out:** * **Out:**
* Y,A = ... * Y,A = ...
*\-------------------------------------- *\--------------------------------------
K.IOCTL >PULLB .1+1 K.IOCTL tax op
>PULLB .2+1 >PULLB .1+1 param LO
>PULLB .2+1 param HI
>PULLA tya id
tax
>PULLA
jsr K.GetDevByID.A jsr K.GetDevByID.A
bcs K.IOCTL.9 bcs K.IOCTL.9
@ -110,7 +113,7 @@ K.IOCTL >PULLB .1+1
.1 ldy #$ff SELF MODIFIED .1 ldy #$ff SELF MODIFIED
.2 lda #$ff SELF MODIFIED .2 lda #$ff SELF MODIFIED
jmp (pDev) jmp (pDev) x = op
K.IOCTL.9 rts K.IOCTL.9 rts
*-------------------------------------- *--------------------------------------

View File

@ -2,14 +2,14 @@ NEW
PREFIX /A2OSX.BUILD PREFIX /A2OSX.BUILD
AUTO 4,1 AUTO 4,1
*/-------------------------------------- */--------------------------------------
* # ExpandStr.YA * # 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
*\-------------------------------------- *\--------------------------------------
K.ExpandStr.YA stz .88+1 Reset Intermediate string... K.ExpandStr stz .88+1 Reset Intermediate string...
.1 >STYA ZPPtr2 .1 >STYA ZPPtr2
stz ENV.BufLen init Expanded String len=0 stz ENV.BufLen init Expanded String len=0

View File

@ -9,112 +9,112 @@ AUTO 4,1
K.SYSCALL.JMP .DA 0 $00 K.SYSCALL.JMP .DA 0 $00
.DA 0 .DA 0
.DA K.Stat .DA K.Stat
.DA K.MKDir.YA .DA K.MKDir
.DA K.MKNod.YA .DA K.MKNod
.DA K.MKFIFO .DA K.MKFIFO
.DA 0 .DA 0
.DA 0 .DA 0
.DA K.OpenDir.YA $10 .DA K.OpenDir $10
.DA K.ReadDir.A .DA K.ReadDir
.DA K.CloseDir.A .DA K.CloseDir
.DA 0 .DA 0
.DA 0 .DA 0
.DA 0 .DA 0
.DA 0 .DA 0
.DA 0 .DA 0
.DA K.FPutC.AY $20 .DA K.FPutC $20
.DA K.PutChar.A .DA K.PutChar
.DA K.GetC.A .DA K.GetC
.DA K.GetChar .DA K.GetChar
.DA K.FPutS .DA K.FPutS
.DA K.PutS.YA .DA K.PutS
.DA 0 .DA 0
.DA 0 .DA 0
.DA K.FOpen $30 .DA K.FOpen $30
.DA K.FClose.A .DA K.FClose
.DA K.FRead .DA K.FRead
.DA K.FWrite .DA K.FWrite
.DA K.FFlush.A .DA K.FFlush
.DA K.FSeek .DA K.FSeek
.DA K.FTell .DA K.FTell
.DA K.FEOF.A .DA K.FEOF
.DA K.Remove.YA $40 .DA K.Remove $40
.DA K.Rename .DA K.Rename
.DA 0 .DA 0
.DA 0 .DA 0
.DA K.GetDevByID.A .DA K.GetDevByID
.DA K.GetDevByName.YA .DA K.GetDevByName
.DA K.GetDevStatus.A .DA K.GetDevStatus
.DA K.IOCTL .DA K.IOCTL
.DA 0 $50 .DA 0 $50
.DA K.SScanF.YA .DA K.SScanF
.DA 0 .DA 0
.DA 0 .DA 0
.DA K.PrintF.YA .DA K.PrintF
.DA K.SPrintF.YA .DA K.SPrintF
.DA K.FPrintF.A .DA K.FPrintF
.DA 0 .DA 0
.DA 0 $60 .DA 0 $60
.DA 0 .DA 0
.DA K.LoadFile .DA K.LoadFile
.DA K.LoadTxtFile.YA .DA K.LoadTxtFile
.DA K.ChTyp .DA K.ChTyp
.DA K.ChMod .DA K.ChMod
.DA K.ChOwn .DA K.ChOwn
.DA K.ChGrp .DA K.ChGrp
.DA K.AToF $70 .DA K.AToF $70
.DA K.AToI.YA .DA K.AToI
.DA K.AToL .DA K.AToL
.DA K.StrToF .DA K.StrToF
.DA K.StrToL .DA K.StrToL
.DA 0 .DA 0
.DA K.RealPath.YA .DA K.RealPath
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
* Bank 2 * Bank 2
*-------------------------------------- *--------------------------------------
.DA K.StrLen.YA $80 .DA K.StrLen $80
.DA K.StrCpy .DA K.StrCpy
.DA K.StrCat .DA K.StrCat
.DA K.StrMatch .DA K.StrMatch
.DA K.StrUpr.YA .DA K.StrUpr
.DA K.StrLwr.YA .DA K.StrLwr
.DA K.StrCmp .DA K.StrCmp
.DA K.StrICmp .DA K.StrICmp
.DA K.Time.YA $90 .DA K.Time $90
.DA K.CTime2Time .DA K.CTime2Time
.DA K.PTime2Time .DA K.PTime2Time
.DA K.StrFTime .DA K.StrFTime
.DA K.LoadLib.YA .DA K.LoadLib
.DA K.UnloadLib.A .DA K.UnloadLib
.DA K.LoadDrv.YA .DA K.LoadDrv
.DA K.FileSearch .DA K.FileSearch
.DA K.ExecPSNewEnv.YA $A0 .DA K.ExecPSNewEnv $A0
.DA K.ExecPS.YA .DA K.ExecPS
.DA K.CreatePSNewEnv.YA .DA K.CreatePSNewEnv
.DA K.CreatePS.YA .DA K.CreatePS
.DA 0 .DA 0
.DA K.GetMemStat.YA .DA K.GetMemStat
.DA K.GetPSStatus.A .DA K.GetPSStatus
.DA K.GetPSStat.YA .DA K.GetPSStat
.DA 0 $B0 .DA 0 $B0
.DA K.GetArg.A .DA K.GetArg
.DA K.ExpandStr.YA .DA K.ExpandStr
.DA 0 .DA 0
.DA K.PutEnv.YA .DA K.PutEnv
.DA K.SetEnv .DA K.SetEnv
.DA K.GetEnv.YA .DA K.GetEnv
.DA K.UnsetEnv.YA .DA K.UnsetEnv
.DA K.FAdd $C0 .DA K.FAdd $C0
.DA K.FSub .DA K.FSub
@ -136,23 +136,23 @@ K.SYSCALL.JMP .DA 0 $00
*-------------------------------------- *--------------------------------------
* $E000 * $E000
*-------------------------------------- *--------------------------------------
.DA K.GetStkObjProperty.AY $E0 .DA K.GetStkObjProperty $E0
.DA K.FreeMem.A .DA K.FreeMem
.DA K.GetMemPtr.A .DA K.GetMemPtr
.DA K.GetMemByID.A .DA K.GetMemByID
.DA K.GetMem.YA .DA K.GetMem
.DA K.GetMem0.YA .DA K.GetMem0
.DA K.NewStr.YA .DA K.NewStr
.DA K.SListAdd .DA K.SListAdd
*-------------------------------------- *--------------------------------------
.DA K.SListLookup $F0 .DA K.SListLookup $F0
.DA K.SListGetByID .DA K.SListGetByID
.DA K.SListUpdateByID .DA K.SListUpdateByID
.DA K.SListNew .DA K.SListNew
.DA K.SListFree.A .DA K.SListFree
.DA K.LoadStkObj .DA K.LoadStkObj
.DA K.NewStkObj.YA .DA K.NewStkObj
.DA K.FreeStkObj.A .DA K.FreeStkObj
*-------------------------------------- *--------------------------------------
* LO Byte : * LO Byte :
* #RRAMWRAMBNK1,#RRAMWRAMBNK2 * #RRAMWRAMBNK1,#RRAMWRAMBNK2

View File

@ -18,7 +18,7 @@ ZPSListDataPtr .EQ ZPMEMMGR+14
* - mem.ID=0 always used! useful to test if hMem=0 * - mem.ID=0 always used! useful to test if hMem=0
*-------------------------------------- *--------------------------------------
*/-------------------------------------- */--------------------------------------
* # GetMem0.YA * # GetMem0
* **In:** * **In:**
* Y,A = Size Requested * Y,A = Size Requested
* **Out:** * **Out:**
@ -28,10 +28,10 @@ ZPSListDataPtr .EQ ZPMEMMGR+14
* CS : * CS :
* A = EC * A = EC
*\-------------------------------------- *\--------------------------------------
K.GetMem0.YA ldx #S.MEM.F.INIT0 K.GetMem0 ldx #S.MEM.F.INIT0
.HS 2C bit abs .HS 2C bit abs
*/-------------------------------------- */--------------------------------------
* # GetMem.YA * # GetMem
* **In:** * **In:**
* Y,A = Size Requested * Y,A = Size Requested
* **Out:** * **Out:**
@ -41,7 +41,7 @@ K.GetMem0.YA ldx #S.MEM.F.INIT0
* CS : * CS :
* A = EC * A = EC
*\-------------------------------------- *\--------------------------------------
K.GetMem.YA ldx #0 K.GetMem ldx #0
MEM.GetMem.YAX stx Mem.ReqFlags MEM.GetMem.YAX stx Mem.ReqFlags
sta ZPMemMgrSize+1 sta ZPMemMgrSize+1
@ -235,14 +235,14 @@ Mem.NextSlot lda ZPMemMgrSPtr
inc ZPMemMgrSPtr+1 inc ZPMemMgrSPtr+1
.8 rts .8 rts
*/-------------------------------------- */--------------------------------------
* # FreeMem.A * # FreeMem
* **In:** * **In:**
* A = hMem To Free * A = hMem To Free
* **Out:** * **Out:**
* none. * none.
* (X,Y unmodified) * (X,Y unmodified)
*\-------------------------------------- *\--------------------------------------
K.FreeMem.A phy K.FreeMem phy
tay tay
beq * Slot=0, reserved by Kernel beq * Slot=0, reserved by Kernel
@ -321,7 +321,7 @@ K.FreeMem.A phy
>PUSHYA >PUSHYA
>LDYAI K.FreeMem.A.ERR >LDYAI K.FreeMem.ERR
>SYSCALL PrintF.YA >SYSCALL PrintF.YA
.91 ldx #$ff .91 ldx #$ff
@ -329,16 +329,16 @@ K.FreeMem.A phy
bit $C000,x bit $C000,x
bra * bra *
*-------------------------------------- *--------------------------------------
K.FreeMem.A.ERR .AZ "FreeMem:%H:hMem already freed." K.FreeMem.ERR .AZ "FreeMem:%H:hMem already freed."
*/-------------------------------------- */--------------------------------------
* # GetMemPtr.A * # GetMemPtr
* **In:** * **In:**
* A = hMem * A = hMem
* **Out:** * **Out:**
* Y,A = PTR to MemBlock * Y,A = PTR to MemBlock
* (X unmodified) * (X unmodified)
*\-------------------------------------- *\--------------------------------------
K.GetMemPtr.A jsr K.GetMemByID.A K.GetMemPtr jsr K.GetMemByID.A
ldy #S.MEM.PTR ldy #S.MEM.PTR
lda (ZPMemMgrSPtr),y lda (ZPMemMgrSPtr),y
pha pha
@ -347,7 +347,7 @@ K.GetMemPtr.A jsr K.GetMemByID.A
ply ply
rts rts
*/-------------------------------------- */--------------------------------------
* # GetMemByID.A * # GetMemByID
* **In:** * **In:**
* A = hMem * A = hMem
* **Out:** * **Out:**
@ -367,7 +367,7 @@ K.GetMemPtr.A jsr K.GetMemByID.A
!!!!!WARNING!!!!! !!!!!WARNING!!!!!
.FIN .FIN
*-------------------------------------- *--------------------------------------
K.GetMemByID.A sta ZPMemMgrSPtr K.GetMemByID sta ZPMemMgrSPtr
lda /Mem.Table/8 lda /Mem.Table/8
asl ZPMemMgrSPtr asl ZPMemMgrSPtr
rol rol
@ -397,7 +397,7 @@ K.GetMemByID.A sta ZPMemMgrSPtr
* sta ZPMemMgrSPtr+1 * sta ZPMemMgrSPtr+1
* rts * rts
*/-------------------------------------- */--------------------------------------
* # NewStr.YA * # 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
@ -408,7 +408,7 @@ K.GetMemByID.A sta ZPMemMgrSPtr
* CS : error * CS : error
* A = SYS error code * A = SYS error code
*\-------------------------------------- *\--------------------------------------
K.NewStr.YA >STYA .1+1 K.NewStr >STYA .1+1
>STYA .4+1 >STYA .4+1
ldy #0 ldy #0
@ -513,7 +513,7 @@ K.SListNew
* A=hSList * A=hSList
* **Out:** * **Out:**
*\-------------------------------------- *\--------------------------------------
K.SListFree.A K.SListFree
*-------------------------------------- *--------------------------------------
sta SETREADAUX sta SETREADAUX
sta SETWRITEAUX sta SETWRITEAUX
@ -522,15 +522,14 @@ K.SListFree.A
sta CLRWRITEAUX sta CLRWRITEAUX
rts rts
*/-------------------------------------- */--------------------------------------
* # GetStkObjProperty.AY * # 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
*\-------------------------------------- *\--------------------------------------
K.GetStkObjProperty.AY K.GetStkObjProp phy
phy
sta SETREADAUX sta SETREADAUX
jsr K.GetMemPtr.A jsr K.GetMemPtr.A
>STYA ZPMemMgrTmp1 >STYA ZPMemMgrTmp1
@ -544,7 +543,7 @@ K.GetStkObjProperty.AY
sta CLRREADAUX sta CLRREADAUX
rts rts
*/-------------------------------------- */--------------------------------------
* # NewStkObj.YA * # NewStkObj
* **In:** * **In:**
* Y,A = Size Requested * Y,A = Size Requested
* **Out:** * **Out:**
@ -554,17 +553,17 @@ K.GetStkObjProperty.AY
* CS : * CS :
* A = EC * A = EC
*\-------------------------------------- *\--------------------------------------
K.NewStkObj.YA ldx #SYS.GetMem.YA K.NewStkObj ldx #SYS.GetMem
.HS 2C BIT ABS .HS 2C BIT ABS
*/-------------------------------------- */--------------------------------------
* # FreeStkObj.A * # 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)
*\-------------------------------------- *\--------------------------------------
K.FreeStkObj.A ldx #SYS.FreeMem.A K.FreeStkObj ldx #SYS.FreeMem
MEM.GoStkObj sta SETREADAUX MEM.GoStkObj sta SETREADAUX
sta SETWRITEAUX sta SETWRITEAUX

View File

@ -1,35 +1,41 @@
NEW NEW
PREFIX /A2OSX.BUILD PREFIX /A2OSX.BUILD
AUTO 4,1 AUTO 4,1
*--------------------------------------
STDIO.Out.pBuf .EQ K.SP.PARAMS+2
STDIO.Out.Cnt .EQ K.SP.PARAMS+4
*/-------------------------------------- */--------------------------------------
* # FPutC.A * # FPutC
* int fputc ( int character, hFILE stream );
* Print A (char) to hFILE * Print A (char) to hFILE
* ## C
* `int fputc ( int character, hFILE stream );`
* ## ASM
* **In:** * **In:**
* PUSHB : hFILE * Y : character
* A : char to print * A : stream
* **Out:** * **Out:**
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.FPutC.AY sta K.IOBuf K.FPutC sty K.IOBuf
>PULLA bra K.PutChar.1
bra K.PutChar.A.1
*/-------------------------------------- */--------------------------------------
* # PutChar.A * # PutChar
* int putchar ( int character ); * ## C
* `int putchar ( int character );`
* ## 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
*\-------------------------------------- *\--------------------------------------
K.PutChar.A sta K.IOBuf K.PutChar sta K.IOBuf
ldy #S.PS.hStdOut ldy #S.PS.hStdOut
lda (pPs),y lda (pPs),y
K.PutChar.A.1 jsr K.GetMemPtr.A K.PutChar.1 jsr K.GetMemPtr.A
>STYA pNode >STYA pNode
>LDYAI K.IOBuf >LDYAI K.IOBuf
>STYA pIOBuf >STYA pIOBuf
@ -38,40 +44,42 @@ K.PutChar.A.1 jsr K.GetMemPtr.A
stz STDIO.Out.Cnt+1 stz STDIO.Out.Cnt+1
jmp STDIO.Out jmp STDIO.Out
*/-------------------------------------- */--------------------------------------
* # PutS.YA * # PutS
* int puts ( const char * str );
* Write Str to StdOut, appends '\r\n' * Write Str to StdOut, appends '\r\n'
* ## C
* `int puts ( const char * str );`
* **In:** * **In:**
* Y,A : CPtr * Y,A : CPtr
* **Out:** * **Out:**
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.PutS.YA >STYA pIOBuf K.PutS >STYA pIOBuf
ldy #S.PS.hStdOut ldy #S.PS.hStdOut
lda (pPs),y lda (pPs),y
jsr K.FPutS.YA.1 jsr K.FPutS.1
bcs .9 bcs .9
lda #13 lda #13
jsr K.PutChar.A jsr K.PutChar
bcs .9 bcs .9
lda #10 lda #10
jmp K.PutChar.A jmp K.PutChar
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* # FPutS.YA * # FPutS
* int fputs ( const char * str, hFILE stream );
* Write Str to FILE * Write Str to FILE
* ## C
* `int fputs ( const char * str, hFILE stream );`
* **In:** * **In:**
* PUSHB : hFILE * PUSHB : hFILE
* Y,A: CPtr * Y,A: str
* **Out:** * **Out:**
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.FPutS.YA >STYA pIOBuf K.FPutS >STYA pIOBuf
>PULLA >PULLA
K.FPutS.YA.1 jsr K.GetMemPtr.A K.FPutS.1 jsr K.GetMemPtr.A
>STYA pNode >STYA pNode
ldy #0 ldy #0
@ -95,72 +103,70 @@ K.FPutS.YA.1 jsr K.GetMemPtr.A
stx STDIO.Out.Cnt+1 stx STDIO.Out.Cnt+1
jmp STDIO.Out jmp STDIO.Out
*/-------------------------------------- */--------------------------------------
* # PrintF.YA * # PrintF/SPrintF/FPrintF
* int printf ( const char * format, ... );
* # SPrintF.YA
* int sprintf ( char * str, const char * format, ... );
* # FPrintF.A
* int fprintf ( FILE * stream, const char * format, ... );
*
* Prints C-Style String * Prints C-Style String
* ## C
* `int printf ( const char * format, ... );`
* `int sprintf ( char * str, const char * format, ... );`
* `int fprintf ( FILE * stream, const char * format, ... );`
* ## ASM
* **In:** * **In:**
* PrintF.YA : * PrintF :
* PUSH ... * PUSH ...
* Y,A = PTR to CStr * Y,A = PTR to CStr
* SPrintF.YA : * SPrintF :
* PUSH ... * PUSH ...
* PUSHW = PTR to CStr * PUSHW = PTR to CStr
* Y,A = Ptr to Dst Buffer * Y,A = Ptr to Dst Buffer
* FPrintF.YA : * FPrintF :
* PUSH ... * PUSH ...
* PUSHW = PTR to CStr * PUSHW = PTR to CStr
* A = hFILE * A = hFILE
*
* **Out:** * **Out:**
* CC : success * CC : success
* CS : error code from Output * CS : error 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
* %d : pull 1 byte unsigned DEC 0..255 * + %d : pull 1 byte unsigned DEC 0..255
* %D : pull 2 bytes unsigned DEC 0..65535 * + %D : pull 2 bytes unsigned DEC 0..65535
* %u : pull 4 bytes long unsigned DEC 0..4294967295 * + %u : pull 4 bytes long unsigned DEC 0..4294967295
* %e : pull 5 Bytes float (-)1.23456789e+12 * + %e : pull 5 Bytes float (-)1.23456789e+12
* %f : pull 5 Bytes float (-)3.1415 * + %f : pull 5 Bytes float (-)3.1415
* %h : pull 1 byte to Print HEX * + %h : pull 1 byte to Print HEX
* %H : pull 2 bytes to Print HEX * + %H : pull 2 bytes to Print HEX
* %i : pull 1 byte to Print signed DEC -128..127 * + %i : pull 1 byte to Print signed DEC -128..127
* %I : pull 2 bytes to Print signed DEC -32768..32767 * + %I : pull 2 bytes to Print signed DEC -32768..32767
* %L : pull 4 bytes signed DEC -2147483648..2147483647 * + %L : pull 4 bytes signed DEC -2147483648..2147483647
* %n : pull 1 byte to Print low Nibble HEX * + %n : pull 1 byte to Print low Nibble HEX
* %N : pull 1 byte to Print high Nibble HEX * + %N : pull 1 byte to Print high Nibble HEX
* %s : pull 2 bytes ptr to C-Style String * + %s : pull 2 bytes ptr to C-Style String
* %S : pull 2 bytes ptr to P-Style String * + %S : pull 2 bytes ptr to P-Style String
* \b : Print 'BS' (08) * + \b : Print 'BS' (08)
* \e : Print 'ESC' ($1B,27) * + \e : Print 'ESC' ($1B,27)
* \f : Print 'FF' ($0C,12) * + \f : Print 'FF' ($0C,12)
* \n : Print 'LF' ($0A,10) * + \n : Print 'LF' ($0A,10)
* \r : Print 'CR' ($0D,13) * + \r : Print 'CR' ($0D,13)
* \\\\ : Print \ * + \\\\ : Print \
* \% : Print % * + \\% : Print %
* Modifiers for len and padding : * Modifiers for len and padding :
* %d : '9' '12' * + %d : '9' '12'
* %2d : ' 9' '12' * + %2d : ' 9' '12'
* %02d : '09' '12' * + %02d : '09' '12'
* %11s : 'ABCDEFGH ' * + %11s : 'ABCDEFGH '
* %011s : 'ABCDEFGH000' * + %011s : 'ABCDEFGH000'
* %2f : '3.14' * + %2f : '3.14'
*\-------------------------------------- *\--------------------------------------
K.SPrintF.YA >STYA pIOBuf Out Buffer K.SPrintF >STYA pIOBuf Out Buffer
>PULLW ZPPtr1 format >PULLW ZPPtr1 format
bra K.PrintF.1 bra K.PrintF.1
K.FPrintF.A jsr K.GetMemPtr.A A = hFILE K.FPrintF jsr K.GetMemPtr.A A = hFILE
>STYA pNode >STYA pNode
>PULLW ZPPtr1 format >PULLW ZPPtr1 format
bra K.PrintF.0 bra K.PrintF.0
K.PrintF.YA >STYA ZPPtr1 format K.PrintF >STYA ZPPtr1 format
ldy #S.PS.hStdOut ldy #S.PS.hStdOut
lda (pPs),y lda (pPs),y
jsr K.GetMemPtr.A jsr K.GetMemPtr.A
@ -419,7 +425,7 @@ PrintF.Hex2Dec ror .31+1
clc clc
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
* EXP(8) 1(s) 1significants(31) * EXP(8) 1(s) 1significants(31)
* http://apple2.org.za/gswv/a2zine/GS.WorldView/Resources/GS.TECH.INFO/AppleSoft/ * http://apple2.org.za/gswv/a2zine/GS.WorldView/Resources/GS.TECH.INFO/AppleSoft/
*-------------------------------------- *--------------------------------------
PrintF.E sec Force "E+12" PrintF.E sec Force "E+12"
@ -565,8 +571,6 @@ PrintF.COut phy
rts rts
*-------------------------------------- *--------------------------------------
*-------------------------------------- *--------------------------------------
STDIO.Out.Cnt .BS 2
*--------------------------------------
STDIO.Out ldy #S.NODE.T STDIO.Out ldy #S.NODE.T
lda (pNode),y lda (pNode),y
asl asl
@ -597,7 +601,7 @@ STDIO.Out.CDEV ldy #S.NODE.DEV.JMP
sta .1+2 sta .1+2
lda K.IOBuf lda K.IOBuf
ldx #DEVMGR.WRITE ldx #IOCTL.WRITE
.1 jmp $ffff .1 jmp $ffff
*-------------------------------------- *--------------------------------------
STDIO.Out.SSOCK lda (pNode) #S.NODE.HANDLER STDIO.Out.SSOCK lda (pNode) #S.NODE.HANDLER
@ -655,16 +659,18 @@ STDIO.Out.FIFO ldy #S.NODE.FIFO.S
K.GetChar ldy #S.PS.hStdIn K.GetChar ldy #S.PS.hStdIn
lda (pPs),y lda (pPs),y
*/-------------------------------------- */--------------------------------------
* # GetC.A * # GetC
* Get char from Node * Get char from Node
* ## C
* `int getc ( FILE * stream );`
* ## ASM
* **In:** * **In:**
* A = hNODE * A = hNODE
* **Out:** * **Out:**
* CC = success * CC = success
* A = char * A = char
*\-------------------------------------- *\--------------------------------------
K.GetC.A sta K.PutC.Node K.GetC.A jsr K.GetMemPtr.A
jsr K.GetMemPtr.A
>STYA pDev >STYA pDev
ldy #S.NODE.T ldy #S.NODE.T
@ -727,27 +733,32 @@ K.PrintF.PadL .EQ FAC+4
K.PrintF.PadC .EQ FAC+5 K.PrintF.PadC .EQ FAC+5
BCDBUF .EQ ARG BCDBUF .EQ ARG
*/-------------------------------------- */--------------------------------------
* # SScanF.YA * # SScanF
* Scan a C-String (in progress) * Read formatted data from string
* ## C
* `int sscanf ( const char * s, const char * format, ...);`
* ## ASM
* **In:** * **In:**
* PUSHW PTR to target var * `>PUSHBI Argument Byte count`
* ... * `>PUSHWI format`
* PUSHW PTR pattern (ex: "%d.%d.%d.%d") * + %i : short int
* %i : short int * + %d : byte
* %d : byte * + %I : int
* %I : int * + %D : word
* %D : word * + %L : long int
* %L : long int * + %U : dword
* %U : dword * + %h : HEX byte
* %h : HEX byte * + %H : HEX word
* %H : HEX word * `>LDYA s`
* Y,A = PTR to String to scan (ex: "192.168.1.5")
* **Out:** * **Out:**
* Y,A = Number of arguments filled.
*\-------------------------------------- *\--------------------------------------
K.SScanF.YA >STYA ZPPtr2 String to Scan K.SScanF >STYA ZPPtr2 String to Scan
>PULLW ZPPtr1 Pattern >PULLW ZPPtr1 format
>PULLB K.SScanF.ByteCnt
stz K.SScanF.ByteIdx
.1 lda (ZPPtr1) End Of Pattern? .1 lda (ZPPtr1) End Of format?
beq .8 beq .8
inc ZPPtr1 inc ZPPtr1
@ -766,7 +777,7 @@ K.SScanF.YA >STYA ZPPtr2 String to Scan
bra .1 bra .1
.2 lda (ZPPtr1) Get specifier after % .2 lda (ZPPtr1) Get specifier after %
beq .9 unexpected End of pattern after "%" ? beq .9 unexpected End of format after "%" ?
inc ZPPtr1 inc ZPPtr1
bne .21 bne .21
@ -780,22 +791,40 @@ K.SScanF.YA >STYA ZPPtr2 String to Scan
dex dex
bpl .3 bpl .3
.9 lda #MLI.E.EOF .9 jsr .8
lda #MLI.E.EOF
sec sec
rts rts
.4 jsr .5 .4 jsr .5
bcs .9
bra .1 bra .1
.8 clc .8 lda pStack
rts clc
adc K.SScanF.ByteCnt
sta pStack CC
.99 rts
*-------------------------------------- *--------------------------------------
.5 >PULLW ZPPtr3 get VAR Ptr .5 ldy K.SScanF.ByteIdx
cpy K.SScanF.ByteCnt
beq .99 CS
lda (pStack),y
sta ZPPtr3
iny
lda (pStack),y
sta ZPPtr3+1 get VAR Ptr
iny
sty K.SScanF.ByteIdx
lda K.SScanFTBL+1,x Get VAR size lda K.SScanFTBL+1,x Get VAR size
jmp (K.SScanFJMP,x) jmp (K.SScanFJMP,x)
*-------------------------------------- *--------------------------------------
K.SScanF.ByteCnt .BS 1
K.SScanF.ByteIdx .BS 1
*--------------------------------------
K.SScanFTBL .DA #'i,#1,#'d,#1,#'I,#2,#'D,#2,#'l,#4,#'u,#4,#'h,#1,#'H,#2 K.SScanFTBL .DA #'i,#1,#'d,#1,#'I,#2,#'D,#2,#'l,#4,#'u,#4,#'h,#1,#'H,#2
K.SScanFJMP .DA K.SScanF.I K.SScanFJMP .DA K.SScanF.I
.DA K.SScanF.D .DA K.SScanF.D

View File

@ -2,11 +2,11 @@ NEW
PREFIX /A2OSX.BUILD PREFIX /A2OSX.BUILD
AUTO 4,1 AUTO 4,1
*/-------------------------------------- */--------------------------------------
* ## 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`
@ -25,11 +25,11 @@ K.StrToF >STYA TXTPTR Ptr to source string
sta (ZPPtr1),y sta (ZPPtr1),y
rts rts
*/-------------------------------------- */--------------------------------------
* ## 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:**
@ -57,12 +57,12 @@ K.AToF.I jsr CHARGOT
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* ## 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`
@ -92,9 +92,9 @@ K.StrToUL.rts rts
*/-------------------------------------- */--------------------------------------
* # 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:**
@ -124,10 +124,10 @@ K.AToL.I jsr STDLIB.GetDec
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* ## 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:**

View File

@ -2,14 +2,17 @@ NEW
PREFIX /A2OSX.BUILD PREFIX /A2OSX.BUILD
AUTO 4,1 AUTO 4,1
*/-------------------------------------- */--------------------------------------
* # StrLen.YA * # StrLen
* Returns Length of C-String * Returns Length of C-String
* ## C
* `char * strcat ( char * destination, const char * source );`
* ## ASM
* **In:** * **In:**
* Y,A = Ptr to CSTR * Y,A = Ptr to CSTR
* **Out:** * **Out:**
* Y,A = String length * Y,A = String length
*\-------------------------------------- *\--------------------------------------
K.StrLen.YA >STYA ZPPtr1 K.StrLen >STYA ZPPtr1
ldy #0 ldy #0
ldx #0 ldx #0
@ -45,11 +48,14 @@ K.StrCat jsr MEM.PullP1P2
*/-------------------------------------- */--------------------------------------
* # StrCpy * # StrCpy
* Copy string * Copy string
* ## C
* `char * strcpy ( char * destination, const char * source );`
* ## ASM
* **In:** * **In:**
* PUSHW = Ptr to SRC (CSTR) * PUSHW = Ptr to SRC (CSTR)
* PUSHW = Ptr to DST (CSTR) * PUSHW = Ptr to DST (CSTR)
* **Out:** * **Out:**
* DST = SRC * DST = SRC
*\-------------------------------------- *\--------------------------------------
K.StrCpy jsr MEM.PullP1P2 K.StrCpy jsr MEM.PullP1P2
@ -140,12 +146,12 @@ K.StrMatch jsr MEM.PullP1P2
.8 clc .8 clc
rts rts
*/-------------------------------------- */--------------------------------------
* # StrUpr.YA/StrLwr.YA * # 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
*\-------------------------------------- *\--------------------------------------
K.StrUpr.YA ldx #0 K.StrUpr.YA ldx #0
.HS 2C bit abs .HS 2C bit abs

View File

@ -9,14 +9,14 @@ CENTURY0 .EQ 19
YEAR0 .EQ 70 YEAR0 .EQ 70
DAY0 .EQ 4 day 0 was a thursday DAY0 .EQ 4 day 0 was a thursday
*/-------------------------------------- */--------------------------------------
* # Time.YA * # Time
* Get System Time in Buffer * Get System Time in Buffer
* ## In : * ## 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.YA >STYA ZPPtr2 K.Time >STYA ZPPtr2
>MLICALL MLIGETTIME >MLICALL MLIGETTIME
>LDYAI DATELO >LDYAI DATELO
>STYA ZPPtr1 >STYA ZPPtr1
@ -376,8 +376,11 @@ K.CTime.Century .BS 1
K.CTime.Year .BS 1 K.CTime.Year .BS 1
*/-------------------------------------- */--------------------------------------
* # StrFTime * # StrFTime
* ## C
* Convert S.TIME struct to CSTR * Convert S.TIME struct to CSTR
* **In:** * `size_t strftime (char* ptr, size_t maxsize, const char* format, const struct tm* timeptr );`
* ## ASM
* **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