mirror of
https://github.com/A2osX/A2osX.git
synced 2025-04-04 18:32:56 +00:00
Kernel 0.9.2
This commit is contained in:
parent
bc9b641ebc
commit
bc5af2e958
381
.Docs/KERNEL.md
381
.Docs/KERNEL.md
@ -1,57 +1,57 @@
|
||||
*** 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
|
||||
|
||||
Search a file in the provided PATH list
|
||||
And return, if found, the full path to it.
|
||||
**In:**
|
||||
PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB
|
||||
PUSHW = Ptr to File Name (CSTR)
|
||||
PUSHW = Ptr to DstBuf
|
||||
PUSHW = Ptr to DstStat
|
||||
PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB
|
||||
PUSHW = Ptr to File Name (CSTR)
|
||||
PUSHW = Ptr to DstBuf
|
||||
PUSHW = Ptr to DstStat
|
||||
**Out:**
|
||||
CC : success
|
||||
DstBuf = FilePath
|
||||
DstStat = S.STAT
|
||||
CS : not found
|
||||
|
||||
CC : success
|
||||
DstBuf = FilePath
|
||||
DstStat = S.STAT
|
||||
CS : not found
|
||||
# GetDevByID.A
|
||||
|
||||
**In:**
|
||||
A = DevID
|
||||
**Out:**
|
||||
CC = OK, CS = ERROR
|
||||
Y,A = DEVSLOT
|
||||
note: X Unmodified
|
||||
|
||||
# GetDevByName.YA
|
||||
|
||||
**In:**
|
||||
Y,A = Ptr to device name (C-String)
|
||||
**Out:**
|
||||
CC = OK, CS = ERROR
|
||||
X = DEVID
|
||||
Y,A = DEVSLOT
|
||||
|
||||
# GetDevStatus.A
|
||||
|
||||
**In:**
|
||||
A = DevID
|
||||
**Out:**
|
||||
Y,A = S.DSTAT
|
||||
|
||||
# IOCTL
|
||||
|
||||
## C
|
||||
`int ioctl ( short int id, short int op, void *param);`
|
||||
|
||||
`int ioctl ( short int id, short int op, void *param);`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
`PUSHWI param`
|
||||
`lda #op`
|
||||
@ -59,8 +59,8 @@ note: X Unmodified
|
||||
`>SYSCALL IOCTL`
|
||||
**Out:**
|
||||
Y,A = ...
|
||||
|
||||
# OpenDir.YA
|
||||
|
||||
**In:**
|
||||
Y,A = PATH (C-String)
|
||||
**Out:**
|
||||
@ -68,8 +68,8 @@ note: X Unmodified
|
||||
A = hDIR
|
||||
CS : error
|
||||
A = EC
|
||||
|
||||
# ReadDir.A
|
||||
|
||||
**In:**
|
||||
A = hDIR
|
||||
**Out:**
|
||||
@ -79,52 +79,52 @@ note: X Unmodified
|
||||
CS : error
|
||||
A = EC
|
||||
note : A = 0 means no more entry
|
||||
|
||||
# CloseDir.A
|
||||
|
||||
**In:**
|
||||
A = hDIR
|
||||
**Out:**
|
||||
none, always succeed.
|
||||
|
||||
# ExpandStr.YA
|
||||
|
||||
**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
|
||||
|
||||
**In:**
|
||||
Y,A = PTR to String NAME=VALUE (C-String)
|
||||
**Out:**
|
||||
|
||||
# SetEnv
|
||||
|
||||
**In:**
|
||||
PUSHW = PTR To Value (PSTR)
|
||||
PUSHW = PTR To Name (PSTR)
|
||||
**Out:**
|
||||
|
||||
# GetEnv.YA
|
||||
|
||||
**In:**
|
||||
Y,A = PTR to NAME (PSTR)
|
||||
**Out:**
|
||||
CC : Y,A = PTR to VALUE (PSTR)
|
||||
CS : not found
|
||||
|
||||
# UnsetEnv.YA
|
||||
|
||||
**In:**
|
||||
Y,A = PTR To Name (PSTR)
|
||||
**Out:**
|
||||
|
||||
# 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
|
||||
|
||||
Load a file in memory
|
||||
**In:**
|
||||
PUSHW = AUXTYPE (Handled by....
|
||||
@ -134,57 +134,57 @@ Load a file in memory
|
||||
**Out:**
|
||||
Y,A = File Length
|
||||
X = hMem of Loaded File
|
||||
|
||||
# ChTyp
|
||||
|
||||
**In:**
|
||||
PUSHB = TYPE
|
||||
PUSHW = PATH
|
||||
|
||||
# ChMod
|
||||
|
||||
**In:**
|
||||
PUSHW = UID
|
||||
PUSHW = PATH
|
||||
|
||||
# ChOwn
|
||||
|
||||
**In:**
|
||||
PUSHW = UID
|
||||
PUSHW = PATH
|
||||
|
||||
# ChGrp
|
||||
|
||||
**In:**
|
||||
PUSHW = GID
|
||||
PUSHW = PATH
|
||||
|
||||
# FAdd,FSub,FMult,FDiv,FPwr
|
||||
|
||||
Return X+Y, X-Y, X*Y, X/Y, X^Y
|
||||
**In:**
|
||||
PUSHF = X (Float)
|
||||
PUSHF = Y (Float)
|
||||
**Out:**
|
||||
On stack (Float)
|
||||
|
||||
# Log,Sqr,Exp,Cos,Sin,Tan,ATan
|
||||
|
||||
Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
||||
**In:**
|
||||
PUSHF = X (Float)
|
||||
**Out:**
|
||||
On stack (Float)
|
||||
|
||||
# Float
|
||||
|
||||
Return 'floated' long
|
||||
**In:**
|
||||
PUSHL = X (long)
|
||||
**Out:**
|
||||
On stack (Float)
|
||||
|
||||
# LRIntF
|
||||
|
||||
Return Float rounded into a long
|
||||
**In:**
|
||||
PUSHF = X (Float)
|
||||
**Out:**
|
||||
On stack (long)
|
||||
|
||||
# GetMem0
|
||||
|
||||
**In:**
|
||||
Y,A = Size Requested
|
||||
**Out:**
|
||||
@ -193,8 +193,8 @@ Return Float rounded into a long
|
||||
* X = hMem
|
||||
CS :
|
||||
A = EC
|
||||
|
||||
# GetMem
|
||||
|
||||
**In:**
|
||||
Y,A = Size Requested
|
||||
**Out:**
|
||||
@ -203,29 +203,29 @@ Return Float rounded into a long
|
||||
* X = hMem
|
||||
CS :
|
||||
A = EC
|
||||
|
||||
# FreeMem
|
||||
|
||||
**In:**
|
||||
A = hMem To Free
|
||||
**Out:**
|
||||
none.
|
||||
(X,Y unmodified)
|
||||
|
||||
# GetMemPtr
|
||||
|
||||
**In:**
|
||||
A = hMem
|
||||
**Out:**
|
||||
Y,A = PTR to MemBlock
|
||||
(X unmodified)
|
||||
|
||||
# GetMemByID
|
||||
|
||||
**In:**
|
||||
A = hMem
|
||||
**Out:**
|
||||
Y,A = ZPMemMgrSPtr = PTR to S.MEM
|
||||
X unmodified
|
||||
|
||||
# NewStr
|
||||
|
||||
Create a new copy of this C-String
|
||||
**In:**
|
||||
Y,A = Ptr to source C-String
|
||||
@ -235,8 +235,8 @@ Create a new copy of this C-String
|
||||
X = hMem (PSTR)
|
||||
CS : error
|
||||
A = SYS error code
|
||||
|
||||
# SListGetByID
|
||||
|
||||
**In:**
|
||||
PUSHB = hSList
|
||||
PUSHW = KeyID
|
||||
@ -244,8 +244,8 @@ Create a new copy of this C-String
|
||||
PUSHW = Key Ptr
|
||||
**Out:**
|
||||
X,Y = Next KeyID
|
||||
|
||||
# SListUpdateByID
|
||||
|
||||
**In:**
|
||||
PUSHB = hSList
|
||||
PUSHW = KeyID
|
||||
@ -253,8 +253,8 @@ Create a new copy of this C-String
|
||||
**Out:**
|
||||
A = Key Length
|
||||
X,Y = KeyID
|
||||
|
||||
# SListAdd
|
||||
|
||||
**In:**
|
||||
PUSHB = hSList
|
||||
PUSHW = Key Ptr
|
||||
@ -262,8 +262,8 @@ Create a new copy of this C-String
|
||||
**Out:**
|
||||
A = Key Length
|
||||
X,Y = KeyID
|
||||
|
||||
# SListLookup
|
||||
|
||||
**In:**
|
||||
PUSHB = hSList
|
||||
PUSHW = Key Ptr
|
||||
@ -271,25 +271,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
|
||||
|
||||
**In:**
|
||||
A = hObject (AUX Memory)
|
||||
Y = Property Index
|
||||
**Out:**
|
||||
Y,A = Property Value
|
||||
|
||||
# NewStkObj
|
||||
|
||||
**In:**
|
||||
Y,A = Size Requested
|
||||
**Out:**
|
||||
@ -298,15 +298,15 @@ Create a new copy of this C-String
|
||||
* X = hMem
|
||||
CS :
|
||||
A = EC
|
||||
|
||||
# FreeStkObj
|
||||
|
||||
**In:**
|
||||
A = hMem To Free (AUX Memory)
|
||||
**Out:**
|
||||
none.
|
||||
(X,Y unmodified)
|
||||
|
||||
# LoadStkObj
|
||||
|
||||
Load a file in AUX memory (Stock Objects)
|
||||
**In:**
|
||||
PUSHW = AUXTYPE (Handled by....
|
||||
@ -316,7 +316,6 @@ 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)
|
||||
@ -324,188 +323,197 @@ 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
|
||||
|
||||
**In:**
|
||||
Y,A = Ptr to 24 bytes buffer
|
||||
**Out:**
|
||||
Buffer filled with memory stats
|
||||
|
||||
# GetPSStatus.A
|
||||
|
||||
**In:**
|
||||
A = PID
|
||||
**Out:**
|
||||
A = Status Byte
|
||||
|
||||
# GetPSStat.YA
|
||||
|
||||
**In:**
|
||||
Y,A = Ptr to 24 bytes buffer
|
||||
**Out:**
|
||||
Buffer filled with PS stats
|
||||
|
||||
# Stat
|
||||
Return information about a file
|
||||
|
||||
Return information about a file
|
||||
## In :
|
||||
|
||||
PUSHW = PTR to S.STAT buffer
|
||||
PUSHW = PTR to Filename (C-String)
|
||||
|
||||
## Out :
|
||||
|
||||
# MKDir.YA
|
||||
|
||||
**In:**
|
||||
Y,A = DIR name
|
||||
**Out:**
|
||||
CC : success
|
||||
CS : error
|
||||
A = EC
|
||||
|
||||
# MkNod.YA
|
||||
|
||||
return a hFile for a given Device Name
|
||||
**In:**
|
||||
Y,A=DevName
|
||||
**Out:**
|
||||
CC = OK, CS = ERROR
|
||||
A = hFILE
|
||||
|
||||
# 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
|
||||
**In:**
|
||||
Y : character
|
||||
A : stream
|
||||
**Out:**
|
||||
CC = success
|
||||
|
||||
**In:**
|
||||
Y : character
|
||||
A : stream
|
||||
**Out:**
|
||||
CC = success
|
||||
# PutChar
|
||||
|
||||
## C
|
||||
`int putchar ( int character );`
|
||||
|
||||
`int putchar ( int character );`
|
||||
## ASM
|
||||
|
||||
Print A (char) to StdOut
|
||||
**In:**
|
||||
A : char to print
|
||||
A : char to print
|
||||
**Out:**
|
||||
CC = success
|
||||
|
||||
CC = success
|
||||
# PutS
|
||||
int puts ( const char * str );
|
||||
|
||||
Write Str to StdOut, appends '\r\n'
|
||||
**In:**
|
||||
Y,A : CPtr
|
||||
**Out:**
|
||||
CC = success
|
||||
## C
|
||||
|
||||
`int puts ( const char * str );`
|
||||
**In:**
|
||||
Y,A : CPtr
|
||||
**Out:**
|
||||
CC = success
|
||||
# FPutS
|
||||
int fputs ( const char * str, hFILE stream );
|
||||
|
||||
Write Str to FILE
|
||||
## C
|
||||
|
||||
`int fputs ( const char * str, hFILE stream );`
|
||||
**In:**
|
||||
PUSHB : hFILE
|
||||
Y,A: str
|
||||
PUSHB : hFILE
|
||||
Y,A: str
|
||||
**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
|
||||
## C
|
||||
|
||||
`int printf ( const char * format, ... );`
|
||||
`int sprintf ( char * str, const char * format, ... );`
|
||||
`int fprintf ( FILE * stream, const char * format, ... );`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
PrintF :
|
||||
PUSH ...
|
||||
Y,A = PTR to CStr
|
||||
PUSH ...
|
||||
Y,A = PTR to CStr
|
||||
SPrintF :
|
||||
PUSH ...
|
||||
PUSHW = PTR to CStr
|
||||
Y,A = Ptr to Dst Buffer
|
||||
PUSH ...
|
||||
PUSHW = PTR to CStr
|
||||
Y,A = Ptr to Dst Buffer
|
||||
FPrintF :
|
||||
PUSH ...
|
||||
PUSHW = PTR to CStr
|
||||
A = hFILE
|
||||
*
|
||||
PUSH ...
|
||||
PUSHW = PTR to CStr
|
||||
A = hFILE
|
||||
**Out:**
|
||||
CC : success
|
||||
CS : error code from Output
|
||||
CC : success
|
||||
CS : error code from Output
|
||||
Specifiers :
|
||||
%b : pull 1 byte to Print BIN
|
||||
%B : pull 2 bytes to Print BIN
|
||||
%d : pull 1 byte unsigned DEC 0..255
|
||||
%D : pull 2 bytes unsigned DEC 0..65535
|
||||
%u : pull 4 bytes long unsigned DEC 0..4294967295
|
||||
%e : pull 5 Bytes float (-)1.23456789e+12
|
||||
%f : pull 5 Bytes float (-)3.1415
|
||||
%h : pull 1 byte to Print HEX
|
||||
%H : pull 2 bytes to Print HEX
|
||||
%i : pull 1 byte to Print signed DEC -128..127
|
||||
%I : pull 2 bytes to Print signed DEC -32768..32767
|
||||
%L : pull 4 bytes signed DEC -2147483648..2147483647
|
||||
%n : pull 1 byte to Print low Nibble HEX
|
||||
%N : pull 1 byte to Print high Nibble HEX
|
||||
%s : pull 2 bytes ptr to C-Style String
|
||||
%S : pull 2 bytes ptr to P-Style String
|
||||
\b : Print 'BS' (08)
|
||||
\e : Print 'ESC' ($1B,27)
|
||||
\f : Print 'FF' ($0C,12)
|
||||
\n : Print 'LF' ($0A,10)
|
||||
\r : Print 'CR' ($0D,13)
|
||||
\\\\ : Print \
|
||||
\% : Print %
|
||||
+ %b : pull 1 byte to Print BIN
|
||||
+ %B : pull 2 bytes to Print BIN
|
||||
+ %d : pull 1 byte unsigned DEC 0..255
|
||||
+ %D : pull 2 bytes unsigned DEC 0..65535
|
||||
+ %u : pull 4 bytes long unsigned DEC 0..4294967295
|
||||
+ %e : pull 5 Bytes float (-)1.23456789e+12
|
||||
+ %f : pull 5 Bytes float (-)3.1415
|
||||
+ %h : pull 1 byte to Print HEX
|
||||
+ %H : pull 2 bytes to Print HEX
|
||||
+ %i : pull 1 byte to Print signed DEC -128..127
|
||||
+ %I : pull 2 bytes to Print signed DEC -32768..32767
|
||||
+ %L : pull 4 bytes signed DEC -2147483648..2147483647
|
||||
+ %n : pull 1 byte to Print low Nibble HEX
|
||||
+ %N : pull 1 byte to Print high Nibble HEX
|
||||
+ %s : pull 2 bytes ptr to C-Style String
|
||||
+ %S : pull 2 bytes ptr to P-Style String
|
||||
+ \b : Print 'BS' (08)
|
||||
+ \e : Print 'ESC' ($1B,27)
|
||||
+ \f : Print 'FF' ($0C,12)
|
||||
+ \n : Print 'LF' ($0A,10)
|
||||
+ \r : Print 'CR' ($0D,13)
|
||||
+ \\\\ : Print \
|
||||
+ \\% : Print %
|
||||
|
||||
Modifiers for len and padding :
|
||||
%d : '9' '12'
|
||||
%2d : ' 9' '12'
|
||||
%02d : '09' '12'
|
||||
%11s : 'ABCDEFGH '
|
||||
%011s : 'ABCDEFGH000'
|
||||
%2f : '3.14'
|
||||
+ %d : '9' '12'
|
||||
+ %2d : ' 9' '12'
|
||||
+ %02d : '09' '12'
|
||||
+ %11s : 'ABCDEFGH '
|
||||
+ %011s : 'ABCDEFGH000'
|
||||
+ %2f : '3.14'
|
||||
|
||||
# GetChar
|
||||
|
||||
Get char from StdIn
|
||||
**In:**
|
||||
none.
|
||||
**Out:**
|
||||
CC = success
|
||||
A = char
|
||||
# GetC
|
||||
|
||||
# GetC.A
|
||||
Get char from Node
|
||||
## C
|
||||
|
||||
`int getc ( FILE * stream );`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
A = hNODE
|
||||
**Out:**
|
||||
CC = success
|
||||
A = char
|
||||
|
||||
# SScanF
|
||||
|
||||
Read formatted data from string
|
||||
|
||||
## C
|
||||
`int sscanf ( const char * s, const char * format, ...);`
|
||||
|
||||
`int sscanf ( const char * s, const char * format, ...);`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
`>PUSHBI Argument Byte count`
|
||||
`>PUSHWI format`
|
||||
ex: "%d.%d.%d.%d"
|
||||
+ %i : short int
|
||||
+ %d : byte
|
||||
+ %I : int
|
||||
@ -514,14 +522,15 @@ Read formatted data from string
|
||||
+ %U : dword
|
||||
+ %h : HEX byte
|
||||
+ %H : HEX word
|
||||
|
||||
`>LDYA s`
|
||||
**Out:**
|
||||
Y,A = Number of arguments filled.
|
||||
|
||||
# FOpen
|
||||
Open a file
|
||||
|
||||
Open a file
|
||||
## In :
|
||||
|
||||
PUSHW = AUXTYPE
|
||||
PUSHB = TYPE
|
||||
PUSHB = MODE
|
||||
@ -531,54 +540,54 @@ Open a file
|
||||
SYS.FOpen.T : Open/Append in Text mode
|
||||
SYS.FOpen.X : Create if not exists
|
||||
PUSHW = PATH (PSTR)
|
||||
|
||||
## Out :
|
||||
|
||||
CC : A = hFILE
|
||||
CS : A = EC
|
||||
|
||||
# FClose.A
|
||||
|
||||
Close a file
|
||||
|
||||
## In :
|
||||
A = hFILE
|
||||
|
||||
A = hFILE
|
||||
## Out :
|
||||
|
||||
# FRead
|
||||
|
||||
int fread ( void * ptr, int count, FILE * stream );
|
||||
Read bytes from file
|
||||
|
||||
## In :
|
||||
|
||||
PUSHW = Dest Ptr
|
||||
PUSHW = Bytes To Read
|
||||
PUSHB = hFILE
|
||||
|
||||
## Out :
|
||||
Y,A = Bytes Read
|
||||
|
||||
Y,A = Bytes Read
|
||||
# FWrite
|
||||
|
||||
int fwrite ( const void * ptr, int count, FILE * stream );
|
||||
Write bytes to file
|
||||
**In:**
|
||||
PUSHW = Src Ptr
|
||||
PUSHW = Bytes To Write
|
||||
PUSHB = hFILE
|
||||
|
||||
# Out:
|
||||
Y,A = Bytes Written
|
||||
|
||||
Y,A = Bytes Written
|
||||
# FFlush.A
|
||||
|
||||
**In:**
|
||||
A = hFILE
|
||||
|
||||
# FSeek
|
||||
|
||||
Set the file-position indicator for hFILE
|
||||
**In:**
|
||||
PUSHW = Ptr to Offset (DWORD)
|
||||
PUSHB = From
|
||||
PUSHB = hFILE
|
||||
|
||||
# FEOF.A
|
||||
|
||||
Test the end-of-file indicator for hFILE
|
||||
**In:**
|
||||
A = hFILE
|
||||
@ -587,135 +596,135 @@ Test the end-of-file indicator for hFILE
|
||||
A=0 EOF
|
||||
A =0 NOT EOF
|
||||
CS :
|
||||
|
||||
# FTell
|
||||
|
||||
Return the current value of the file-position indicator
|
||||
**In:**
|
||||
PUSHW = Ptr to Offset (DWORD)
|
||||
PUSHB = hFILE
|
||||
**Out:**
|
||||
Offset = Offset
|
||||
|
||||
# Remove.YA
|
||||
|
||||
# Rename
|
||||
Rename a file
|
||||
|
||||
Rename a file
|
||||
## In :
|
||||
|
||||
PUSHW = New Name
|
||||
PUSHW = Old Name
|
||||
|
||||
## Out :
|
||||
|
||||
# StrToF
|
||||
|
||||
Convert String to 40 bits Float
|
||||
|
||||
## C
|
||||
`float strtof (const char* str, char** endptr);`
|
||||
|
||||
`float strtof (const char* str, char** endptr);`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
`>PUSHWI EndPtr`
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
On stack (float)
|
||||
|
||||
# AToF
|
||||
|
||||
Convert String to 40 bits Float
|
||||
|
||||
## C
|
||||
`float atof (const char* str);`
|
||||
|
||||
`float atof (const char* str);`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
On stack (float)
|
||||
|
||||
# StrToL/StrToUL
|
||||
Convert String to 32 bits (unsigned) int
|
||||
|
||||
Convert String to 32 bits (unsigned) int
|
||||
## C
|
||||
|
||||
`long strtol (const char* str, char** endptr, int base);`
|
||||
`unsigned long strtoul (const char* str, char** endptr, int base);`
|
||||
|
||||
## 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 );`
|
||||
|
||||
`long atol ( const char * str );`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
On stack (long)
|
||||
|
||||
# AToI.YA
|
||||
|
||||
## C
|
||||
`int atoi ( const char * str );`
|
||||
|
||||
`int atoi ( const char * str );`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
Y,A = Int
|
||||
|
||||
# RealPath.YA
|
||||
|
||||
Return the canonicalized absolute pathname
|
||||
|
||||
## In :
|
||||
Y,A = Ptr to Relative Filename (C-String)
|
||||
|
||||
Y,A = Ptr to Relative Filename (C-String)
|
||||
## Out :
|
||||
|
||||
CC : success
|
||||
Y,A = Ptr to Full Path (C-String)
|
||||
X = hMem of Full Path
|
||||
CS : A = Error Code
|
||||
|
||||
# StrLen
|
||||
|
||||
Returns Length of C-String
|
||||
|
||||
## C
|
||||
`char * strcat ( char * destination, const char * source );`
|
||||
|
||||
`char * strcat ( char * destination, const char * source );`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
Y,A = Ptr to CSTR
|
||||
**Out:**
|
||||
Y,A = String length
|
||||
|
||||
# StrCat
|
||||
|
||||
Append SRC to DST
|
||||
**In:**
|
||||
PUSHW = Ptr to SRC (CSTR)
|
||||
PUSHW = Ptr to DST (CSTR)
|
||||
**Out:**
|
||||
DST = DST+SRC
|
||||
|
||||
# StrCpy
|
||||
|
||||
Copy string
|
||||
|
||||
## C
|
||||
`char * strcpy ( char * destination, const char * source );`
|
||||
|
||||
`char * strcpy ( char * destination, const char * source );`
|
||||
## ASM
|
||||
|
||||
**In:**
|
||||
PUSHW = Ptr to SRC (CSTR)
|
||||
PUSHW = Ptr to DST (CSTR)
|
||||
**Out:**
|
||||
DST = SRC
|
||||
|
||||
# StrMatch
|
||||
|
||||
Compare a String against pattern
|
||||
**In:**
|
||||
PUSHW = PTR to Pattern (e.g. '*test?.txt')
|
||||
@ -723,23 +732,23 @@ Compare a String against pattern
|
||||
**Out:**
|
||||
CC : match
|
||||
CS : no match
|
||||
|
||||
# StrUpr/StrLwr
|
||||
|
||||
Convert string to UPPERCASE/lowercase
|
||||
**In:**
|
||||
Y,A = PTR to String (CSTR)
|
||||
**Out:**
|
||||
Uppercased/lowercased String in Buffer
|
||||
|
||||
# StrCmp
|
||||
|
||||
Compare 2 strings
|
||||
**In:**
|
||||
PUSHW = Ptr to String1 (CSTR)
|
||||
PUSHW = Ptr to String2 (CSTR)
|
||||
**Out:**
|
||||
DST = SRC
|
||||
|
||||
# StrICmp
|
||||
|
||||
Compare 2 strings
|
||||
**In:**
|
||||
PUSHW = Ptr to String1 (CSTR)
|
||||
@ -747,37 +756,37 @@ Compare 2 strings
|
||||
**Out:**
|
||||
CC, Y,A=0
|
||||
CS, Y,A > 0 or < 0
|
||||
|
||||
# Time
|
||||
|
||||
Get System Time in Buffer
|
||||
|
||||
## In :
|
||||
|
||||
Y,A = PTR to S.TIME
|
||||
|
||||
## Out :
|
||||
|
||||
S.TIME filled with System date/time
|
||||
|
||||
# PTime2Time
|
||||
Convert ProDOS Time To S.TIME
|
||||
|
||||
Convert ProDOS Time To S.TIME
|
||||
## In :
|
||||
|
||||
PUSHW = Dst PTR To S.TIME
|
||||
PUSHW = Src PTR to ProDOS DATE/TIME (DWORD)
|
||||
|
||||
# CTime2Time
|
||||
Convert CTIME to S.TIME
|
||||
|
||||
Convert CTIME to S.TIME
|
||||
## 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
|
||||
|
||||
**In:**
|
||||
PUSHW = Dst PTR To CSTR Buf
|
||||
PUSHW = Src PTR To Format String
|
||||
|
@ -1,20 +1,20 @@
|
||||
*** Auto generated by docgen.cmd ***
|
||||
|
||||
# GetProDOSCatSize
|
||||
Compute space needed for ProDOS Catalog
|
||||
|
||||
Compute space needed for ProDOS Catalog
|
||||
## In :
|
||||
|
||||
PUSHW = DevSize (in 512b blocks)
|
||||
PUSHB = Catalog Size (in blocks)
|
||||
PUSHB = Options
|
||||
|
||||
## Out :
|
||||
|
||||
X=BlockCount (max 22)
|
||||
Y,A=BufSize (max $4400)
|
||||
|
||||
# BuildProDOSCat
|
||||
|
||||
## In :
|
||||
|
||||
PUSHW = DevSize (in 512b blocks)
|
||||
PUSHB = Catalog Size (in blocks)
|
||||
PUSHB = Options
|
||||
@ -28,8 +28,8 @@
|
||||
absolute MAX DstBuf size=
|
||||
7 for Disk II(280blk),3.5(1600),3.5HD(2880)
|
||||
22 for 32mb Hardisk...
|
||||
|
||||
# TrkW16s
|
||||
|
||||
Write a track (16 sectors)
|
||||
**In:**
|
||||
PUSHW = Ptr to 16*256 buffer
|
||||
@ -39,8 +39,8 @@ Write a track (16 sectors)
|
||||
CC : success
|
||||
CS : A = Error
|
||||
A=0, currently starting/seeking...
|
||||
|
||||
# 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);`
|
||||
|
||||
`void md5 (const char* str, char* digest);`
|
||||
# ASM
|
||||
|
||||
**In:**
|
||||
`>PUSHW digest`
|
||||
`>LDYA str`
|
||||
**Out:**
|
||||
CC
|
||||
|
||||
## MD5Init
|
||||
|
||||
Initialize a MD5 computation
|
||||
|
||||
# C
|
||||
`HANDLE md5init ();`
|
||||
|
||||
`HANDLE md5init ();`
|
||||
# ASM
|
||||
|
||||
**In:**
|
||||
**Out:**
|
||||
A = hMem To S.MD5
|
||||
|
||||
## MD5Update
|
||||
|
||||
Add Data to MD5 computation
|
||||
|
||||
# C
|
||||
`int md5update (HANDLE md5, char* data, int len);`
|
||||
|
||||
`int md5update (HANDLE md5, char* data, int len);`
|
||||
# ASM
|
||||
|
||||
**In:**
|
||||
`>PUSHW len`
|
||||
`>PUSHW data`
|
||||
`>LDA.G md5`
|
||||
**Out:**
|
||||
|
||||
## MD5Finalize
|
||||
|
||||
# C
|
||||
`int md5finalize (HANDLE md5, char* digest);`
|
||||
|
||||
`int md5finalize (HANDLE md5, char* digest);`
|
||||
# ASM
|
||||
|
||||
**In:**
|
||||
`>PUSHW digest`
|
||||
`>LDA.G md5`
|
||||
|
@ -1,13 +1,13 @@
|
||||
*** Auto generated by docgen.cmd ***
|
||||
|
||||
# ARP.Clear
|
||||
Clear ARP Cache
|
||||
|
||||
Clear ARP Cache
|
||||
## In :
|
||||
|
||||
## Out :
|
||||
|
||||
# ARP.Query
|
||||
|
||||
Query ARP Cache and returns HW address
|
||||
**In:**
|
||||
PUSHW PTR to MAC (to fill)
|
||||
@ -15,27 +15,27 @@
|
||||
**Out:**
|
||||
CC: hit: MAC filled
|
||||
CS: missed
|
||||
|
||||
# ARP.Add
|
||||
|
||||
Add a static ARP cache record
|
||||
**In:**
|
||||
PUSHW PTR to MAC
|
||||
PUSHW PTR to IP
|
||||
|
||||
# ARP.GetCAche
|
||||
|
||||
Return a Ptr to ARP Cache Table
|
||||
**In:**
|
||||
**Out:**
|
||||
Y,A = PTR to ARP.CACHE
|
||||
|
||||
# DNS.Clear
|
||||
Clear DNS Cache
|
||||
|
||||
Clear DNS Cache
|
||||
## In :
|
||||
|
||||
## Out :
|
||||
|
||||
# DNS.Query
|
||||
|
||||
Query DNS for specified host
|
||||
**In:**
|
||||
PUSHW = PTR to IP to fill with cached data
|
||||
@ -43,135 +43,135 @@
|
||||
**Out:**
|
||||
CC: hit: IP filled with address
|
||||
CS: missed
|
||||
|
||||
# DNS.Add
|
||||
|
||||
Add a static DNS record
|
||||
**In:**
|
||||
PUSHW = PTR to IP
|
||||
PUSHW = hostname CSTR to Add
|
||||
|
||||
# DNS.GetCAche
|
||||
|
||||
Return a Ptr to DNS Cache Table
|
||||
**In:**
|
||||
**Out:**
|
||||
Y,A = PTR to DNS.CACHE
|
||||
|
||||
# SKT.New
|
||||
|
||||
Create a new socket
|
||||
|
||||
## In :
|
||||
PUSHW = PTR to S.SOCKET template
|
||||
|
||||
PUSHW = PTR to S.SOCKET template
|
||||
## Out :
|
||||
|
||||
YA = PTR to new S.SOCKET
|
||||
X = hSocket
|
||||
|
||||
# SKT.CloseA
|
||||
|
||||
Close socket
|
||||
|
||||
## In :
|
||||
A = hSocket
|
||||
|
||||
A = hSocket
|
||||
## Out :
|
||||
|
||||
# SKT.GetA
|
||||
|
||||
Get Ptr to socket
|
||||
|
||||
## In :
|
||||
|
||||
A = hSocket
|
||||
|
||||
## Out :
|
||||
Y,A = pS.SOCKET
|
||||
|
||||
Y,A = pS.SOCKET
|
||||
# SKT.GetTable
|
||||
|
||||
Get socket table
|
||||
|
||||
## In :
|
||||
|
||||
## Out :
|
||||
|
||||
Y,A = pS.SOCKET
|
||||
|
||||
# SKT.AcceptA
|
||||
|
||||
Check for an incoming connection
|
||||
|
||||
## In :
|
||||
|
||||
A = hListeningSocket
|
||||
|
||||
## Out :
|
||||
A = hSocket
|
||||
|
||||
A = hSocket
|
||||
# SKT.MkNodA
|
||||
|
||||
Create a new file from TCP socket
|
||||
|
||||
## In :
|
||||
|
||||
A = hSocket
|
||||
|
||||
## Out :
|
||||
|
||||
A = hFile
|
||||
|
||||
# SKT.Write (DGRAM,STREAM,RAW)
|
||||
Send block of data
|
||||
|
||||
Send block of data
|
||||
## In :
|
||||
|
||||
PUSHB = hSocket
|
||||
PUSHW = pBuf
|
||||
PUSHW = len
|
||||
|
||||
## Out :
|
||||
|
||||
# SKT.ReadA (DGRAM,RAW)
|
||||
|
||||
## In :
|
||||
|
||||
A = hSocket
|
||||
|
||||
## Out :
|
||||
|
||||
A = hFrame
|
||||
|
||||
# SKT.PutC (STREAM)
|
||||
Write a Char To Stream
|
||||
|
||||
Write a Char To Stream
|
||||
## In :
|
||||
|
||||
PUSHB = hSocket
|
||||
PUSHB = Char
|
||||
|
||||
## Out :
|
||||
|
||||
# SKT.PutS (STREAM)
|
||||
Write Line in pBuf
|
||||
|
||||
Write Line in pBuf
|
||||
## In :
|
||||
|
||||
PUSHB = hSocket
|
||||
PUSHW = PSTR
|
||||
|
||||
## Out :
|
||||
|
||||
# SKT.GetC.A (STREAM)
|
||||
|
||||
Read a Char From Stream in A
|
||||
|
||||
## In :
|
||||
|
||||
A = hSocket
|
||||
|
||||
## Out :
|
||||
|
||||
A = char
|
||||
|
||||
# SKT.GetS (STREAM)
|
||||
|
||||
Read a CR terminated Line in pBuf
|
||||
|
||||
## In :
|
||||
|
||||
PUSHB = hSocket
|
||||
PUSHW = pBuf
|
||||
PUSHW = len
|
||||
|
||||
## Out :
|
||||
|
||||
Y,A = bytes read
|
||||
|
||||
# SKT.Read (STREAM)
|
||||
Read data in pBuf
|
||||
|
||||
Read data in pBuf
|
||||
## In :
|
||||
|
||||
PUSHB = hSocket
|
||||
PUSHW = pBuf
|
||||
PUSHW = len
|
||||
|
||||
## Out :
|
||||
|
||||
Y,A = bytes transfered
|
||||
|
Binary file not shown.
Binary file not shown.
@ -70,11 +70,17 @@ for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do (
|
||||
)
|
||||
if !bInDoc! 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,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!
|
||||
if "!line:~0,1!" EQU "#" echo.>>!DOCFILE!
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -299,7 +299,7 @@ CS.QUIT ldy #hFrame
|
||||
|
||||
.1 ldy #hSocket
|
||||
lda (pData),y
|
||||
|
||||
>DEBUG
|
||||
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.CLOSEA
|
||||
|
||||
lda hLIBTCPIP
|
||||
|
127
INC/A2osX.I.txt
127
INC/A2osX.I.txt
@ -70,27 +70,27 @@ A2osX.S.DISABLE .EQ $FF
|
||||
* .EQ $00
|
||||
* .EQ $02
|
||||
SYS.Stat .EQ $04
|
||||
SYS.MKDir.YA .EQ $06
|
||||
SYS.MKNod.YA .EQ $08
|
||||
SYS.MKDir .EQ $06
|
||||
SYS.MKNod .EQ $08
|
||||
SYS.MKFIFO .EQ $0A
|
||||
* .EQ $0C
|
||||
* .EQ $0E
|
||||
|
||||
SYS.OpenDir.YA .EQ $10
|
||||
SYS.ReadDir.A .EQ $12
|
||||
SYS.CloseDir.A .EQ $14
|
||||
SYS.OpenDir .EQ $10
|
||||
SYS.ReadDir .EQ $12
|
||||
SYS.CloseDir .EQ $14
|
||||
* .EQ $16
|
||||
* .EQ $18
|
||||
* .EQ $1A
|
||||
* .EQ $1C
|
||||
* .EQ $1E
|
||||
|
||||
SYS.FPutC.AY .EQ $20
|
||||
SYS.PutChar.A .EQ $22
|
||||
SYS.GetC.A .EQ $24
|
||||
SYS.FPutC .EQ $20
|
||||
SYS.PutChar .EQ $22
|
||||
SYS.GetC .EQ $24
|
||||
SYS.GetChar .EQ $26
|
||||
SYS.FPutS .EQ $28
|
||||
SYS.PutS.YA .EQ $2A
|
||||
SYS.PutS .EQ $2A
|
||||
* .EQ $2C
|
||||
* .EQ $2E
|
||||
|
||||
@ -100,7 +100,7 @@ SYS.FOpen.W .EQ $02 Open For Write
|
||||
SYS.FOpen.A .EQ $04 Append
|
||||
SYS.FOpen.T .EQ $08 Open/Append in Text mode
|
||||
SYS.FOpen.X .EQ $80 Create if not exists
|
||||
SYS.FClose.A .EQ $32
|
||||
SYS.FClose .EQ $32
|
||||
SYS.FRead .EQ $34
|
||||
SYS.FWrite .EQ $36
|
||||
SYS.FFlush .EQ $38
|
||||
@ -111,29 +111,29 @@ SYS.FSeek.END .EQ $02
|
||||
SYS.FTell .EQ $3C
|
||||
SYS.FEOF .EQ $3E
|
||||
|
||||
SYS.Remove.YA .EQ $40
|
||||
SYS.Remove .EQ $40
|
||||
SYS.Rename .EQ $42
|
||||
* .EQ $44
|
||||
* .EQ $46
|
||||
|
||||
SYS.GetDevByID.A .EQ $48
|
||||
SYS.GetDevByName.YA .EQ $4A
|
||||
SYS.GetDevStatus.A .EQ $4C
|
||||
SYS.GetDevByID .EQ $48
|
||||
SYS.GetDevByName .EQ $4A
|
||||
SYS.GetDevStatus .EQ $4C
|
||||
SYS.IOCTL .EQ $4E
|
||||
|
||||
* .EQ $50
|
||||
SYS.SScanF.YA .EQ $52
|
||||
SYS.SScanF .EQ $52
|
||||
* .EQ $54
|
||||
* .EQ $56
|
||||
SYS.PrintF.YA .EQ $58
|
||||
SYS.SPrintF.YA .EQ $5A
|
||||
SYS.FPrintF.A .EQ $5C
|
||||
SYS.PrintF .EQ $58
|
||||
SYS.SPrintF .EQ $5A
|
||||
SYS.FPrintF .EQ $5C
|
||||
* .EQ $5E
|
||||
|
||||
* .EQ $60
|
||||
* .EQ $62
|
||||
SYS.LoadFile .EQ $64
|
||||
SYS.LoadTxtFile.YA .EQ $66
|
||||
SYS.LoadTxtFile .EQ $66
|
||||
|
||||
SYS.ChTyp .EQ $68
|
||||
SYS.ChMod .EQ $6A
|
||||
@ -141,51 +141,51 @@ SYS.ChOwn .EQ $6C
|
||||
SYS.ChGrp .EQ $6E
|
||||
|
||||
SYS.AToF .EQ $70
|
||||
SYS.AToI.YA .EQ $72
|
||||
SYS.AToI .EQ $72
|
||||
SYS.AToL .EQ $74
|
||||
SYS.StrToF .EQ $76
|
||||
SYS.StrToL .EQ $78
|
||||
* .EQ $7A
|
||||
SYS.RealPath.YA .EQ $7C
|
||||
SYS.RealPath .EQ $7C
|
||||
* .EQ $7E
|
||||
*--------------------------------------
|
||||
SYS.StrLen.YA .EQ $80
|
||||
SYS.StrLen .EQ $80
|
||||
SYS.StrCpy .EQ $82
|
||||
SYS.StrCat .EQ $84
|
||||
SYS.StrMatch .EQ $86
|
||||
SYS.StrUpr.YA .EQ $88
|
||||
SYS.StrLwr.YA .EQ $8A
|
||||
SYS.StrUpr .EQ $88
|
||||
SYS.StrLwr .EQ $8A
|
||||
SYS.StrCmp .EQ $8C
|
||||
SYS.StrICmp .EQ $8E
|
||||
|
||||
SYS.Time.YA .EQ $90
|
||||
SYS.Time .EQ $90
|
||||
SYS.CTime2Time .EQ $92
|
||||
SYS.PTime2Time .EQ $94
|
||||
SYS.StrFTime .EQ $96
|
||||
|
||||
SYS.LoadLib.YA .EQ $98
|
||||
SYS.UnloadLib.A .EQ $9A
|
||||
SYS.LoadDrv.YA .EQ $9C
|
||||
SYS.LoadLib .EQ $98
|
||||
SYS.UnloadLib .EQ $9A
|
||||
SYS.LoadDrv .EQ $9C
|
||||
SYS.FileSearch .EQ $9E
|
||||
*--------------------------------------
|
||||
SYS.ExecPSNewEnv.YA .EQ $A0
|
||||
SYS.ExecPS.YA .EQ $A2
|
||||
SYS.CreatePSNewEnv.YA .EQ $A4
|
||||
SYS.CreatePS.YA .EQ $A6
|
||||
SYS.ExecPSNewEnv .EQ $A0
|
||||
SYS.ExecPS .EQ $A2
|
||||
SYS.CreatePSNewEnv .EQ $A4
|
||||
SYS.CreatePS .EQ $A6
|
||||
* .EQ $A8
|
||||
SYS.GetMemStat.YA .EQ $AA
|
||||
SYS.GetPSStatus.A .EQ $AC
|
||||
SYS.GetPSStat.YA .EQ $AE
|
||||
SYS.GetMemStat .EQ $AA
|
||||
SYS.GetPSStatus .EQ $AC
|
||||
SYS.GetPSStat .EQ $AE
|
||||
|
||||
* .EQ $B0
|
||||
SYS.GetArg.A .EQ $B2
|
||||
SYS.ExpandStr.YA .EQ $B4
|
||||
SYS.GetArg .EQ $B2
|
||||
SYS.ExpandStr .EQ $B4
|
||||
* .EQ $B6
|
||||
|
||||
SYS.PutEnv.YA .EQ $B8
|
||||
SYS.PutEnv .EQ $B8
|
||||
SYS.SetEnv .EQ $BA
|
||||
SYS.GetEnv.YA .EQ $BC
|
||||
SYS.UnsetEnv.YA .EQ $BE
|
||||
SYS.GetEnv .EQ $BC
|
||||
SYS.UnsetEnv .EQ $BE
|
||||
*--------------------------------------
|
||||
SYS.FAdd .EQ $C0
|
||||
SYS.FSub .EQ $C2
|
||||
@ -207,14 +207,14 @@ SYS.Tan .EQ $DA
|
||||
SYS.ATan .EQ $DC
|
||||
* .EQ $DF
|
||||
*--------------------------------------
|
||||
SYS.GetStkObjProperty.AY .EQ $E0
|
||||
SYS.FreeMem.A .EQ $E2
|
||||
SYS.GetMemPtr.A .EQ $E4
|
||||
SYS.GetMemByID.A .EQ $E6
|
||||
SYS.GetStkObjProp .EQ $E0
|
||||
SYS.FreeMem .EQ $E2
|
||||
SYS.GetMemPtr .EQ $E4
|
||||
SYS.GetMemByID .EQ $E6
|
||||
|
||||
SYS.GetMem.YA .EQ $E8
|
||||
SYS.GetMem0.YA .EQ $EA
|
||||
SYS.NewStr.YA .EQ $EC
|
||||
SYS.GetMem .EQ $E8
|
||||
SYS.GetMem0 .EQ $EA
|
||||
SYS.NewStr .EQ $EC
|
||||
SYS.SListAdd .EQ $EE
|
||||
|
||||
SYS.SListLookup .EQ $F0
|
||||
@ -222,10 +222,10 @@ SYS.SListGetByID .EQ $F2
|
||||
SYS.SListUpdateByID .EQ $F4
|
||||
SYS.SListNew .EQ $F6
|
||||
|
||||
SYS.SListFree.A .EQ $F8
|
||||
SYS.SListFree .EQ $F8
|
||||
SYS.LoadStkObj .EQ $FA
|
||||
SYS.NewStkObj.YA .EQ $FC
|
||||
SYS.FreeStkObj.A .EQ $FE
|
||||
SYS.NewStkObj .EQ $FC
|
||||
SYS.FreeStkObj .EQ $FE
|
||||
*--------------------------------------
|
||||
SYS.Kernel.JMP .EQ $E000
|
||||
SYS.GuiOSD.JMP .EQ $E200
|
||||
@ -346,9 +346,6 @@ S.DEV.S.WENABL .EQ %00000100
|
||||
S.DEV.S.IRQ .EQ %00000010
|
||||
S.DEV.S.OPENED .EQ %00000001
|
||||
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.DEVID .EQ 7
|
||||
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 .EQ 16
|
||||
*----------- Smartport ----------------
|
||||
DEVMGR.STATUS .EQ 0
|
||||
DEVMGR.READBLOCK .EQ 2
|
||||
DEVMGR.WRITEBLOCK .EQ 4
|
||||
DEVMGR.FORMAT .EQ 6
|
||||
DEVMGR.CONTROL .EQ 8
|
||||
DEVMGR.INIT .EQ 10
|
||||
DEVMGR.OPEN .EQ 12
|
||||
DEVMGR.CLOSE .EQ 14
|
||||
DEVMGR.READ .EQ 16
|
||||
DEVMGR.WRITE .EQ 18
|
||||
DEVMGR.IRQ .EQ 20
|
||||
*--------------------------------------
|
||||
IOCTL.STATUS .EQ 0
|
||||
IOCTL.READBLOCK .EQ 2
|
||||
IOCTL.WRITEBLOCK .EQ 4
|
||||
IOCTL.FORMAT .EQ 6
|
||||
IOCTL.CONTROL .EQ 8
|
||||
IOCTL.INIT .EQ 10
|
||||
IOCTL.OPEN .EQ 12
|
||||
IOCTL.CLOSE .EQ 14
|
||||
IOCTL.READ .EQ 16
|
||||
IOCTL.WRITE .EQ 18
|
||||
IOCTL.IRQ .EQ 20
|
||||
*--------------------------------------
|
||||
S.DSTAT.S .EQ 0
|
||||
S.DSTAT.S.BLOCK .EQ %10000000
|
||||
|
@ -12,7 +12,7 @@ HST.GetByName >PULLW ZPPtrDNS
|
||||
tay
|
||||
lda ZPPtrIP+1
|
||||
adc #0
|
||||
>PUSHYA
|
||||
>PUSHYA @IP[3]
|
||||
|
||||
lda ZPPtrIP
|
||||
clc
|
||||
@ -20,20 +20,21 @@ HST.GetByName >PULLW ZPPtrDNS
|
||||
tay
|
||||
lda ZPPtrIP+1
|
||||
adc #0
|
||||
>PUSHYA
|
||||
>PUSHYA @IP[2]
|
||||
|
||||
>LDYA ZPPtrIP
|
||||
iny
|
||||
bne .1
|
||||
inc
|
||||
.1 >PUSHYA
|
||||
.1 >PUSHYA @IP[1]
|
||||
|
||||
>PUSHW ZPPtrIP
|
||||
>PUSHW ZPPtrIP @IP[0]
|
||||
|
||||
>PUSHBI 8 4 PTRs on stack
|
||||
>PUSHW L.HST.SScanF
|
||||
>LDYA ZPPtrDNS
|
||||
|
||||
>SYSCALL SScanF.YA
|
||||
>SYSCALL SScanF
|
||||
bcc .9
|
||||
jmp DNS.QUERY.I
|
||||
.9 rts
|
||||
|
@ -126,49 +126,20 @@ SKT.New.Listen sec
|
||||
* A = hSocket
|
||||
* ## Out :
|
||||
*\--------------------------------------
|
||||
SKT.CloseA and #$7f
|
||||
cmp #K.SKTTABLE.SIZE
|
||||
bcs .9
|
||||
|
||||
jsr SKT.GetA.I
|
||||
bcs .9
|
||||
|
||||
cmp #S.SOCKET.SOCK.DGRAM
|
||||
beq .1
|
||||
|
||||
cmp #S.SOCKET.SOCK.RAW
|
||||
beq .1
|
||||
SKT.CloseA jsr SKT.GetA.I get SKT in ZPPtrSKT, S.SOCKET.SOCK in A
|
||||
bcs .99
|
||||
|
||||
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
|
||||
lda (ZPPtrSKT),y
|
||||
ldy #S.SOCKET.HQ.HEAD
|
||||
cmp (ZPPtrSKT),y
|
||||
beq .8
|
||||
beq .8 No frame in Queue, close..
|
||||
|
||||
pha
|
||||
pha save tail...
|
||||
clc
|
||||
adc #S.SOCKET.HQ
|
||||
tax
|
||||
@ -178,8 +149,8 @@ SKT.CloseA and #$7f
|
||||
beq .2
|
||||
|
||||
lda #0
|
||||
.2
|
||||
ldy #S.SOCKET.HQ.TAIL
|
||||
|
||||
.2 ldy #S.SOCKET.HQ.TAIL
|
||||
sta (ZPPtrSKT),y
|
||||
|
||||
txa
|
||||
@ -192,6 +163,26 @@ SKT.CloseA and #$7f
|
||||
sta (ZPPtrSKT)
|
||||
clc
|
||||
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
|
||||
* Get Ptr to socket
|
||||
@ -631,6 +622,7 @@ SKT.AddToQueueA sta .2+1
|
||||
cmp #S.SOCKET.HQ.MAX
|
||||
bne .1
|
||||
lda #0
|
||||
|
||||
.1 ldy #S.SOCKET.HQ.TAIL
|
||||
cmp (ZPPtrSKT),y
|
||||
beq .9 Queue full!!
|
||||
|
@ -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.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
|
||||
|
||||
Previous (relatively!) stable version 0.9.1 has been archived, see link above.
|
||||
|
@ -2,8 +2,8 @@ NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* ## GetArg
|
||||
* # ASM
|
||||
* # GetArg
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* A = argument index.
|
||||
* **Out:**
|
||||
|
@ -2,13 +2,13 @@ NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
*--------------------------------------
|
||||
* K.LoadLib.YA
|
||||
* K.LoadLib
|
||||
* in :
|
||||
* Y,A = PTR To "LibName.o" C-String
|
||||
* out :
|
||||
* A = hMem To loaded LIB
|
||||
*--------------------------------------
|
||||
K.LoadLib.YA jsr BIN.FindLIB.YA
|
||||
K.LoadLib jsr BIN.FindLIB.YA
|
||||
bcs .9
|
||||
|
||||
jsr BIN.Load.YA Y,A = "/PATH/BIN"
|
||||
@ -35,12 +35,12 @@ K.LoadLib.YA jsr BIN.FindLIB.YA
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
* K.UnloadLib.A
|
||||
* K.UnloadLib
|
||||
* in :
|
||||
* A = hMem To Lib
|
||||
* out :
|
||||
*--------------------------------------
|
||||
K.UnloadLib.A pha
|
||||
K.UnloadLib pha
|
||||
jsr K.GetMemByID.A
|
||||
>STYA ZPPtr1
|
||||
ldy #S.MEM.REFCNT
|
||||
@ -65,13 +65,13 @@ K.UnloadLib.A pha
|
||||
pla
|
||||
jmp K.FreeMem.A
|
||||
*--------------------------------------
|
||||
* K.LoadDrv.YA
|
||||
* K.LoadDrv
|
||||
* in :
|
||||
* Y,A = PTR to "NAME.DRV [PARAM]" C-String
|
||||
* out :
|
||||
* 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
|
||||
bcs .9
|
||||
@ -117,9 +117,9 @@ K.LoadDrv.YA >STYA .2+1 Save "BIN\0ARGS\0\0"
|
||||
|
||||
.88 jmp (pDrv)
|
||||
*--------------------------------------
|
||||
BIN.FindLIB.YA clc
|
||||
BIN.FindLIB clc
|
||||
.HS B0 bcs
|
||||
BIN.FindDRV.YA sec
|
||||
BIN.FindDRV sec
|
||||
|
||||
>STYA BIN.CmdLine
|
||||
|
||||
@ -127,7 +127,7 @@ BIN.FindDRV.YA sec
|
||||
bcc .1
|
||||
>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
|
||||
|
||||
>PUSHYA
|
||||
@ -142,16 +142,19 @@ BIN.FindDRV.YA sec
|
||||
* # 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
|
||||
* **In:**
|
||||
* PUSHW = Ptr to Search Path (CSTR) %LIB%;/SYS/SLIB
|
||||
* PUSHW = Ptr to File Name (CSTR)
|
||||
* PUSHW = Ptr to DstBuf
|
||||
* PUSHW = Ptr to DstStat
|
||||
* `>PUSHWI filestat`
|
||||
* `>PUSHWI fullpath`
|
||||
* `>PUSHWI searchpath`
|
||||
* `>LDYAI filename`
|
||||
* **Out:**
|
||||
* CC : success
|
||||
* DstBuf = FilePath
|
||||
* DstStat = S.STAT
|
||||
* CS : not found
|
||||
* CC : success
|
||||
* DstBuf = FilePath
|
||||
* DstStat = S.STAT
|
||||
* CS : not found
|
||||
*\--------------------------------------
|
||||
K.FileSearch >PULLW .4+1 DstStat
|
||||
>PULLW .2+1 DstBuf
|
||||
|
@ -280,16 +280,15 @@ DevMgr.NUL.Code .DA .1 STATUS
|
||||
.DA A2osX.BADCALL CLOSE
|
||||
.DA A2osX.BADCALL READ
|
||||
.DA .8 WRITE
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
.1 >LDYAI .2
|
||||
clc
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
.2 .DA #S.DEV.S.WRITE+S.DEV.S.READ
|
||||
.DA #0,#0,#0
|
||||
>PSTR "NULL DEVICE "
|
||||
>PSTR "NULL DEVICE"
|
||||
.BS 5
|
||||
.DA #S.DSTAT.T.CHAR
|
||||
.DA #0
|
||||
.DA KVER
|
||||
|
@ -4,11 +4,11 @@ AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* # GetDevByID.A
|
||||
* **In:**
|
||||
* A = DevID
|
||||
* A = DevID
|
||||
* **Out:**
|
||||
* CC = OK, CS = ERROR
|
||||
* Y,A = DEVSLOT
|
||||
* note: X Unmodified
|
||||
* CC = OK, CS = ERROR
|
||||
* Y,A = DEVSLOT
|
||||
* note: X Unmodified
|
||||
*\--------------------------------------
|
||||
K.GetDevByID.A cmp DevMgr.Count
|
||||
bcs K.GetDevDNF
|
||||
@ -88,20 +88,23 @@ K.GetDevStatus.A
|
||||
jmp (pDev)
|
||||
*/--------------------------------------
|
||||
* # IOCTL
|
||||
* ## C
|
||||
* `int ioctl ( short int id, short int op, void *param);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHB = DevID
|
||||
* PUSHB = Operation
|
||||
* PUSHW = Param Block
|
||||
* `PUSHWI param`
|
||||
* `lda #op`
|
||||
* `ldy id`
|
||||
* `>SYSCALL IOCTL`
|
||||
* **Out:**
|
||||
* Y,A = ...
|
||||
*\--------------------------------------
|
||||
K.IOCTL >PULLB .1+1
|
||||
>PULLB .2+1
|
||||
K.IOCTL tax op
|
||||
>PULLB .1+1 param LO
|
||||
>PULLB .2+1 param HI
|
||||
|
||||
>PULLA
|
||||
tax
|
||||
tya id
|
||||
|
||||
>PULLA
|
||||
jsr K.GetDevByID.A
|
||||
bcs K.IOCTL.9
|
||||
|
||||
@ -110,7 +113,7 @@ K.IOCTL >PULLB .1+1
|
||||
.1 ldy #$ff SELF MODIFIED
|
||||
.2 lda #$ff SELF MODIFIED
|
||||
|
||||
jmp (pDev)
|
||||
jmp (pDev) x = op
|
||||
|
||||
K.IOCTL.9 rts
|
||||
*--------------------------------------
|
||||
|
@ -2,14 +2,14 @@ NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* # ExpandStr.YA
|
||||
* # 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
|
||||
*\--------------------------------------
|
||||
K.ExpandStr.YA stz .88+1 Reset Intermediate string...
|
||||
K.ExpandStr stz .88+1 Reset Intermediate string...
|
||||
|
||||
.1 >STYA ZPPtr2
|
||||
stz ENV.BufLen init Expanded String len=0
|
||||
|
@ -9,112 +9,112 @@ AUTO 4,1
|
||||
K.SYSCALL.JMP .DA 0 $00
|
||||
.DA 0
|
||||
.DA K.Stat
|
||||
.DA K.MKDir.YA
|
||||
.DA K.MKNod.YA
|
||||
.DA K.MKDir
|
||||
.DA K.MKNod
|
||||
.DA K.MKFIFO
|
||||
.DA 0
|
||||
.DA 0
|
||||
|
||||
.DA K.OpenDir.YA $10
|
||||
.DA K.ReadDir.A
|
||||
.DA K.CloseDir.A
|
||||
.DA K.OpenDir $10
|
||||
.DA K.ReadDir
|
||||
.DA K.CloseDir
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
|
||||
.DA K.FPutC.AY $20
|
||||
.DA K.PutChar.A
|
||||
.DA K.GetC.A
|
||||
.DA K.FPutC $20
|
||||
.DA K.PutChar
|
||||
.DA K.GetC
|
||||
.DA K.GetChar
|
||||
.DA K.FPutS
|
||||
.DA K.PutS.YA
|
||||
.DA K.PutS
|
||||
.DA 0
|
||||
.DA 0
|
||||
|
||||
.DA K.FOpen $30
|
||||
.DA K.FClose.A
|
||||
.DA K.FClose
|
||||
.DA K.FRead
|
||||
.DA K.FWrite
|
||||
.DA K.FFlush.A
|
||||
.DA K.FFlush
|
||||
.DA K.FSeek
|
||||
.DA K.FTell
|
||||
.DA K.FEOF.A
|
||||
.DA K.FEOF
|
||||
|
||||
.DA K.Remove.YA $40
|
||||
.DA K.Remove $40
|
||||
.DA K.Rename
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA K.GetDevByID.A
|
||||
.DA K.GetDevByName.YA
|
||||
.DA K.GetDevStatus.A
|
||||
.DA K.GetDevByID
|
||||
.DA K.GetDevByName
|
||||
.DA K.GetDevStatus
|
||||
.DA K.IOCTL
|
||||
|
||||
.DA 0 $50
|
||||
.DA K.SScanF.YA
|
||||
.DA K.SScanF
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA K.PrintF.YA
|
||||
.DA K.SPrintF.YA
|
||||
.DA K.FPrintF.A
|
||||
.DA K.PrintF
|
||||
.DA K.SPrintF
|
||||
.DA K.FPrintF
|
||||
.DA 0
|
||||
|
||||
.DA 0 $60
|
||||
.DA 0
|
||||
.DA K.LoadFile
|
||||
.DA K.LoadTxtFile.YA
|
||||
.DA K.LoadTxtFile
|
||||
.DA K.ChTyp
|
||||
.DA K.ChMod
|
||||
.DA K.ChOwn
|
||||
.DA K.ChGrp
|
||||
|
||||
.DA K.AToF $70
|
||||
.DA K.AToI.YA
|
||||
.DA K.AToI
|
||||
.DA K.AToL
|
||||
.DA K.StrToF
|
||||
.DA K.StrToL
|
||||
.DA 0
|
||||
.DA K.RealPath.YA
|
||||
.DA K.RealPath
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
* Bank 2
|
||||
*--------------------------------------
|
||||
.DA K.StrLen.YA $80
|
||||
.DA K.StrLen $80
|
||||
.DA K.StrCpy
|
||||
.DA K.StrCat
|
||||
.DA K.StrMatch
|
||||
.DA K.StrUpr.YA
|
||||
.DA K.StrLwr.YA
|
||||
.DA K.StrUpr
|
||||
.DA K.StrLwr
|
||||
.DA K.StrCmp
|
||||
.DA K.StrICmp
|
||||
|
||||
.DA K.Time.YA $90
|
||||
.DA K.Time $90
|
||||
.DA K.CTime2Time
|
||||
.DA K.PTime2Time
|
||||
.DA K.StrFTime
|
||||
.DA K.LoadLib.YA
|
||||
.DA K.UnloadLib.A
|
||||
.DA K.LoadDrv.YA
|
||||
.DA K.LoadLib
|
||||
.DA K.UnloadLib
|
||||
.DA K.LoadDrv
|
||||
.DA K.FileSearch
|
||||
|
||||
.DA K.ExecPSNewEnv.YA $A0
|
||||
.DA K.ExecPS.YA
|
||||
.DA K.CreatePSNewEnv.YA
|
||||
.DA K.CreatePS.YA
|
||||
.DA K.ExecPSNewEnv $A0
|
||||
.DA K.ExecPS
|
||||
.DA K.CreatePSNewEnv
|
||||
.DA K.CreatePS
|
||||
.DA 0
|
||||
.DA K.GetMemStat.YA
|
||||
.DA K.GetPSStatus.A
|
||||
.DA K.GetPSStat.YA
|
||||
.DA K.GetMemStat
|
||||
.DA K.GetPSStatus
|
||||
.DA K.GetPSStat
|
||||
|
||||
.DA 0 $B0
|
||||
.DA K.GetArg.A
|
||||
.DA K.ExpandStr.YA
|
||||
.DA K.GetArg
|
||||
.DA K.ExpandStr
|
||||
.DA 0
|
||||
.DA K.PutEnv.YA
|
||||
.DA K.PutEnv
|
||||
.DA K.SetEnv
|
||||
.DA K.GetEnv.YA
|
||||
.DA K.UnsetEnv.YA
|
||||
.DA K.GetEnv
|
||||
.DA K.UnsetEnv
|
||||
|
||||
.DA K.FAdd $C0
|
||||
.DA K.FSub
|
||||
@ -136,23 +136,23 @@ K.SYSCALL.JMP .DA 0 $00
|
||||
*--------------------------------------
|
||||
* $E000
|
||||
*--------------------------------------
|
||||
.DA K.GetStkObjProperty.AY $E0
|
||||
.DA K.FreeMem.A
|
||||
.DA K.GetMemPtr.A
|
||||
.DA K.GetMemByID.A
|
||||
.DA K.GetMem.YA
|
||||
.DA K.GetMem0.YA
|
||||
.DA K.NewStr.YA
|
||||
.DA K.GetStkObjProperty $E0
|
||||
.DA K.FreeMem
|
||||
.DA K.GetMemPtr
|
||||
.DA K.GetMemByID
|
||||
.DA K.GetMem
|
||||
.DA K.GetMem0
|
||||
.DA K.NewStr
|
||||
.DA K.SListAdd
|
||||
*--------------------------------------
|
||||
.DA K.SListLookup $F0
|
||||
.DA K.SListGetByID
|
||||
.DA K.SListUpdateByID
|
||||
.DA K.SListNew
|
||||
.DA K.SListFree.A
|
||||
.DA K.SListFree
|
||||
.DA K.LoadStkObj
|
||||
.DA K.NewStkObj.YA
|
||||
.DA K.FreeStkObj.A
|
||||
.DA K.NewStkObj
|
||||
.DA K.FreeStkObj
|
||||
*--------------------------------------
|
||||
* LO Byte :
|
||||
* #RRAMWRAMBNK1,#RRAMWRAMBNK2
|
||||
|
@ -18,7 +18,7 @@ ZPSListDataPtr .EQ ZPMEMMGR+14
|
||||
* - mem.ID=0 always used! useful to test if hMem=0
|
||||
*--------------------------------------
|
||||
*/--------------------------------------
|
||||
* # GetMem0.YA
|
||||
* # GetMem0
|
||||
* **In:**
|
||||
* Y,A = Size Requested
|
||||
* **Out:**
|
||||
@ -28,10 +28,10 @@ ZPSListDataPtr .EQ ZPMEMMGR+14
|
||||
* CS :
|
||||
* A = EC
|
||||
*\--------------------------------------
|
||||
K.GetMem0.YA ldx #S.MEM.F.INIT0
|
||||
K.GetMem0 ldx #S.MEM.F.INIT0
|
||||
.HS 2C bit abs
|
||||
*/--------------------------------------
|
||||
* # GetMem.YA
|
||||
* # GetMem
|
||||
* **In:**
|
||||
* Y,A = Size Requested
|
||||
* **Out:**
|
||||
@ -41,7 +41,7 @@ K.GetMem0.YA ldx #S.MEM.F.INIT0
|
||||
* CS :
|
||||
* A = EC
|
||||
*\--------------------------------------
|
||||
K.GetMem.YA ldx #0
|
||||
K.GetMem ldx #0
|
||||
|
||||
MEM.GetMem.YAX stx Mem.ReqFlags
|
||||
sta ZPMemMgrSize+1
|
||||
@ -235,14 +235,14 @@ Mem.NextSlot lda ZPMemMgrSPtr
|
||||
inc ZPMemMgrSPtr+1
|
||||
.8 rts
|
||||
*/--------------------------------------
|
||||
* # FreeMem.A
|
||||
* # FreeMem
|
||||
* **In:**
|
||||
* A = hMem To Free
|
||||
* **Out:**
|
||||
* none.
|
||||
* (X,Y unmodified)
|
||||
*\--------------------------------------
|
||||
K.FreeMem.A phy
|
||||
K.FreeMem phy
|
||||
tay
|
||||
|
||||
beq * Slot=0, reserved by Kernel
|
||||
@ -321,7 +321,7 @@ K.FreeMem.A phy
|
||||
|
||||
>PUSHYA
|
||||
|
||||
>LDYAI K.FreeMem.A.ERR
|
||||
>LDYAI K.FreeMem.ERR
|
||||
>SYSCALL PrintF.YA
|
||||
|
||||
.91 ldx #$ff
|
||||
@ -329,16 +329,16 @@ K.FreeMem.A phy
|
||||
bit $C000,x
|
||||
bra *
|
||||
*--------------------------------------
|
||||
K.FreeMem.A.ERR .AZ "FreeMem:%H:hMem already freed."
|
||||
K.FreeMem.ERR .AZ "FreeMem:%H:hMem already freed."
|
||||
*/--------------------------------------
|
||||
* # GetMemPtr.A
|
||||
* # GetMemPtr
|
||||
* **In:**
|
||||
* A = hMem
|
||||
* **Out:**
|
||||
* Y,A = PTR to MemBlock
|
||||
* (X unmodified)
|
||||
*\--------------------------------------
|
||||
K.GetMemPtr.A jsr K.GetMemByID.A
|
||||
K.GetMemPtr jsr K.GetMemByID.A
|
||||
ldy #S.MEM.PTR
|
||||
lda (ZPMemMgrSPtr),y
|
||||
pha
|
||||
@ -347,7 +347,7 @@ K.GetMemPtr.A jsr K.GetMemByID.A
|
||||
ply
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # GetMemByID.A
|
||||
* # GetMemByID
|
||||
* **In:**
|
||||
* A = hMem
|
||||
* **Out:**
|
||||
@ -367,7 +367,7 @@ K.GetMemPtr.A jsr K.GetMemByID.A
|
||||
!!!!!WARNING!!!!!
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
K.GetMemByID.A sta ZPMemMgrSPtr
|
||||
K.GetMemByID sta ZPMemMgrSPtr
|
||||
lda /Mem.Table/8
|
||||
asl ZPMemMgrSPtr
|
||||
rol
|
||||
@ -397,7 +397,7 @@ K.GetMemByID.A sta ZPMemMgrSPtr
|
||||
* sta ZPMemMgrSPtr+1
|
||||
* rts
|
||||
*/--------------------------------------
|
||||
* # NewStr.YA
|
||||
* # NewStr
|
||||
* Create a new copy of this C-String
|
||||
* **In:**
|
||||
* Y,A = Ptr to source C-String
|
||||
@ -408,7 +408,7 @@ K.GetMemByID.A sta ZPMemMgrSPtr
|
||||
* CS : error
|
||||
* A = SYS error code
|
||||
*\--------------------------------------
|
||||
K.NewStr.YA >STYA .1+1
|
||||
K.NewStr >STYA .1+1
|
||||
>STYA .4+1
|
||||
|
||||
ldy #0
|
||||
@ -513,7 +513,7 @@ K.SListNew
|
||||
* A=hSList
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
K.SListFree.A
|
||||
K.SListFree
|
||||
*--------------------------------------
|
||||
sta SETREADAUX
|
||||
sta SETWRITEAUX
|
||||
@ -522,15 +522,14 @@ K.SListFree.A
|
||||
sta CLRWRITEAUX
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # GetStkObjProperty.AY
|
||||
* # GetStkObjProp
|
||||
* **In:**
|
||||
* A = hObject (AUX Memory)
|
||||
* Y = Property Index
|
||||
* **Out:**
|
||||
* Y,A = Property Value
|
||||
*\--------------------------------------
|
||||
K.GetStkObjProperty.AY
|
||||
phy
|
||||
K.GetStkObjProp phy
|
||||
sta SETREADAUX
|
||||
jsr K.GetMemPtr.A
|
||||
>STYA ZPMemMgrTmp1
|
||||
@ -544,7 +543,7 @@ K.GetStkObjProperty.AY
|
||||
sta CLRREADAUX
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # NewStkObj.YA
|
||||
* # NewStkObj
|
||||
* **In:**
|
||||
* Y,A = Size Requested
|
||||
* **Out:**
|
||||
@ -554,17 +553,17 @@ K.GetStkObjProperty.AY
|
||||
* CS :
|
||||
* A = EC
|
||||
*\--------------------------------------
|
||||
K.NewStkObj.YA ldx #SYS.GetMem.YA
|
||||
K.NewStkObj ldx #SYS.GetMem
|
||||
.HS 2C BIT ABS
|
||||
*/--------------------------------------
|
||||
* # FreeStkObj.A
|
||||
* # FreeStkObj
|
||||
* **In:**
|
||||
* A = hMem To Free (AUX Memory)
|
||||
* **Out:**
|
||||
* none.
|
||||
* (X,Y unmodified)
|
||||
*\--------------------------------------
|
||||
K.FreeStkObj.A ldx #SYS.FreeMem.A
|
||||
K.FreeStkObj ldx #SYS.FreeMem
|
||||
|
||||
MEM.GoStkObj sta SETREADAUX
|
||||
sta SETWRITEAUX
|
||||
|
@ -1,35 +1,41 @@
|
||||
NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
*--------------------------------------
|
||||
STDIO.Out.pBuf .EQ K.SP.PARAMS+2
|
||||
STDIO.Out.Cnt .EQ K.SP.PARAMS+4
|
||||
*/--------------------------------------
|
||||
* # FPutC.A
|
||||
* int fputc ( int character, hFILE stream );
|
||||
* # FPutC
|
||||
* Print A (char) to hFILE
|
||||
* ## C
|
||||
* `int fputc ( int character, hFILE stream );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHB : hFILE
|
||||
* A : char to print
|
||||
* Y : character
|
||||
* A : stream
|
||||
* **Out:**
|
||||
* CC = success
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.FPutC.AY sta K.IOBuf
|
||||
K.FPutC sty K.IOBuf
|
||||
|
||||
>PULLA
|
||||
bra K.PutChar.A.1
|
||||
bra K.PutChar.1
|
||||
*/--------------------------------------
|
||||
* # PutChar.A
|
||||
* int putchar ( int character );
|
||||
* # PutChar
|
||||
* ## C
|
||||
* `int putchar ( int character );`
|
||||
* ## ASM
|
||||
* Print A (char) to StdOut
|
||||
* **In:**
|
||||
* A : char to print
|
||||
* A : char to print
|
||||
* **Out:**
|
||||
* CC = success
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.PutChar.A sta K.IOBuf
|
||||
K.PutChar sta K.IOBuf
|
||||
|
||||
ldy #S.PS.hStdOut
|
||||
lda (pPs),y
|
||||
|
||||
K.PutChar.A.1 jsr K.GetMemPtr.A
|
||||
K.PutChar.1 jsr K.GetMemPtr.A
|
||||
>STYA pNode
|
||||
>LDYAI K.IOBuf
|
||||
>STYA pIOBuf
|
||||
@ -38,40 +44,42 @@ K.PutChar.A.1 jsr K.GetMemPtr.A
|
||||
stz STDIO.Out.Cnt+1
|
||||
jmp STDIO.Out
|
||||
*/--------------------------------------
|
||||
* # PutS.YA
|
||||
* int puts ( const char * str );
|
||||
* # PutS
|
||||
* Write Str to StdOut, appends '\r\n'
|
||||
* ## C
|
||||
* `int puts ( const char * str );`
|
||||
* **In:**
|
||||
* Y,A : CPtr
|
||||
* Y,A : CPtr
|
||||
* **Out:**
|
||||
* CC = success
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.PutS.YA >STYA pIOBuf
|
||||
K.PutS >STYA pIOBuf
|
||||
ldy #S.PS.hStdOut
|
||||
lda (pPs),y
|
||||
jsr K.FPutS.YA.1
|
||||
jsr K.FPutS.1
|
||||
bcs .9
|
||||
|
||||
lda #13
|
||||
jsr K.PutChar.A
|
||||
jsr K.PutChar
|
||||
bcs .9
|
||||
lda #10
|
||||
jmp K.PutChar.A
|
||||
jmp K.PutChar
|
||||
.9 rts
|
||||
*/--------------------------------------
|
||||
* # FPutS.YA
|
||||
* int fputs ( const char * str, hFILE stream );
|
||||
* # FPutS
|
||||
* Write Str to FILE
|
||||
* ## C
|
||||
* `int fputs ( const char * str, hFILE stream );`
|
||||
* **In:**
|
||||
* PUSHB : hFILE
|
||||
* Y,A: CPtr
|
||||
* PUSHB : hFILE
|
||||
* Y,A: str
|
||||
* **Out:**
|
||||
* CC = success
|
||||
* CC = success
|
||||
*\--------------------------------------
|
||||
K.FPutS.YA >STYA pIOBuf
|
||||
K.FPutS >STYA pIOBuf
|
||||
>PULLA
|
||||
|
||||
K.FPutS.YA.1 jsr K.GetMemPtr.A
|
||||
K.FPutS.1 jsr K.GetMemPtr.A
|
||||
>STYA pNode
|
||||
|
||||
ldy #0
|
||||
@ -95,72 +103,70 @@ K.FPutS.YA.1 jsr K.GetMemPtr.A
|
||||
stx STDIO.Out.Cnt+1
|
||||
jmp STDIO.Out
|
||||
*/--------------------------------------
|
||||
* # PrintF.YA
|
||||
* int printf ( const char * format, ... );
|
||||
* # SPrintF.YA
|
||||
* int sprintf ( char * str, const char * format, ... );
|
||||
* # FPrintF.A
|
||||
* int fprintf ( FILE * stream, const char * format, ... );
|
||||
*
|
||||
* # PrintF/SPrintF/FPrintF
|
||||
* 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:**
|
||||
* PrintF.YA :
|
||||
* PUSH ...
|
||||
* Y,A = PTR to CStr
|
||||
* SPrintF.YA :
|
||||
* PUSH ...
|
||||
* PUSHW = PTR to CStr
|
||||
* Y,A = Ptr to Dst Buffer
|
||||
* FPrintF.YA :
|
||||
* PUSH ...
|
||||
* PUSHW = PTR to CStr
|
||||
* A = hFILE
|
||||
*
|
||||
* PrintF :
|
||||
* PUSH ...
|
||||
* Y,A = PTR to CStr
|
||||
* SPrintF :
|
||||
* PUSH ...
|
||||
* PUSHW = PTR to CStr
|
||||
* Y,A = Ptr to Dst Buffer
|
||||
* FPrintF :
|
||||
* PUSH ...
|
||||
* PUSHW = PTR to CStr
|
||||
* A = hFILE
|
||||
* **Out:**
|
||||
* CC : success
|
||||
* CS : error code from Output
|
||||
* CC : success
|
||||
* CS : error code from Output
|
||||
* Specifiers :
|
||||
* %b : pull 1 byte to Print BIN
|
||||
* %B : pull 2 bytes to Print BIN
|
||||
* %d : pull 1 byte unsigned DEC 0..255
|
||||
* %D : pull 2 bytes unsigned DEC 0..65535
|
||||
* %u : pull 4 bytes long unsigned DEC 0..4294967295
|
||||
* %e : pull 5 Bytes float (-)1.23456789e+12
|
||||
* %f : pull 5 Bytes float (-)3.1415
|
||||
* %h : pull 1 byte to Print HEX
|
||||
* %H : pull 2 bytes to Print HEX
|
||||
* %i : pull 1 byte to Print signed DEC -128..127
|
||||
* %I : pull 2 bytes to Print signed DEC -32768..32767
|
||||
* %L : pull 4 bytes signed DEC -2147483648..2147483647
|
||||
* %n : pull 1 byte to Print low Nibble HEX
|
||||
* %N : pull 1 byte to Print high Nibble HEX
|
||||
* %s : pull 2 bytes ptr to C-Style String
|
||||
* %S : pull 2 bytes ptr to P-Style String
|
||||
* \b : Print 'BS' (08)
|
||||
* \e : Print 'ESC' ($1B,27)
|
||||
* \f : Print 'FF' ($0C,12)
|
||||
* \n : Print 'LF' ($0A,10)
|
||||
* \r : Print 'CR' ($0D,13)
|
||||
* \\\\ : Print \
|
||||
* \% : Print %
|
||||
* + %b : pull 1 byte to Print BIN
|
||||
* + %B : pull 2 bytes to Print BIN
|
||||
* + %d : pull 1 byte unsigned DEC 0..255
|
||||
* + %D : pull 2 bytes unsigned DEC 0..65535
|
||||
* + %u : pull 4 bytes long unsigned DEC 0..4294967295
|
||||
* + %e : pull 5 Bytes float (-)1.23456789e+12
|
||||
* + %f : pull 5 Bytes float (-)3.1415
|
||||
* + %h : pull 1 byte to Print HEX
|
||||
* + %H : pull 2 bytes to Print HEX
|
||||
* + %i : pull 1 byte to Print signed DEC -128..127
|
||||
* + %I : pull 2 bytes to Print signed DEC -32768..32767
|
||||
* + %L : pull 4 bytes signed DEC -2147483648..2147483647
|
||||
* + %n : pull 1 byte to Print low Nibble HEX
|
||||
* + %N : pull 1 byte to Print high Nibble HEX
|
||||
* + %s : pull 2 bytes ptr to C-Style String
|
||||
* + %S : pull 2 bytes ptr to P-Style String
|
||||
* + \b : Print 'BS' (08)
|
||||
* + \e : Print 'ESC' ($1B,27)
|
||||
* + \f : Print 'FF' ($0C,12)
|
||||
* + \n : Print 'LF' ($0A,10)
|
||||
* + \r : Print 'CR' ($0D,13)
|
||||
* + \\\\ : Print \
|
||||
* + \\% : Print %
|
||||
* Modifiers for len and padding :
|
||||
* %d : '9' '12'
|
||||
* %2d : ' 9' '12'
|
||||
* %02d : '09' '12'
|
||||
* %11s : 'ABCDEFGH '
|
||||
* %011s : 'ABCDEFGH000'
|
||||
* %2f : '3.14'
|
||||
* + %d : '9' '12'
|
||||
* + %2d : ' 9' '12'
|
||||
* + %02d : '09' '12'
|
||||
* + %11s : 'ABCDEFGH '
|
||||
* + %011s : 'ABCDEFGH000'
|
||||
* + %2f : '3.14'
|
||||
*\--------------------------------------
|
||||
K.SPrintF.YA >STYA pIOBuf Out Buffer
|
||||
K.SPrintF >STYA pIOBuf Out Buffer
|
||||
>PULLW ZPPtr1 format
|
||||
bra K.PrintF.1
|
||||
|
||||
K.FPrintF.A jsr K.GetMemPtr.A A = hFILE
|
||||
K.FPrintF jsr K.GetMemPtr.A A = hFILE
|
||||
>STYA pNode
|
||||
>PULLW ZPPtr1 format
|
||||
bra K.PrintF.0
|
||||
|
||||
K.PrintF.YA >STYA ZPPtr1 format
|
||||
K.PrintF >STYA ZPPtr1 format
|
||||
ldy #S.PS.hStdOut
|
||||
lda (pPs),y
|
||||
jsr K.GetMemPtr.A
|
||||
@ -419,7 +425,7 @@ PrintF.Hex2Dec ror .31+1
|
||||
clc
|
||||
.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/
|
||||
*--------------------------------------
|
||||
PrintF.E sec Force "E+12"
|
||||
@ -565,8 +571,6 @@ PrintF.COut phy
|
||||
rts
|
||||
*--------------------------------------
|
||||
*--------------------------------------
|
||||
STDIO.Out.Cnt .BS 2
|
||||
*--------------------------------------
|
||||
STDIO.Out ldy #S.NODE.T
|
||||
lda (pNode),y
|
||||
asl
|
||||
@ -597,7 +601,7 @@ STDIO.Out.CDEV ldy #S.NODE.DEV.JMP
|
||||
sta .1+2
|
||||
|
||||
lda K.IOBuf
|
||||
ldx #DEVMGR.WRITE
|
||||
ldx #IOCTL.WRITE
|
||||
.1 jmp $ffff
|
||||
*--------------------------------------
|
||||
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
|
||||
lda (pPs),y
|
||||
*/--------------------------------------
|
||||
* # GetC.A
|
||||
* # GetC
|
||||
* Get char from Node
|
||||
* ## C
|
||||
* `int getc ( FILE * stream );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* A = hNODE
|
||||
* **Out:**
|
||||
* CC = success
|
||||
* A = char
|
||||
*\--------------------------------------
|
||||
K.GetC.A sta K.PutC.Node
|
||||
jsr K.GetMemPtr.A
|
||||
K.GetC.A jsr K.GetMemPtr.A
|
||||
>STYA pDev
|
||||
|
||||
ldy #S.NODE.T
|
||||
@ -727,27 +733,32 @@ K.PrintF.PadL .EQ FAC+4
|
||||
K.PrintF.PadC .EQ FAC+5
|
||||
BCDBUF .EQ ARG
|
||||
*/--------------------------------------
|
||||
* # SScanF.YA
|
||||
* Scan a C-String (in progress)
|
||||
* # SScanF
|
||||
* Read formatted data from string
|
||||
* ## C
|
||||
* `int sscanf ( const char * s, const char * format, ...);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHW PTR to target var
|
||||
* ...
|
||||
* PUSHW PTR pattern (ex: "%d.%d.%d.%d")
|
||||
* %i : short int
|
||||
* %d : byte
|
||||
* %I : int
|
||||
* %D : word
|
||||
* %L : long int
|
||||
* %U : dword
|
||||
* %h : HEX byte
|
||||
* %H : HEX word
|
||||
* Y,A = PTR to String to scan (ex: "192.168.1.5")
|
||||
* `>PUSHBI Argument Byte count`
|
||||
* `>PUSHWI format`
|
||||
* + %i : short int
|
||||
* + %d : byte
|
||||
* + %I : int
|
||||
* + %D : word
|
||||
* + %L : long int
|
||||
* + %U : dword
|
||||
* + %h : HEX byte
|
||||
* + %H : HEX word
|
||||
* `>LDYA s`
|
||||
* **Out:**
|
||||
* Y,A = Number of arguments filled.
|
||||
*\--------------------------------------
|
||||
K.SScanF.YA >STYA ZPPtr2 String to Scan
|
||||
>PULLW ZPPtr1 Pattern
|
||||
K.SScanF >STYA ZPPtr2 String to Scan
|
||||
>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
|
||||
|
||||
inc ZPPtr1
|
||||
@ -766,7 +777,7 @@ K.SScanF.YA >STYA ZPPtr2 String to Scan
|
||||
bra .1
|
||||
|
||||
.2 lda (ZPPtr1) Get specifier after %
|
||||
beq .9 unexpected End of pattern after "%" ?
|
||||
beq .9 unexpected End of format after "%" ?
|
||||
|
||||
inc ZPPtr1
|
||||
bne .21
|
||||
@ -780,22 +791,40 @@ K.SScanF.YA >STYA ZPPtr2 String to Scan
|
||||
dex
|
||||
bpl .3
|
||||
|
||||
.9 lda #MLI.E.EOF
|
||||
.9 jsr .8
|
||||
lda #MLI.E.EOF
|
||||
sec
|
||||
rts
|
||||
|
||||
.4 jsr .5
|
||||
|
||||
bcs .9
|
||||
|
||||
bra .1
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
.8 lda pStack
|
||||
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
|
||||
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.SScanFJMP .DA K.SScanF.I
|
||||
.DA K.SScanF.D
|
||||
|
@ -2,11 +2,11 @@ NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* ## StrToF
|
||||
* # StrToF
|
||||
* Convert String to 40 bits Float
|
||||
* # C
|
||||
* ## C
|
||||
* `float strtof (const char* str, char** endptr);`
|
||||
* # ASM
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>PUSHWI EndPtr`
|
||||
* `>LDYA str`
|
||||
@ -25,11 +25,11 @@ K.StrToF >STYA TXTPTR Ptr to source string
|
||||
sta (ZPPtr1),y
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* ## AToF
|
||||
* # AToF
|
||||
* Convert String to 40 bits Float
|
||||
* # C
|
||||
* ## C
|
||||
* `float atof (const char* str);`
|
||||
* # ASM
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>LDYA str`
|
||||
* **Out:**
|
||||
@ -57,12 +57,12 @@ K.AToF.I jsr CHARGOT
|
||||
clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* ## StrToL (StrToUL)
|
||||
* # StrToL/StrToUL
|
||||
* Convert String to 32 bits (unsigned) int
|
||||
* # C
|
||||
* ## C
|
||||
* `long strtol (const char* str, char** endptr, int base);`
|
||||
* `unsigned long strtoul (const char* str, char** endptr, int base);`
|
||||
* # ASM
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>PUSHB Base`
|
||||
* `>PUSHWI EndPtr`
|
||||
@ -92,9 +92,9 @@ K.StrToUL.rts rts
|
||||
*/--------------------------------------
|
||||
* # AToL
|
||||
* Convert String to 32 bits int
|
||||
* # C
|
||||
* ## C
|
||||
* `long atol ( const char * str );`
|
||||
* # ASM
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>LDYA str`
|
||||
* **Out:**
|
||||
@ -124,10 +124,10 @@ K.AToL.I jsr STDLIB.GetDec
|
||||
|
||||
.9 rts
|
||||
*/--------------------------------------
|
||||
* ## AToI.YA
|
||||
* # C
|
||||
* # AToI.YA
|
||||
* ## C
|
||||
* `int atoi ( const char * str );`
|
||||
* # ASM
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>LDYA str`
|
||||
* **Out:**
|
||||
|
@ -2,14 +2,17 @@ NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* # StrLen.YA
|
||||
* # StrLen
|
||||
* Returns Length of C-String
|
||||
* ## C
|
||||
* `char * strcat ( char * destination, const char * source );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* Y,A = Ptr to CSTR
|
||||
* Y,A = Ptr to CSTR
|
||||
* **Out:**
|
||||
* Y,A = String length
|
||||
* Y,A = String length
|
||||
*\--------------------------------------
|
||||
K.StrLen.YA >STYA ZPPtr1
|
||||
K.StrLen >STYA ZPPtr1
|
||||
|
||||
ldy #0
|
||||
ldx #0
|
||||
@ -45,11 +48,14 @@ K.StrCat jsr MEM.PullP1P2
|
||||
*/--------------------------------------
|
||||
* # StrCpy
|
||||
* Copy string
|
||||
* ## C
|
||||
* `char * strcpy ( char * destination, const char * source );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHW = Ptr to SRC (CSTR)
|
||||
* PUSHW = Ptr to DST (CSTR)
|
||||
* PUSHW = Ptr to SRC (CSTR)
|
||||
* PUSHW = Ptr to DST (CSTR)
|
||||
* **Out:**
|
||||
* DST = SRC
|
||||
* DST = SRC
|
||||
*\--------------------------------------
|
||||
K.StrCpy jsr MEM.PullP1P2
|
||||
|
||||
@ -140,12 +146,12 @@ K.StrMatch jsr MEM.PullP1P2
|
||||
.8 clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # StrUpr.YA/StrLwr.YA
|
||||
* # StrUpr/StrLwr
|
||||
* Convert string to UPPERCASE/lowercase
|
||||
* **In:**
|
||||
* Y,A = PTR to String (CSTR)
|
||||
* Y,A = PTR to String (CSTR)
|
||||
* **Out:**
|
||||
* Uppercased/lowercased String in Buffer
|
||||
* Uppercased/lowercased String in Buffer
|
||||
*\--------------------------------------
|
||||
K.StrUpr.YA ldx #0
|
||||
.HS 2C bit abs
|
||||
|
@ -9,14 +9,14 @@ CENTURY0 .EQ 19
|
||||
YEAR0 .EQ 70
|
||||
DAY0 .EQ 4 day 0 was a thursday
|
||||
*/--------------------------------------
|
||||
* # Time.YA
|
||||
* Get System Time in Buffer
|
||||
* # Time
|
||||
* Get System Time in Buffer
|
||||
* ## In :
|
||||
* Y,A = PTR to S.TIME
|
||||
* Y,A = PTR to S.TIME
|
||||
* ## Out :
|
||||
* S.TIME filled with System date/time
|
||||
* S.TIME filled with System date/time
|
||||
*\--------------------------------------
|
||||
K.Time.YA >STYA ZPPtr2
|
||||
K.Time >STYA ZPPtr2
|
||||
>MLICALL MLIGETTIME
|
||||
>LDYAI DATELO
|
||||
>STYA ZPPtr1
|
||||
@ -376,8 +376,11 @@ K.CTime.Century .BS 1
|
||||
K.CTime.Year .BS 1
|
||||
*/--------------------------------------
|
||||
* # StrFTime
|
||||
* ## C
|
||||
* 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 = Src PTR To Format String
|
||||
* %a : Abbreviated weekday name : Thu
|
||||
|
Loading…
x
Reference in New Issue
Block a user