Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-10-11 17:23:06 +02:00
parent 1672fb04d1
commit 026a9cc3dc
31 changed files with 457 additions and 373 deletions

View File

@ -5,7 +5,8 @@
## ASM
**In:**
A = argument index.
**Out:**
## RETURN VALUE
CC : success
Y,A = PTR To Arg[A]
CS : Out Of Bound
@ -15,7 +16,8 @@ CS : Out Of Bound
## ASM
**In:**
Y,A = PTR to "NAME.DRV [PARAM]" C-String
**Out:**
## RETURN VALUE
none
# InsDrv
@ -30,21 +32,22 @@ none
`>PUSHW DRV.CS.START`
`>LDYA L.SRC`
`SYSCALL insdrv`
**Out:**
## RETURN VALUE
Y,A = Ptr to installed driver
# GetDevByID
**In:**
A = DevID
**Out:**
## RETURN VALUE
CC = OK, CS = ERROR
Y,A = FD
X = hFD
# GetDevByName
**In:**
Y,A = Ptr to device name (C-String)
**Out:**
## RETURN VALUE
CC = OK, CS = ERROR
Y,A = FD
X = DevID
@ -55,11 +58,11 @@ X = DevID
`int getdevstatus(short int hFD, S.DIB* dstat);`
## ASM
**In:**
`>PUSHWI S.DIB`
`lda DevID`
`>SYSCALL GetDevStatus`
**Out:**
## RETURN VALUE
# MKDev
Create a hDEV
@ -68,10 +71,10 @@ Create a hDEV
`hDEV mkdev (S.FD * fd)`
## ASM
**In:**
`>LDYA FD.DEV`
`>SYSCALL mkdev
**Out:**
## RETURN VALUE
A = hDEV
# OpenDir
@ -80,10 +83,10 @@ Create a hDEV
`int hDIR opendir (const char * dirpath);`
## ASM
**In:**
`>LDYA dirpath`
`>SYSCALL opendir`
**Out:**
## RETURN VALUE
CC : success
A = hDIR
CS : error
@ -95,11 +98,11 @@ Create a hDEV
`int readdir (int hDIR, S.DIRENT * dirent);`
## ASM
**In:**
`>PUSHW dirent`
`lda hDIR`
`>SYSCALL readdir`
**Out:**
## RETURN VALUE
CC : success
X = hDIRENT
Y,A = PTR to S.DIRENT
@ -113,16 +116,17 @@ Create a hDEV
`void closedir(hDIR);`
## ASM
**In:**
`lda hDIR`
`>SYSCALL closedir`
**Out:**
## RETURN VALUE
none, always succeed.
# ExpandStr
**In:**
Y,A = PTR to String to Expand (C-String)
**Out:**
## RETURN VALUE
X = hMem to Expanded String (C-String)
Y,A = PTR to Expanded String
@ -139,7 +143,8 @@ And return, if found, the full path to it.
`>PUSHWI fullpath`
`>PUSHWI searchpath`
`>LDYAI filename`
**Out:**
## RETURN VALUE
CC : success
DstBuf = FilePath
DstStat = S.STAT
@ -155,7 +160,8 @@ Change or add an environment variable, string is 'NAME=VALUE'
**In:**
`>LDYA string`
`>SYSCALL putenv`
**Out:**
## RETURN VALUE
# SetEnv
Change or add an environment variable
@ -168,7 +174,8 @@ Change or add an environment variable
`>PUSHW value`
`>LDYA name`
`>SYSCALL setenv`
**Out:**
## RETURN VALUE
# GetEnv
searches the environment list to find the environment variable name,
@ -180,8 +187,9 @@ and returns a pointer to the corresponding value string.
## ASM
**In:**
`>LDYA name`
`>SYSCALL gerenv`
**Out:**
`>SYSCALL getenv`
## RETURN VALUE
CC : Y,A = PTR to VALUE (C-String)
CS : not found
@ -195,13 +203,15 @@ Remove an environment variable
**In:**
`>LDYA name`
`>SYSCALL unsetenv`
**Out:**
## RETURN VALUE
# LoadTxtFile
Load TXT a file in memory (with ending 0)
**In:**
Y,A = File Path
**Out:**
## RETURN VALUE
Y,A = File Length (without ending 0)
X = hMem of Loaded File
@ -212,7 +222,8 @@ Load a file in memory
PUSHB = TYPE ...
PUSHB = MODE ...
LDYA = PATH ...FOpen)
**Out:**
## RETURN VALUE
Y,A = File Length
X = hMem of Loaded File
@ -227,7 +238,8 @@ Change The type of a ProDOS File
`>PUSHBI filetype`
`>LDYA filepath`
`>SYSCALL chtyp`
**Out:**
## RETURN VALUE
# ChMod
**In:**
@ -254,7 +266,8 @@ Change The type of a ProDOS File
`>PUSHB flags`
`>LDYA pathname`
`>SYSCALL open`
**Out:**
## RETURN VALUE
A = hFD
REG File created on ProDOS : T=TXT,X=$0000
@ -279,7 +292,8 @@ REG File created on ProDOS : T=TXT,X=$0000
`>PUSHW buf`
`lda fd`
`>SYSCALL read`
**Out:**
## RETURN VALUE
CC: Y,A = bytes read
CS: A = EC
@ -294,7 +308,8 @@ CS: A = EC
`>PUSHW buf`
`lda fd`
`>SYSCALL write`
**Out:**
## RETURN VALUE
CC: Y,A = bytes written
CS: A = EC
@ -304,12 +319,12 @@ CS: A = EC
`int ioctl(short int hFD, int request, void * param );`
## ASM
**In:**
`PUSHWI param`
`PUSHBI request`
`lda hFD`
`>SYSCALL IOCTL`
**Out:**
## RETURN VALUE
Y,A = ...
# pipe
@ -318,7 +333,6 @@ CS: A = EC
`int pipe(int pipefd[2]);`
## ASM
**In:**
# FAdd,FSub,FMult,FDiv,FPwr
Return X+Y, X-Y, X*Y, X/Y, X^Y
@ -332,7 +346,8 @@ Return X+Y, X-Y, X*Y, X/Y, X^Y
`>SYSCALL fmult`
`>SYSCALL fdiv`
`>SYSCALL fpwr`
**Out:**
## RETURN VALUE
On stack (float)
# Log,Sqr,Exp,Cos,Sin,Tan,ATan
@ -351,7 +366,8 @@ Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
**In:**
`>PUSHF x (Float)`
`>SYSCALL log`
**Out:**
## RETURN VALUE
On stack (Float)
# float
@ -363,7 +379,8 @@ Return 'floated' long
## ASM
**In:**
`>PUSHL X` (long)
**Out:**
## RETURN VALUE
On stack (float)
# lrintf
@ -376,13 +393,14 @@ Return float rounded into a long
**In:**
`>PUSHF x`
`>SYSCALL lrintf`
**Out:**
## RETURN VALUE
On stack (long)
# GetMem0
**In:**
Y,A = Size Requested
**Out:**
## RETURN VALUE
CC : success
YA = PTR to Mem (ZERO Initialised)
* X = hMem
@ -390,9 +408,9 @@ Return float rounded into a long
A = EC
# GetMem
**In:**
Y,A = Size Requested
**Out:**
## RETURN VALUE
CC : success
YA = PTR to Mem (Uninitialised)
* X = hMem
@ -400,31 +418,31 @@ Return float rounded into a long
A = EC
# FreeMem
**In:**
A = hMem To Free
**Out:**
## RETURN VALUE
none.
(X unmodified)
# GetMemPtr
**In:**
A = hMem
**Out:**
## RETURN VALUE
Y,A = PTR to MemBlock
(X unmodified)
# GetMemByID
**In:**
A = hMem
**Out:**
## RETURN VALUE
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
**Out:**
## RETURN VALUE
CC : success
Y,A = PTR to String
X = hMem (PSTR)
@ -432,62 +450,62 @@ CS : error
A = SYS error code
# SListGetByID
**In:**
PUSHB = hSList
PUSHW = KeyID
PUSHW = Data Ptr
PUSHW = Key Ptr
**Out:**
## RETURN VALUE
X,Y = Next KeyID
# SListUpdateByID
**In:**
PUSHB = hSList
PUSHW = KeyID
PUSHW = Data Ptr
**Out:**
## RETURN VALUE
A = Key Length
X,Y = KeyID
# SListAdd
**In:**
PUSHB = hSList
PUSHW = Key Ptr
PUSHW = Data Ptr
**Out:**
## RETURN VALUE
A = Key Length
X,Y = KeyID
# SListLookup
**In:**
PUSHB = hSList
PUSHW = Key Ptr
PUSHW = Data Ptr
**Out:**
## RETURN VALUE
A = Key Length
X,Y = KeyID
# SListNew
**In:**
**Out:**
## RETURN VALUE
A=hSList
# SListFree
**In:**
A=hSList
**Out:**
## RETURN VALUE
# GetStkObjProp
**In:**
A = hObject (AUX Memory)
Y = Property Index
**Out:**
## RETURN VALUE
Y,A = Property Value
# NewStkObj
**In:**
Y,A = Size Requested
**Out:**
## RETURN VALUE
CC : success
YA = PTR to Mem (Uninitialised)
* X = hMem
@ -495,20 +513,20 @@ CS : error
A = EC
# FreeStkObj
**In:**
A = hMem To Free (AUX Memory)
**Out:**
## RETURN VALUE
none.
(X,Y unmodified)
# LoadStkObj
Load a file in AUX memory (Stock Objects)
**In:**
PUSHW = AUXTYPE (Handled by....
PUSHB = TYPE ...
PUSHB = MODE ...
PUSHW = PATH ...FOpen)
**Out:**
## RETURN VALUE
Y,A = File Length
X = hMem of Loaded Object in AUX mem
@ -521,25 +539,43 @@ Load a file in AUX memory (Stock Objects)
# CreatePS (Non Blocking)
**In:**
Y,A = PTR To Cmd Line
**Out:**
## RETURN VALUE
A = Child PSID
# Exec
## C
`int exec(const char *path, char *const argv[], short int flage);`
## ASM
`>PUSHB flags`
`>PUSHW argv`
`>LDYAI path`
`>SYSCALL exec`
## RETURN VALUE
A = Child PSID
# GetMemStat
**In:**
Y,A = Ptr to 24 bytes buffer
**Out:**
## RETURN VALUE
Buffer filled with memory stats
# GetPSStatus
**In:**
A = PID
**Out:**
## RETURN VALUE
A = Status Byte
# GetPSStat
**In:**
Y,A = Ptr to 24 bytes buffer
**Out:**
## RETURN VALUE
Buffer filled with PS stats
# Stat
@ -553,7 +589,8 @@ Return information about a file
`>PUSHW statbuf`
`>LDYA pathname`
`>SYSCALL stat`
**Out:**
## RETURN VALUE
# MKDir
create a directory
@ -566,7 +603,8 @@ create a directory
`>PUSHW mode`
`>LDYA pathname`
`>SYSCALL mkdir`
**Out:**
## RETURN VALUE
CC : success
CS : error
A = EC
@ -584,7 +622,8 @@ Create a special or ordinary file.
`>PUSHW mode`
`>LDYA pathname`
`>SYSCALL mknod`
**Out:**
## RETURN VALUE
CC = OK, CS = ERROR
A = hFILE
@ -599,7 +638,8 @@ return a hFILE to a new FIFO
`>PUSHW mode`
`>LDYA pathname`
`>SYSCALL mkfifo`
**Out:**
## RETURN VALUE
CC = OK, CS = ERROR
A = hFILE
@ -614,7 +654,8 @@ Print A (char) to hFILE
`>PUSHB character`
`lda stream`
`>SYSCALL fputc`
**Out:**
## RETURN VALUE
CC = success
# PutChar
@ -627,7 +668,8 @@ Print A (char) to StdOut
**In:**
`lda caracter`
`>SYSCALL putchar`
**Out:**
## RETURN VALUE
CC = success
# PutS
@ -640,7 +682,8 @@ Write Str to StdOut, appends '\r\n'
## ASM
`>LDYAI str`
`>SYSCALL puts`
**Out:**
## RETURN VALUE
CC = success
# FPutS
@ -654,7 +697,8 @@ Write Str to FILE
`>PUSHW str`
`lda stream`
`>SYSCALL fputs`
**Out:**
## RETURN VALUE
CC = success
# PrintF/SPrintF/FPrintF
@ -687,7 +731,8 @@ FPrintF :
`>PUSHWI format`
`lda hFILE`
`>SYSCALL fprintf`
**Out:**
## RETURN VALUE
CC : success, Y,A = bytes sent
CS : error, A = code from Output
Specifiers :
@ -739,7 +784,8 @@ string is then terminated with a null byte.
`>PUSHW s`
`lda hFILE`
`>SYSCALL fgets`
**Out:**
## RETURN VALUE
Y,A: s
CC = success
@ -752,7 +798,8 @@ Get char from StdIn
## ASM
**In:**
`>SYSCALL getchar`
**Out:**
## RETURN VALUE
CC = success
A = char
@ -766,7 +813,8 @@ Get char from Node
**In:**
`lda stream`
`>SYSCALL getc`
**Out:**
## RETURN VALUE
CC = success
A = char
@ -795,7 +843,8 @@ Read formatted data from string
TODO : %10s
`>LDYA s`
`>SYSCALL sscanf`
**Out:**
## RETURN VALUE
A = Number of arguments filled.
# FOpen
@ -825,7 +874,8 @@ TODO: replace flags/ftype/auxtype with mode="w+,t=TYP,x=AUXTYPE"
+ ,t=123 or t=$ff or t=TXT
+ ,x=12345 or x=$ffff
`>LDYAI filename`
**Out:**
## RETURN VALUE
CC : A = hFILE
CS : A = EC
@ -839,7 +889,8 @@ int fclose ( hFILE stream );
**In:**
`lda stream`
`>SYSCALL fclose`
**Out:**
## RETURN VALUE
# FRead
Read bytes from file
@ -853,7 +904,8 @@ int fread (hFILE stream, void * ptr, int count );
`>PUSHW ptr`
`lda stream`
`>SYSCALL fread`
**Out:**
## RETURN VALUE
Y,A = Bytes Read
# FWrite
@ -868,7 +920,8 @@ Write bytes to file
`>PUSHW ptr`
`lda stream`
`>SYSCALL fwrite`
**Out:**
## RETURN VALUE
Y,A = Bytes Written
# FFlush
@ -904,7 +957,8 @@ Test the end-of-file indicator for hFILE
**In:**
`lda stream`
`>SYSCALL feof`
**Out:**
## RETURN VALUE
CC :
A=0 EOF
A =0 NOT EOF
@ -920,7 +974,8 @@ Return the current value of the file-position indicator
**In:**
`lda stream`
`>SYSCALL ftell`
**Out:**
## RETURN VALUE
On stack (long)
# Remove
@ -933,7 +988,8 @@ int remove(const char *pathname);
**In:**
`>LDYA pathname`
`>SYSCALL remove`
**Out:**
## RETURN VALUE
# Rename
Rename a file
@ -946,7 +1002,8 @@ Rename a file
`>PUSHW newpath`
`>LDYA oldpath`
`>SYSCALL rename`
**Out:**
## RETURN VALUE
# strtof
Convert String to 40 bits Float
@ -959,7 +1016,8 @@ Convert String to 40 bits Float
`>PUSHWI EndPtr`
`>LDYA str`
`>SYSCALL strtof`
**Out:**
## RETURN VALUE
On stack (float)
# AToF
@ -972,7 +1030,8 @@ Convert String to 40 bits Float
**In:**
`>LDYA str`
`>SYSCALL atof`
**Out:**
## RETURN VALUE
On stack (float)
# StrToL/StrToUL
@ -988,7 +1047,8 @@ Convert String to 32 bits (unsigned) int
`>PUSHWI EndPtr`
`>LDYAI str`
`>SYSCALL strtol`
**Out:**
## RETURN VALUE
On stack (long)
# atol
@ -1001,7 +1061,8 @@ Convert String to 32 bits long
**In:**
`>LDYA str`
`>SYSCALL atol`
**Out:**
## RETURN VALUE
On stack (long)
# atoi
@ -1014,7 +1075,8 @@ Convert String to 16 bits int
**In:**
`>LDYAI str`
`>SYSCALL atoi`
**Out:**
## RETURN VALUE
Y,A = int
# RealPath
@ -1027,7 +1089,8 @@ Return the canonicalized absolute pathname
**In:**
`>LDYA str`
`>SYSCALL realpath`
**Out:**
## RETURN VALUE
CC : success
Y,A = Ptr to Full Path (C-String)
X = hMem of Full Path
@ -1040,10 +1103,10 @@ Returns Length of C-String
`int strlen ( char * str);`
## ASM
**In:**
`>LDYAI str`
`>SYSCALL strlen`
**Out:**
## RETURN VALUE
Y,A = String length
# StrCat
@ -1057,7 +1120,8 @@ Concatenate strings
`>PUSHWI source`
`>LDYAI destination`
`>SYSCALL strcat`
**Out:**
## RETURN VALUE
Y,A = destination
# StrCpy
@ -1071,7 +1135,8 @@ Copy string
`>PUSHWI source`
`>LDYAI destination`
`>SYSCALL strcpy`
**Out:**
## RETURN VALUE
Y,A = destination
# StrMatch
@ -1085,7 +1150,8 @@ Compare a String against pattern (e.g. '*test?.txt')
`>PUSHWI pattern`
`>LDYAI s`
`>SYSCALL strmatch`
**Out:**
## RETURN VALUE
CC : match
CS : no match
@ -1101,7 +1167,8 @@ Convert string to UPPERCASE/lowercase
`>LDYAI str`
`>SYSCALL strupr`
`>SYSCALL strlwr`
**Out:**
## RETURN VALUE
Uppercased/lowercased String in Buffer
Y,A = str
@ -1116,7 +1183,8 @@ Compare 2 strings
`>PUSHWI s2`
`>LDYAI s1`
`>SYSCALL strcmp`
**Out:**
## RETURN VALUE
CC : match
CS : no match
CC, Y,A=0
@ -1133,7 +1201,8 @@ Compare 2 strings, ignoring case
`>PUSHWI s2`
`>LDYAI s1`
`>SYSCALL strcasecmp`
**Out:**
## RETURN VALUE
CC : match
CS : no match
CC, Y,A=0
@ -1146,9 +1215,10 @@ Get System Time in Buffer
`time_t time (S.TIME* timer);`
## ASM
**In:**
Y,A = PTR to S.TIME
**Out:**
`>LDYA timer`
`>SYSCALL time`
## RETURN VALUE
S.TIME filled with System date/time
# PTime2Time
@ -1158,11 +1228,11 @@ S.TIME filled with System date/time
`int PTime2Time (long* ptime, S.TIME* timer);`
## ASM
**In :**
`>PUSHW timer`
`>LDYA ptime`
`>SYSCALL PTime2Time`
**Out:**
## RETURN VALUE
# CTime2Time
Convert CTime Time To S.TIME
@ -1171,22 +1241,21 @@ S.TIME filled with System date/time
`int CTime2Time (long* ctime, S.TIME* timer);`
## ASM
**In :**
`>PUSHW timer`
`>LDYA ctime`
`>SYSCALL CTime2Time`
**Out:**
## RETURN VALUE
# StrFTime
## C
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, const char* format, const struct S.TIME* timeptr );`
## ASM
**In:**
PUSHW = Dst PTR To CSTR Buf
PUSHW = Src PTR To Format String
`PUSHW timeptr`
`PUSHW format`
+ %a : Abbreviated weekday name : Thu
+ %A : Full weekday name : Thursday
+ %b : Abbreviated month name : Aug
@ -1202,6 +1271,8 @@ PUSHW = Src PTR To Format String
+ %y : Year, last two digits (00-99)
+ %Y : Year four digits 2001
PUSHW = Src PTR To S.Time
**Out:**
`>LDYA ptr`
`>SYSCALL strftime`
## RETURN VALUE
none. always succeed.

View File

@ -11,7 +11,8 @@ int getprodoscatsize (short int options, short int catsize, int devsize );
PUSHW = DevSize (in 512b blocks)
PUSHB = Catalog Size (in blocks)
PUSHB = Options
**Out:**
## RETURN VALUE
X=BlockCount (max 22)
Y,A=BufSize (max $4400)
@ -37,7 +38,8 @@ Write a track (16 sectors)
PUSHW = Ptr to 16*256 buffer
PUSHB = TrackNum * 4 : 0->140+
PUSHB = DSSS0000
**Out:**
## RETURN VALUE
CC : success
CS : A = Error
A=0, currently starting/seeking...
@ -48,7 +50,8 @@ Write a track (NIBBLE)
PUSHW = Ptr to NIBBLE buffer (0 ended)
PUSHB = TrackNum * 4 : 0->140+
PUSHB = DSSS0000
**Out:**
## RETURN VALUE
CC : success
CS : A = Error
A=0, currently starting/seeking...

View File

@ -10,7 +10,8 @@ Return MD5 Hash for input String
**In:**
`>PUSHW digest`
`>LDYA str`
**Out:**
## RETURN VALUE
CC
## MD5Init
@ -21,7 +22,8 @@ Initialize a MD5 computation
# ASM
**In:**
**Out:**
## RETURN VALUE
A = hMem To S.MD5
## MD5Update
@ -35,7 +37,8 @@ Add Data to MD5 computation
`>PUSHW len`
`>PUSHW data`
`>LDA.G md5`
**Out:**
## RETURN VALUE
## MD5Finalize
@ -46,4 +49,5 @@ Add Data to MD5 computation
**In:**
`>PUSHW digest`
`>LDA.G md5`
**Out:**
## RETURN VALUE

View File

@ -3,14 +3,16 @@
# ARP.Clear
Clear ARP Cache
**In:**
**Out:**
## RETURN VALUE
# ARP.Query
Query ARP Cache and returns HW address
**In:**
PUSHW PTR to MAC (to fill)
PUSHW PTR to IP
**Out:**
## RETURN VALUE
CC: hit: MAC filled
CS: missed
@ -23,20 +25,23 @@
# ARP.GetCache
Return a Ptr to ARP Cache Table
**In:**
**Out:**
## RETURN VALUE
Y,A = PTR to ARP.CACHE
# DNS.Clear
Clear DNS Cache
**In:**
**Out:**
## RETURN VALUE
# DNS.Query
Query DNS for specified host
**In:**
PUSHW = PTR to IP to fill with cached data
* PUSHW = hostname PTR to PSTR
**Out:**
## RETURN VALUE
CC: hit: IP filled with address
CS: missed
@ -49,7 +54,8 @@
# DNS.GetCAche
Return a Ptr to DNS Cache Table
**In:**
**Out:**
## RETURN VALUE
Y,A = PTR to DNS.CACHE
# Socket
@ -63,7 +69,8 @@ Create a new socket
`>PUSHB protocol`
`lda type`
`>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
**Out:**
## RETURN VALUE
CC: A = hSOCKET
CS: A = EC
@ -78,7 +85,8 @@ bind a name to a socket
`>PUSHW addr`
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
**Out:**
## RETURN VALUE
CC: A = hSOCKET
CS: A = EC
@ -93,7 +101,8 @@ Iinitiate a connection on a socket
`>PUSHW addr`
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
**Out:**
## RETURN VALUE
CC: A = hSOCKET
CS: A = EC
@ -107,7 +116,8 @@ Listen for connections on a socket
**In:**
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.listen`
**Out:**
## RETURN VALUE
CS: A = EC
# Accept
@ -120,7 +130,8 @@ Accept a connection on a socket
**In:**
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.accept`
**Out:**
## RETURN VALUE
A = hSocket
# Shutdown
@ -133,7 +144,8 @@ Close socket
**In:**
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.shutdown`
**Out:**
## RETURN VALUE
# Read (STREAM)
@ -146,7 +158,8 @@ Close socket
`>PUSHW buf`
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.read`
**Out:**
## RETURN VALUE
CC: Y,A = bytes read
CS: A = EC
@ -161,7 +174,8 @@ CS: A = EC
`>PUSHW buf`
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.write`
**Out:**
## RETURN VALUE
CC: Y,A = bytes written
CS: A = EC
@ -178,7 +192,8 @@ CS: A = EC
`>PUSHW addr` (RecvFrom)
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.Recv`
**Out:**
## RETURN VALUE
CC: A = hMem
CS: A = EC
@ -197,7 +212,8 @@ CS: A = EC
`>PUSHW buf`
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.send`
**Out:**
## RETURN VALUE
CC: Y,A = bytes written
CS: A = EC
@ -210,4 +226,5 @@ Get socket table
## ASM
**In:**
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.GetTable`
**Out:**
## RETURN VALUE

Binary file not shown.

Binary file not shown.

View File

@ -343,8 +343,6 @@ CS.RUN.PUSHDATES
lda (ZPFileStat),y
beq .1 Month=0.....invalid date/time
>PUSHEA.G TIME.Mod
>PUSHW L.FMT.DateTime
lda ZPFileStat
clc
adc #S.STAT.MTIME
@ -352,14 +350,14 @@ CS.RUN.PUSHDATES
lda ZPFileStat+1
adc #0
>PUSHYA
>PUSHW L.FMT.DateTime
>LEA.G TIME.Mod
>SYSCALL StrFTime
.1 ldy #S.STAT.CTIME+S.TIME.MONTH
lda (ZPFileStat),y
beq .2 Month=0.....invalid date/time
>PUSHEA.G TIME.Create
>PUSHW L.FMT.DateTime
lda ZPFileStat
clc
adc #S.STAT.CTIME
@ -367,6 +365,8 @@ CS.RUN.PUSHDATES
lda ZPFileStat+1
adc #0
>PUSHYA
>PUSHW L.FMT.DateTime
>LEA.G TIME.Create
>SYSCALL StrFTime
.2 >PUSHEA.G TIME.Mod

View File

@ -5,11 +5,13 @@ AUTO 4,1
K.VER .EQ $5C00 92.0
K.ENV.SIZE .EQ 256
K.PIPE.SIZE .EQ 256
*--------------------------------------
K.IRQDEV.MAX .EQ 4
K.DEV.MAX .EQ 32
K.NOD.MAX .EQ 32
K.PS.MAX .EQ 32
K.FLT.MAX .EQ 4
K.EVT.MAX .EQ 4
K.DEV.MAX .EQ 32
K.NOD.MAX .EQ 64
K.PS.MAX .EQ 32
*--------------------------------------
ZPDRV .EQ $20 32 bytes
ZPLIB .EQ $40 32 bytes

View File

@ -99,19 +99,15 @@ K.STACKTOP .EQ $03ED XFer !!! down to $3E0
*--------------------------------------
* free $0C00->$17FF = $C00 (3072) Aux
*--------------------------------------
Dev.Table.hFD .EQ $0C00 K.Dev.MAX
Dev.Table.F .EQ $0C20 K.Dev.MAX
Dev.Table.pFDLO .EQ $0C40 K.Dev.MAX
Dev.Table.pFDHI .EQ $0C60 K.Dev.MAX
Dev.Table.hPath .EQ $0C00 K.Dev.MAX
Dev.Table.hFD .EQ $0C20 K.Dev.MAX
*--------------------------------------
* Nod (Opened files)
Nod.Table.hPath .EQ $0C40 K.NOD.MAX
Nod.Table.hFD .EQ $0C60 K.NOD.MAX
*--------------------------------------
Nod.Table.hPath .EQ $0C80 K.NOD.MAX
Nod.Table.hFD .EQ $0CC0 K.NOD.MAX
*--------------------------------------
PS.Table.hMem .EQ $0D00 K.PS.MAX
PS.Table.PID .EQ $0D20 K.PS.MAX
PS.Table.Stat .EQ $0D40 K.PS.MAX
PS.Table.hMem .EQ $0C80 K.PS.MAX
PS.Table.PID .EQ $0CA0 K.PS.MAX
PS.Table.Stat .EQ $0CC0 K.PS.MAX*2
*--------------------------------------
Evt.Table .EQ $0D60 K.EVT.MAX*S.EVT.SIZE=4*8=32b
*--------------------------------------

View File

@ -86,7 +86,7 @@ LIB.UNLOAD clc
* PUSHW = DevSize (in 512b blocks)
* PUSHB = Catalog Size (in blocks)
* PUSHB = Options
* **Out:**
* ## RETURN VALUE
* X=BlockCount (max 22)
* Y,A=BufSize (max $4400)
*\--------------------------------------
@ -298,7 +298,7 @@ D2TrkR16s
* PUSHW = Ptr to 16*256 buffer
* PUSHB = TrackNum * 4 : 0->140+
* PUSHB = DSSS0000
* **Out:**
* ## RETURN VALUE
* CC : success
* CS : A = Error
* A=0, currently starting/seeking...
@ -314,7 +314,7 @@ D2TrkW16s
* PUSHW = Ptr to NIBBLE buffer (0 ended)
* PUSHB = TrackNum * 4 : 0->140+
* PUSHB = DSSS0000
* **Out:**
* ## RETURN VALUE
* CC : success
* CS : A = Error
* A=0, currently starting/seeking...

View File

@ -119,7 +119,7 @@ LIB.UNLOAD clc
* **In:**
* `>PUSHW digest`
* `>LDYA str`
* **Out:**
* ## RETURN VALUE
* CC
*\--------------------------------------
MD5 >STYA ZPDataPtr
@ -149,7 +149,7 @@ MD5 >STYA ZPDataPtr
* `HANDLE md5init ();`
* # ASM
* **In:**
* **Out:**
* ## RETURN VALUE
* A = hMem To S.MD5
*\--------------------------------------
MD5Init >LDYAI S.MD5
@ -186,7 +186,7 @@ MD5Init >LDYAI S.MD5
* `>PUSHW len`
* `>PUSHW data`
* `>LDA.G md5`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
MD5Update >SYSCALL GetMemPtr get MD5 Context
>STYA ZPCtxPtr
@ -272,7 +272,7 @@ MD5Update.I ldy #S.MD5.FINALIZED
* **In:**
* `>PUSHW digest`
* `>LDA.G md5`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
MD5Finalize >PULLA
pha

View File

@ -6,7 +6,7 @@ AUTO 4,1
* # ARP.Clear
* Clear ARP Cache
* **In:**
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
ARP.Clear ldx #K.ARPCACHE.SIZE*S.ARPCACHE
.1 stz ARP.CACHE-1,x
@ -20,7 +20,7 @@ ARP.Clear ldx #K.ARPCACHE.SIZE*S.ARPCACHE
* **In:**
* PUSHW PTR to MAC (to fill)
* PUSHW PTR to IP
* **Out:**
* ## RETURN VALUE
* CC: hit: MAC filled
* CS: missed
*\--------------------------------------
@ -90,7 +90,7 @@ ARP.ADD.I sta ARP.TmpCache
* # ARP.GetCache
* Return a Ptr to ARP Cache Table
* **In:**
* **Out:**
* ## RETURN VALUE
* Y,A = PTR to ARP.CACHE
*\--------------------------------------
ARP.GetCache >LDYA L.ARP.CACHE

View File

@ -6,7 +6,7 @@ AUTO 4,1
* # DNS.Clear
* Clear DNS Cache
* **In:**
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
DNS.Clear ldx #K.DNSCACHE.SIZE*S.DNSCACHE
.1 stz DNS.CACHE-1,x
@ -20,7 +20,7 @@ DNS.Clear ldx #K.DNSCACHE.SIZE*S.DNSCACHE
* **In:**
* PUSHW = PTR to IP to fill with cached data
* PUSHW = hostname PTR to PSTR
* **Out:**
* ## RETURN VALUE
* CC: hit: IP filled with address
* CS: missed
*\--------------------------------------
@ -221,7 +221,7 @@ DNS.ADD.I sta DNS.TmpCache
* # DNS.GetCAche
* Return a Ptr to DNS Cache Table
* **In:**
* **Out:**
* ## RETURN VALUE
* Y,A = PTR to DNS.CACHE
*\--------------------------------------
DNS.GetCAche >LDYA L.DNS.CACHE

View File

@ -12,7 +12,7 @@ AUTO 4,1
* `>PUSHB protocol`
* `lda type`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
* **Out:**
* ## RETURN VALUE
* CC: A = hSOCKET
* CS: A = EC
*\--------------------------------------
@ -110,7 +110,7 @@ SKT.Socket.FindFree
* `>PUSHW addr`
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
* **Out:**
* ## RETURN VALUE
* CC: A = hSOCKET
* CS: A = EC
*\--------------------------------------
@ -150,7 +150,7 @@ SKT.bind >SYSCALL GetMemPtr
* `>PUSHW addr`
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
* **Out:**
* ## RETURN VALUE
* CC: A = hSOCKET
* CS: A = EC
*\--------------------------------------
@ -239,7 +239,7 @@ SKT.connect.99 rts
* **In:**
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.listen`
* **Out:**
* ## RETURN VALUE
* CS: A = EC
*\--------------------------------------
SKT.listen >SYSCALL GetMemPtr
@ -276,7 +276,7 @@ SKT.listen >SYSCALL GetMemPtr
* **In:**
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.accept`
* **Out:**
* ## RETURN VALUE
* A = hSocket
*\--------------------------------------
SKT.Accept >SYSCALL GetMemPtr
@ -322,7 +322,7 @@ SKT.Accept >SYSCALL GetMemPtr
* **In:**
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.shutdown`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
SKT.shutdown >SYSCALL GetMemPtr
>STYA ZPPtrSKT
@ -400,7 +400,7 @@ SKT.shutdown >SYSCALL GetMemPtr
* `>PUSHW buf`
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.skt.read`
* **Out:**
* ## RETURN VALUE
* CC: Y,A = bytes read
* CS: A = EC
*\--------------------------------------
@ -451,7 +451,7 @@ SKT.Read >SYSCALL GetMemPtr
* `>PUSHW buf`
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.skt.write`
* **Out:**
* ## RETURN VALUE
* CC: Y,A = bytes written
* CS: A = EC
*\--------------------------------------
@ -505,7 +505,7 @@ SKT.Write >SYSCALL GetMemPtr
* `>PUSHW addr` (RecvFrom)
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.skt.Recv`
* **Out:**
* ## RETURN VALUE
* CC: A = hMem
* CS: A = EC
*\--------------------------------------
@ -613,7 +613,7 @@ SKT.Recv clc
* `>PUSHW buf`
* `lda fd`
* `>LIBCALL hLIBTCPIP,LIBTCPIP.skt.send`
* **Out:**
* ## RETURN VALUE
* CC: Y,A = bytes written
* CS: A = EC
*\--------------------------------------
@ -676,7 +676,7 @@ SKT.Send.SEQPACKET
* ## ASM
* **In:**
* `>LIBCALL hLIBTCPIP,LIBTCPIP.skt.GetTable`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
SKT.GetTable >LDYA L.SKT.Table
clc

View File

@ -210,7 +210,7 @@ Cmd.Exec.EXT.TXT
lda #0 Get arg[0] = /PATH/SHELL
>SYSCALL GetArg
>PUSHYA
>PUSHYA
>LDYA ZPCMDBuf
>SYSCALL StrCat
@ -227,7 +227,7 @@ Cmd.Exec.EXT.BIN
lda (ZPPTR2) Some ARGS ?
beq .1
jsr Cmd.Exec.EXT.SEP Add a space....
>PUSHW ZPPTR2
@ -467,14 +467,15 @@ Cmd.Exec.TIME clc
>LEA.G CMD.Time
>SYSCALL Time
>PUSHW ZPCMDBuf
>PUSHEA.G CMD.Time
plp
bcc .1
>PUSHW L.FMT.DATE
bra .2
.1 >PUSHW L.FMT.TIME
.2 >PUSHEA.G CMD.Time
.2 >LDYA ZPCMDBuf
>SYSCALL StrFTime
>LDYA ZPCMDBuf

View File

@ -6,7 +6,7 @@ AUTO 4,1
* ## ASM
* **In:**
* A = argument index.
* **Out:**
* ## RETURN VALUE
* CC : success
* Y,A = PTR To Arg[A]
* CS : Out Of Bound

View File

@ -69,7 +69,7 @@ K.UnloadLib pha
* ## ASM
* **In:**
* Y,A = PTR to "NAME.DRV [PARAM]" C-String
* **Out:**
* ## RETURN VALUE
* none
*\--------------------------------------
K.LoadDrv >STYA .2+1 Save "BIN\0ARGS\0\0"
@ -295,7 +295,7 @@ BIN.hMem .BS 1
* `>PUSHW DRV.CS.START`
* `>LDYA L.SRC`
* `SYSCALL insdrv`
* **Out:**
* ## RETURN VALUE
* Y,A = Ptr to installed driver
*\--------------------------------------
K.InsDrv >STYA ZPPtr1

View File

@ -3,9 +3,8 @@ PREFIX /A2OSX.BUILD
AUTO 4,1
*/--------------------------------------
* # GetDevByID
* **In:**
* A = DevID
* **Out:**
* ## RETURN VALUE
* CC = OK, CS = ERROR
* Y,A = FD
* X = hFD
@ -15,19 +14,15 @@ K.GetDevByID cmp DevMgr.DevCnt
tax
lda Dev.Table.hFD,x
beq K.GetDev.NODEV
pha
ldy Dev.Table.pFDLO,x
lda Dev.Table.pFDHI,x
jsr K.GetMemPtr
plx
* clc
.9 rts CC
rts
*/--------------------------------------
* # GetDevByName
* **In:**
* Y,A = Ptr to device name (C-String)
* **Out:**
* ## RETURN VALUE
* CC = OK, CS = ERROR
* Y,A = FD
* X = DevID
@ -36,8 +31,9 @@ K.GetDevByName >STYA ZPPtr1
ldx #0
.1 ldy Dev.Table.pFDLO,x
lda Dev.Table.pFDHI,x
.1 lda Dev.Table.hFD,x
beq K.GetDev.NODEV
jsr K.GetMemPtr
>STYA ZPPtr2
@ -47,7 +43,7 @@ K.GetDevByName >STYA ZPPtr1
sta ZPPtr3
lda ZPPtr2+1
adc #0
adc /S.FD.DEV.NAME
sta ZPPtr3+1
ldy #$ff
@ -77,11 +73,10 @@ K.GetDev.9 rts
* ## C
* `int getdevstatus(short int hFD, S.DIB* dstat);`
* ## ASM
* **In:**
* `>PUSHWI S.DIB`
* `lda DevID`
* `>SYSCALL GetDevStatus`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.GetDevStatus jsr K.GetMemPtr
>STYA pFD
@ -104,10 +99,9 @@ K.GetDevStatus.I
* ## C
* `hDEV mkdev (S.FD * fd)`
* ## ASM
* **In:**
* `>LDYA FD.DEV`
* `>SYSCALL mkdev
* **Out:**
* ## RETURN VALUE
* A = hDEV
*\--------------------------------------
K.MKDev >STYA .1+1
@ -121,13 +115,9 @@ K.MKDev >STYA .1+1
jsr MEM.GetMem.YAX
bcs .99
>STYA pFD
phx
txa
ldx DevMgr.DevCnt
sta Dev.Table.pFDHI,x
tya
sta Dev.Table.pFDLO,x
pla
sta Dev.Table.hFD,x
ldy #S.FD.DEV-1
@ -145,17 +135,33 @@ K.MKDev >STYA .1+1
jsr K.GetDevStatus.I
bcs .99
lda K.IOBuf
ldx DevMgr.DevCnt
sta Dev.Table.F,x
lda K.IOBuf Get Status byte
bit #S.DIB.S.IRQ
beq .8
txa
inc DevMgr.DevCnt
rts
ldx #0
.2 lda IRQ.Vectors+1,x
beq .3
inx
inx
cpx #K.IRQDEV.MAX*2
bne .2
.9 lda #K.E.OOH
* sec
.99 rts
.3 lda pFD
sta IRQ.Vectors,x
lda pFD+1
sta IRQ.Vectors+1,x
.8 lda DevMgr.DevCnt
inc DevMgr.DevCnt
clc
rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.DEV

View File

@ -6,10 +6,9 @@ AUTO 4,1
* ## C
* `int hDIR opendir (const char * dirpath);`
* ## ASM
* **In:**
* `>LDYA dirpath`
* `>SYSCALL opendir`
* **Out:**
* ## RETURN VALUE
* CC : success
* A = hDIR
* CS : error
@ -68,11 +67,10 @@ K.OpenDir jsr PFT.CheckPathYA
* ## C
* `int readdir (int hDIR, S.DIRENT * dirent);`
* ## ASM
* **In:**
* `>PUSHW dirent`
* `lda hDIR`
* `>SYSCALL readdir`
* **Out:**
* ## RETURN VALUE
* CC : success
* X = hDIRENT
* Y,A = PTR to S.DIRENT
@ -605,10 +603,9 @@ K.ReadDir.ConvertTime
* ## C
* `void closedir(hDIR);`
* ## ASM
* **In:**
* `lda hDIR`
* `>SYSCALL closedir`
* **Out:**
* ## RETURN VALUE
* none, always succeed.
*\-------------------------------------
*K.CloseDir .EQ K.FClose

View File

@ -5,7 +5,7 @@ AUTO 4,1
* # ExpandStr
* **In:**
* Y,A = PTR to String to Expand (C-String)
* **Out:**
* ## RETURN VALUE
* X = hMem to Expanded String (C-String)
* Y,A = PTR to Expanded String
*\--------------------------------------
@ -133,7 +133,7 @@ K.ExpandStr stz .88+1 Reset Intermediate string...
* `>PUSHWI fullpath`
* `>PUSHWI searchpath`
* `>LDYAI filename`
* **Out:**
* ## RETURN VALUE
* CC : success
* DstBuf = FilePath
* DstStat = S.STAT
@ -232,7 +232,7 @@ K.FileSearch.SearchPath .BS 2
* **In:**
* `>LDYA string`
* `>SYSCALL putenv`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.PutEnv >STYA ZPPtr1 NAME=VALUE
@ -275,10 +275,9 @@ K.PutEnv >STYA ZPPtr1 NAME=VALUE
* `>PUSHW value`
* `>LDYA name`
* `>SYSCALL setenv`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.SetEnv >STYA ZPPtr1 name
>PULLW ZPPtr2 value
K.SetEnv jsr MEM.SPtr1PPtr2
K.SetEnv.I jsr K.UnsetEnv.I
@ -385,8 +384,8 @@ K.SetEnv.I jsr K.UnsetEnv.I
* ## ASM
* **In:**
* `>LDYA name`
* `>SYSCALL gerenv`
* **Out:**
* `>SYSCALL getenv`
* ## RETURN VALUE
* CC : Y,A = PTR to VALUE (C-String)
* CS : not found
*\--------------------------------------
@ -408,7 +407,7 @@ K.GetEnv >STYA ZPPtr1
* **In:**
* `>LDYA name`
* `>SYSCALL unsetenv`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.UnsetEnv >STYA ZPPtr1 Store VAR Name
K.UnsetEnv.I jsr ENV.FindVarP1

View File

@ -6,7 +6,7 @@ AUTO 4,1
* Load TXT a file in memory (with ending 0)
* **In:**
* Y,A = File Path
* **Out:**
* ## RETURN VALUE
* Y,A = File Length (without ending 0)
* X = hMem of Loaded File
*\--------------------------------------
@ -25,7 +25,7 @@ K.LoadTxtFile pha
* PUSHB = TYPE ...
* PUSHB = MODE ...
* LDYA = PATH ...FOpen)
* **Out:**
* ## RETURN VALUE
* Y,A = File Length
* X = hMem of Loaded File
*\--------------------------------------
@ -121,7 +121,7 @@ FIO.Mem .BS 2
* `>PUSHBI filetype`
* `>LDYA filepath`
* `>SYSCALL chtyp`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.ChTyp jsr PFT.CheckPathYA
jsr STDIO.SetMLIPathYA

View File

@ -10,7 +10,7 @@ AUTO 4,1
* `>PUSHB flags`
* `>LDYA pathname`
* `>SYSCALL open`
* **Out:**
* ## RETURN VALUE
* A = hFD
* REG File created on ProDOS : T=TXT,X=$0000
*\--------------------------------------
@ -238,7 +238,7 @@ IO.CLOSE.PIPE clc
* `>PUSHW buf`
* `lda fd`
* `>SYSCALL read`
* **Out:**
* ## RETURN VALUE
* CC: Y,A = bytes read
* CS: A = EC
*\--------------------------------------
@ -267,7 +267,7 @@ IO.Read.I lda (pFD) #S.FD.T
* `>PUSHW buf`
* `lda fd`
* `>SYSCALL write`
* **Out:**
* ## RETURN VALUE
* CC: Y,A = bytes written
* CS: A = EC
*\--------------------------------------
@ -402,12 +402,11 @@ IO.WRITE.PIPE >PULLW K.S.IOCTL+S.IOCTL.BUFPTR
* ## C
* `int ioctl(short int hFD, int request, void * param );`
* ## ASM
* **In:**
* `PUSHWI param`
* `PUSHBI request`
* `lda hFD`
* `>SYSCALL IOCTL`
* **Out:**
* ## RETURN VALUE
* Y,A = ...
*\--------------------------------------
K.IOCTL jsr K.GetMemPtr
@ -440,7 +439,6 @@ K.IOCTL.pDrvJmp jmp (pDrv)
* ## C
* `int pipe(int pipefd[2]);`
* ## ASM
* **In:**
*\--------------------------------------
K.Pipe
.9 sec

View File

@ -190,14 +190,12 @@ K.IrqH.Switch inc IRQ.Tick
*--------------------------------------
K.IrqH.DEV ldx #0
.1 lda Dev.Table.F,x
and #S.DIB.S.IRQ
beq .2
.1 lda IRQ.Vectors+1,x
beq .9
lda Dev.Table.pFDLO,x
sta $fe
lda Dev.Table.pFDHI,x
sta $ff
lda IRQ.Vectors,x
sta $fe
ldy #S.FD.DEV.DRVPTR
lda ($fe),y
@ -215,15 +213,18 @@ K.IrqH.DEV ldx #0
bcc .8 CC, IRQ cleared by device
.2 inx
inx
.3 cpx DevMgr.DevCnt
.3 cpx #K.IRQDEV.MAX*2
bne .1
sec
.9 sec
.8 clv clear V (no task switching)
rts
*--------------------------------------
IRQ.Vectors .BS K.IRQDEV.MAX*2
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.IRQ
LOAD /A2OSX.SRC/SYS/KERNEL.S

View File

@ -13,7 +13,7 @@ AUTO 4,1
* `>SYSCALL fmult`
* `>SYSCALL fdiv`
* `>SYSCALL fpwr`
* **Out:**
* ## RETURN VALUE
* On stack (float)
*\--------------------------------------
K.FAdd ldx #ROM.FADD
@ -47,7 +47,7 @@ K.FPwr ldx #ROM.PWR
* **In:**
* `>PUSHF x (Float)`
* `>SYSCALL log`
* **Out:**
* ## RETURN VALUE
* On stack (Float)
*\--------------------------------------
K.Log ldx #ROM.LOG
@ -77,7 +77,7 @@ K.ATan ldx #ROM.ATAN
* ## ASM
* **In:**
* `>PUSHL X` (long)
* **Out:**
* ## RETURN VALUE
* On stack (float)
*\--------------------------------------
K.Float ldx #4
@ -116,7 +116,7 @@ MATH.Go jsr GP.ROMCALL
* **In:**
* `>PUSHF x`
* `>SYSCALL lrintf`
* **Out:**
* ## RETURN VALUE
* On stack (long)
*\--------------------------------------
K.lrintf jsr MATH.PullFAC

View File

@ -12,9 +12,8 @@ ZPSListKeyPtr .EQ ZPMEMMGR+12
ZPSListDataPtr .EQ ZPMEMMGR+14
*/--------------------------------------
* # GetMem0
* **In:**
* Y,A = Size Requested
* **Out:**
* ## RETURN VALUE
* CC : success
* YA = PTR to Mem (ZERO Initialised)
* X = hMem
@ -25,9 +24,8 @@ K.GetMem0 ldx #S.MEM.F.INIT0
.HS 2C bit abs
*/--------------------------------------
* # GetMem
* **In:**
* Y,A = Size Requested
* **Out:**
* ## RETURN VALUE
* CC : success
* YA = PTR to Mem (Uninitialised)
* X = hMem
@ -233,9 +231,8 @@ Mem.NextSlot lda ZPMemMgrSPtr
.8 rts
*/--------------------------------------
* # FreeMem
* **In:**
* A = hMem To Free
* **Out:**
* ## RETURN VALUE
* none.
* (X unmodified)
*\--------------------------------------
@ -331,9 +328,8 @@ K.FreeMem tay
K.FreeMem.ERR .AZ "FreeMem:%H:hMem already freed."
*/--------------------------------------
* # GetMemPtr
* **In:**
* A = hMem
* **Out:**
* ## RETURN VALUE
* Y,A = PTR to MemBlock
* (X unmodified)
*\--------------------------------------
@ -369,9 +365,8 @@ K.GetMemPtr sta ZPMemMgrSPtr
rts
*/--------------------------------------
* # GetMemByID
* **In:**
* A = hMem
* **Out:**
* ## RETURN VALUE
* Y,A = ZPMemMgrSPtr = PTR to S.MEM
* (X unmodified)
*\--------------------------------------
@ -389,9 +384,8 @@ K.GetMemByID sta ZPMemMgrSPtr
*/--------------------------------------
* # NewStr
* Create a new copy of this C-String
* **In:**
* Y,A = Ptr to source C-String
* **Out:**
* ## RETURN VALUE
* CC : success
* Y,A = PTR to String
* X = hMem (PSTR)
@ -441,22 +435,20 @@ K.NewStr >STYA .1+1
.9 rts
*/--------------------------------------
* # SListGetByID
* **In:**
* PUSHB = hSList
* PUSHW = KeyID
* PUSHW = Data Ptr
* PUSHW = Key Ptr
* **Out:**
* ## RETURN VALUE
* X,Y = Next KeyID
*\--------------------------------------
K.SListGetByID >PULLW ZPSListKeyPtr
*/--------------------------------------
* # SListUpdateByID
* **In:**
* PUSHB = hSList
* PUSHW = KeyID
* PUSHW = Data Ptr
* **Out:**
* ## RETURN VALUE
* A = Key Length
* X,Y = KeyID
*\--------------------------------------
@ -466,22 +458,20 @@ K.SListUpdateByID
bra K.SListPullH
*/--------------------------------------
* # SListAdd
* **In:**
* PUSHB = hSList
* PUSHW = Key Ptr
* PUSHW = Data Ptr
* **Out:**
* ## RETURN VALUE
* A = Key Length
* X,Y = KeyID
*\--------------------------------------
K.SListAdd
*/--------------------------------------
* # SListLookup
* **In:**
* PUSHB = hSList
* PUSHW = Key Ptr
* PUSHW = Data Ptr
* **Out:**
* ## RETURN VALUE
* A = Key Length
* X,Y = KeyID
*\--------------------------------------
@ -492,16 +482,14 @@ K.SListLookup
K.SListPullH >PULLA
*/--------------------------------------
* # SListNew
* **In:**
* **Out:**
* ## RETURN VALUE
* A=hSList
*\--------------------------------------
K.SListNew
*/--------------------------------------
* # SListFree
* **In:**
* A=hSList
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.SListFree
*--------------------------------------
@ -513,10 +501,9 @@ K.SListFree
rts
*/--------------------------------------
* # GetStkObjProp
* **In:**
* A = hObject (AUX Memory)
* Y = Property Index
* **Out:**
* ## RETURN VALUE
* Y,A = Property Value
*\--------------------------------------
K.GetStkObjProp phy
@ -534,9 +521,8 @@ K.GetStkObjProp phy
rts
*/--------------------------------------
* # NewStkObj
* **In:**
* Y,A = Size Requested
* **Out:**
* ## RETURN VALUE
* CC : success
* YA = PTR to Mem (Uninitialised)
* X = hMem
@ -547,9 +533,8 @@ K.NewStkObj ldx #SYS.GetMem
.HS 2C BIT ABS
*/--------------------------------------
* # FreeStkObj
* **In:**
* A = hMem To Free (AUX Memory)
* **Out:**
* ## RETURN VALUE
* none.
* (X,Y unmodified)
*\--------------------------------------
@ -568,12 +553,11 @@ MEM.GoStkObj sta SETREADAUX
*/--------------------------------------
* # LoadStkObj
* Load a file in AUX memory (Stock Objects)
* **In:**
* PUSHW = AUXTYPE (Handled by....
* PUSHB = TYPE ...
* PUSHB = MODE ...
* PUSHW = PATH ...FOpen)
* **Out:**
* ## RETURN VALUE
* Y,A = File Length
* X = hMem of Loaded Object in AUX mem
*\--------------------------------------
@ -701,15 +685,6 @@ MEM.TXTPTR.GetNext
inc TXTPTR+1
.9 rts
*--------------------------------------
MEM.PullP1P2P3 sec
.HS 90 bcc
MEM.PullP1P2 clc
>PULLW ZPPtr1
>PULLW ZPPtr2
bcc .9
>PULLW ZPPtr3
.9 rts
*--------------------------------------
MEM.SPtr1PPtr2 >STYA ZPPtr1
>PULLW ZPPtr2
rts

View File

@ -8,7 +8,7 @@ AUTO 4,1
* # CreatePS (Non Blocking)
* **In:**
* Y,A = PTR To Cmd Line
* **Out:**
* ## RETURN VALUE
* A = Child PSID
*\--------------------------------------
K.ExecPSNewEnv ldx #S.PS.F.DUPENV+S.PS.F.HOLD
@ -46,13 +46,26 @@ K.CreatePS ldx #0
*--------------------------------------
PS.Flags .BS 1
PS.CL .BS 2
*/--------------------------------------
* # Exec
* ## C
* `int exec(const char *path, char *const argv[], short int flage);`
* ## ASM
* `>PUSHB flags`
* `>PUSHW argv`
* `>LDYAI path`
* `>SYSCALL exec`
* ## RETURN VALUE
* A = Child PSID
*\--------------------------------------
Exec
*--------------------------------------
* PS.CreateChild
* in :
* out :
* A = PSID
* we cannot use ZPPtrs1 & 2
* because of calling K.NewStr.YA & S.DupEnv.A
* because of calling K.NewStr.YA & PS.Dup
*--------------------------------------
PS.CreateChild ldx #0
@ -180,7 +193,7 @@ PS.CmdLine2Args >STYA ZPPtr1
iny
bne .1 max 255
.2 tya +2 for ending 0 for last string, and endig 0 for array
.2 tya +2 for ending 0 for last string, and ending 0 for array
clc
adc #2
tay
@ -349,6 +362,14 @@ PS.Load jsr BIN.Load Y,A=filename full path
* Out:
* A = hMem to new ENV
*--------------------------------------
PS.DupArgs
*--------------------------------------
* PS.DupEnv
* In:
* A = ENV hMem To Duplicate
* Out:
* A = hMem to new ENV
*--------------------------------------
PS.DupEnv jsr K.GetMemPtr
>STYA ZPPtr1
@ -394,7 +415,7 @@ PS.SetMemOwner lda CORE.LastPSID
* # GetMemStat
* **In:**
* Y,A = Ptr to 24 bytes buffer
* **Out:**
* ## RETURN VALUE
* Buffer filled with memory stats
*\--------------------------------------
K.GetMemStat >STYA ZPMemMgrTmp1
@ -429,7 +450,7 @@ K.GetMemStat >STYA ZPMemMgrTmp1
* # GetPSStatus
* **In:**
* A = PID
* **Out:**
* ## RETURN VALUE
* A = Status Byte
*\--------------------------------------
K.GetPSStatus jsr CORE.GetPSByID
@ -441,7 +462,7 @@ K.GetPSStatus jsr CORE.GetPSByID
* # GetPSStat
* **In:**
* Y,A = Ptr to 24 bytes buffer
* **Out:**
* ## RETURN VALUE
* Buffer filled with PS stats
*\--------------------------------------
K.GetPSStat >STYA ZPPtr1

View File

@ -11,7 +11,7 @@ AUTO 4,1
* `>PUSHW statbuf`
* `lda hFILE`
* `>SYSCALL fstat`
* **Out:**
* ## RETURN VALUE
*--------------------------------------
K.FStat jsr PFT.CheckNodeA
jsr STDIO.GetHFile
@ -32,7 +32,7 @@ K.FStat jsr PFT.CheckNodeA
* `>PUSHW statbuf`
* `>LDYA pathname`
* `>SYSCALL stat`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.Stat jsr PFT.CheckPathYA
K.Stat.I jsr STDIO.SetMLIPathYA
@ -107,7 +107,7 @@ K.Stat.DST .DA #S.STAT.P.TYPE
* `>PUSHW mode`
* `>LDYA pathname`
* `>SYSCALL mkdir`
* **Out:**
* ## RETURN VALUE
* CC : success
* CS : error
* A = EC
@ -144,7 +144,7 @@ K.MKDir.RTS rts
* `>PUSHW mode`
* `>LDYA pathname`
* `>SYSCALL mknod`
* **Out:**
* ## RETURN VALUE
* CC = OK, CS = ERROR
* A = hFILE
*\--------------------------------------
@ -194,7 +194,7 @@ STAT.MKNOD.PIPE
* `>PUSHW mode`
* `>LDYA pathname`
* `>SYSCALL mkfifo`
* **Out:**
* ## RETURN VALUE
* CC = OK, CS = ERROR
* A = hFILE
*\--------------------------------------

View File

@ -21,7 +21,7 @@ BCDBUF .EQ ARG
* `>PUSHB character`
* `lda stream`
* `>SYSCALL fputc`
* **Out:**
* ## RETURN VALUE
* CC = success
*\--------------------------------------
K.FPutC pha
@ -37,7 +37,7 @@ K.FPutC pha
* **In:**
* `lda caracter`
* `>SYSCALL putchar`
* **Out:**
* ## RETURN VALUE
* CC = success
*\--------------------------------------
K.PutChar sta K.IOBuf
@ -63,7 +63,7 @@ K.PutChar.Y lda #0
* ## ASM
* `>LDYAI str`
* `>SYSCALL puts`
* **Out:**
* ## RETURN VALUE
* CC = success
*\--------------------------------------
K.PutS >PUSHYA
@ -92,7 +92,7 @@ K.PutS.RTS rts
* `>PUSHW str`
* `lda stream`
* `>SYSCALL fputs`
* **Out:**
* ## RETURN VALUE
* CC = success
*\--------------------------------------
K.FPutS jsr STDIO.GetHFile
@ -133,7 +133,7 @@ K.FPutS jsr STDIO.GetHFile
* `>PUSHWI format`
* `lda hFILE`
* `>SYSCALL fprintf`
* **Out:**
* ## RETURN VALUE
* CC : success, Y,A = bytes sent
* CS : error, A = code from Output
* Specifiers :
@ -683,7 +683,7 @@ PrintF.Cnt .BS 2
* `>PUSHW s`
* `lda hFILE`
* `>SYSCALL fgets`
* **Out:**
* ## RETURN VALUE
* Y,A: s
* CC = success
*\--------------------------------------
@ -740,7 +740,7 @@ K.FGetS pha save hFILE
* ## ASM
* **In:**
* `>SYSCALL getchar`
* **Out:**
* ## RETURN VALUE
* CC = success
* A = char
*\--------------------------------------
@ -755,7 +755,7 @@ K.GetChar ldy #S.PS.hStdIn
* **In:**
* `lda stream`
* `>SYSCALL getc`
* **Out:**
* ## RETURN VALUE
* CC = success
* A = char
*\--------------------------------------
@ -792,7 +792,7 @@ K.GetC.9 rts
* TODO : %10s
* `>LDYA s`
* `>SYSCALL sscanf`
* **Out:**
* ## RETURN VALUE
* A = Number of arguments filled.
*\--------------------------------------
K.SScanF >STYA ZPPtr2 String to Scan
@ -966,7 +966,7 @@ K.SScanF.Fwd tya Y=char count parsed
* + ,t=123 or t=$ff or t=TXT
* + ,x=12345 or x=$ffff
* `>LDYAI filename`
* **Out:**
* ## RETURN VALUE
* CC : A = hFILE
* CS : A = EC
*\--------------------------------------
@ -1007,7 +1007,7 @@ K.FOpen.RTS rts
* **In:**
* `lda stream`
* `>SYSCALL fclose`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.FClose jsr PFT.CheckNodeA
tax
@ -1036,7 +1036,7 @@ K.FClose.RTS rts
* `>PUSHW ptr`
* `lda stream`
* `>SYSCALL fread`
* **Out:**
* ## RETURN VALUE
* Y,A = Bytes Read
*\--------------------------------------
K.FRead jsr PFT.CheckNodeA
@ -1055,7 +1055,7 @@ K.FRead jsr PFT.CheckNodeA
* `>PUSHW ptr`
* `lda stream`
* `>SYSCALL fwrite`
* **Out:**
* ## RETURN VALUE
* Y,A = Bytes Written
*\--------------------------------------
K.FWrite jsr PFT.CheckNodeA
@ -1158,7 +1158,7 @@ K.FSeek jsr PFT.CheckNodeA
* **In:**
* `lda stream`
* `>SYSCALL feof`
* **Out:**
* ## RETURN VALUE
* CC :
* A=0 EOF
* A !=0 NOT EOF
@ -1202,7 +1202,7 @@ K.FEOF.MARK .BS 3
* **In:**
* `lda stream`
* `>SYSCALL ftell`
* **Out:**
* ## RETURN VALUE
* On stack (long)
*\--------------------------------------
K.FTell jsr PFT.CheckNodeA
@ -1230,7 +1230,7 @@ K.FTell jsr PFT.CheckNodeA
* **In:**
* `>LDYA pathname`
* `>SYSCALL remove`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.Remove jsr PFT.CheckPathYA
jsr STDIO.SetMLIPathYA
@ -1246,7 +1246,7 @@ K.Remove jsr PFT.CheckPathYA
* `>PUSHW newpath`
* `>LDYA oldpath`
* `>SYSCALL rename`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.Rename jsr PFT.CheckPathYA
jsr STDIO.SetMLIPathYA

View File

@ -11,7 +11,7 @@ AUTO 4,1
* `>PUSHWI EndPtr`
* `>LDYA str`
* `>SYSCALL strtof`
* **Out:**
* ## RETURN VALUE
* On stack (float)
*\--------------------------------------
K.strtof >STYA TXTPTR Ptr to source string
@ -34,7 +34,7 @@ K.strtof >STYA TXTPTR Ptr to source string
* **In:**
* `>LDYA str`
* `>SYSCALL atof`
* **Out:**
* ## RETURN VALUE
* On stack (float)
*\--------------------------------------
K.AToF >STYA TXTPTR Ptr to source string
@ -70,7 +70,7 @@ K.AToF.I jsr CHARGOT
* `>PUSHWI EndPtr`
* `>LDYAI str`
* `>SYSCALL strtol`
* **Out:**
* ## RETURN VALUE
* On stack (long)
*\--------------------------------------
K.StrToL sec Signed
@ -101,7 +101,7 @@ K.StrToUL.rts rts
* **In:**
* `>LDYA str`
* `>SYSCALL atol`
* **Out:**
* ## RETURN VALUE
* On stack (long)
*\--------------------------------------
*STDLIB.32 .BS 4 32 bits max
@ -136,7 +136,7 @@ K.AToL.I jsr STDLIB.GetDec
* **In:**
* `>LDYAI str`
* `>SYSCALL atoi`
* **Out:**
* ## RETURN VALUE
* Y,A = int
*\--------------------------------------
K.atoi >STYA ZPPtr2
@ -286,7 +286,7 @@ STDLIB.32.Clear ldx #3
* **In:**
* `>LDYA str`
* `>SYSCALL realpath`
* **Out:**
* ## RETURN VALUE
* CC : success
* Y,A = Ptr to Full Path (C-String)
* X = hMem of Full Path

View File

@ -7,10 +7,9 @@ AUTO 4,1
* ## C
* `int strlen ( char * str);`
* ## ASM
* **In:**
* `>LDYAI str`
* `>SYSCALL strlen`
* **Out:**
* ## RETURN VALUE
* Y,A = String length
*\--------------------------------------
K.StrLen >STYA ZPPtr1
@ -38,7 +37,7 @@ K.StrLen >STYA ZPPtr1
* `>PUSHWI source`
* `>LDYAI destination`
* `>SYSCALL strcat`
* **Out:**
* ## RETURN VALUE
* Y,A = destination
*\--------------------------------------
K.StrCat sec
@ -53,12 +52,11 @@ K.StrCat sec
* `>PUSHWI source`
* `>LDYAI destination`
* `>SYSCALL strcpy`
* **Out:**
* ## RETURN VALUE
* Y,A = destination
*\--------------------------------------
K.StrCpy clc
>STYA ZPPtr1
>PULLW ZPPtr2
jsr MEM.SPtr1PPtr2
bcc .2
@ -92,12 +90,11 @@ K.StrCpy clc
* `>PUSHWI pattern`
* `>LDYAI s`
* `>SYSCALL strmatch`
* **Out:**
* ## RETURN VALUE
* CC : match
* CS : no match
*\--------------------------------------
K.StrMatch >STYA ZPPtr1 s
>PULLW ZPPtr2 pattern
K.StrMatch jsr MEM.SPtr1PPtr2
lda (ZPPtr2) Get pattern 1st byte
beq .8 Match always if empty
@ -172,7 +169,7 @@ K.StrMatch >STYA ZPPtr1 s
* `>LDYAI str`
* `>SYSCALL strupr`
* `>SYSCALL strlwr`
* **Out:**
* ## RETURN VALUE
* Uppercased/lowercased String in Buffer
* Y,A = str
*\--------------------------------------
@ -215,7 +212,7 @@ K.StrLwr ldx #2
* `>PUSHWI s2`
* `>LDYAI s1`
* `>SYSCALL strcmp`
* **Out:**
* ## RETURN VALUE
* CC : match
* CS : no match
* CC, Y,A=0
@ -233,15 +230,14 @@ K.StrCmp sec
* `>PUSHWI s2`
* `>LDYAI s1`
* `>SYSCALL strcasecmp`
* **Out:**
* ## RETURN VALUE
* CC : match
* CS : no match
* CC, Y,A=0
* CS, Y,A > 0 or < 0
*\--------------------------------------
K.StrCaseCmp clc
>STYA ZPPtr1 s1
>PULLW ZPPtr2 s2
jsr MEM.SPtr1PPtr2
ldy #0

View File

@ -14,9 +14,9 @@ DAY0 .EQ 4 day 0 was a thursday
* ## C
* `time_t time (S.TIME* timer);`
* ## ASM
* **In:**
* Y,A = PTR to S.TIME
* **Out:**
* `>LDYA timer`
* `>SYSCALL time`
* ## RETURN VALUE
* S.TIME filled with System date/time
*\--------------------------------------
K.Time >STYA ZPPtr2
@ -30,14 +30,12 @@ K.Time >STYA ZPPtr2
* ## C
* `int PTime2Time (long* ptime, S.TIME* timer);`
* ## ASM
* **In :**
* `>PUSHW timer`
* `>LDYA ptime`
* `>SYSCALL PTime2Time`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.PTime2Time >STYA ZPPtr1
>PULLW ZPPtr2
K.PTime2Time jsr MEM.SPtr1PPtr2
TIME.PTime2TimeP1P2
ldy #1
lda (ZPPtr1),y Get Year
@ -165,14 +163,12 @@ K.ComputeWDAY lda #3 Thursday : 4 (-1 for mod 7)
* ## C
* `int CTime2Time (long* ctime, S.TIME* timer);`
* ## ASM
* **In :**
* `>PUSHW timer`
* `>LDYA ctime`
* `>SYSCALL CTime2Time`
* **Out:**
* ## RETURN VALUE
*\--------------------------------------
K.CTime2Time >STYA ZPPtr1
>PULLW ZPPtr2
K.CTime2Time jsr MEM.SPtr1PPtr2
ldy #3
@ -393,11 +389,10 @@ K.CTime.Year .BS 1
* # StrFTime
* ## C
* 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, const char* format, const struct S.TIME* timeptr );`
* ## ASM
* **In:**
* PUSHW = Dst PTR To CSTR Buf
* PUSHW = Src PTR To Format String
* `PUSHW timeptr`
* `PUSHW format`
* + %a : Abbreviated weekday name : Thu
* + %A : Full weekday name : Thursday
* + %b : Abbreviated month name : Aug
@ -412,11 +407,13 @@ K.CTime.Year .BS 1
* + %w : Weekday as a decimal number with Sunday as 0 (0-6)
* + %y : Year, last two digits (00-99)
* + %Y : Year four digits 2001
* PUSHW = Src PTR To S.Time
* **Out:**
* `>LDYA ptr`
* `>SYSCALL strftime`
* ## RETURN VALUE
* none. always succeed.
*\--------------------------------------
K.StrFTime jsr MEM.PullP1P2P3
K.StrFTime jsr MEM.SPtr1PPtr2
>PULLW ZPPtr3 timeptr
ldy #0
@ -453,7 +450,7 @@ K.StrFTime jsr MEM.PullP1P2P3
bra .1
.8 lda #0 Terminate C string
sta (ZPPtr3)
sta (ZPPtr1)
rts
*--------------------------------------
K.StrFTime.TBL .AS "aAbBdHImMpSwyY"
@ -504,7 +501,7 @@ K.StrFTime.BB ldx #15 full Month....
>STYA ZPPtr4
ldy #S.Time.MONTH
K.StrFTime.STR lda (ZPPtr1),y get required S.Time field value
K.StrFTime.STR lda (ZPPtr3),y get required S.Time field value
tay
beq .9 Illegal value
@ -544,7 +541,7 @@ K.StrFTime.D ldy #S.Time.DAY
K.StrFTime.HH ldy #S.Time.HOUR
bra K.StrFTime.addDecPtr1Y
K.StrFTime.II ldy #S.Time.HOUR
lda (ZPPtr1),y
lda (ZPPtr3),y
cmp #12
bcc .1
sbc #12
@ -554,7 +551,7 @@ K.StrFTime.M ldy #S.Time.MONTH
K.StrFTime.MM ldy #S.Time.MINUTE
bra K.StrFTime.addDecPtr1Y
K.StrFTime.P ldy #S.Time.HOUR
lda (ZPPtr1),y
lda (ZPPtr3),y
cmp #12
bcc .1
lda #'p'
@ -572,7 +569,7 @@ K.StrFTime.YY ldy #S.Time.CENTURY
K.StrFTime.Y ldy #S.Time.YEAR
*--------------------------------------
K.StrFTime.addDecPtr1Y
lda (ZPPtr1),y
lda (ZPPtr3),y
K.StrFTime.addDecA
stz .2+1
@ -606,10 +603,10 @@ K.StrFTime.addDecA
ora #$30
*--------------------------------------
K.StrFTime.addChar
sta (ZPPtr3)
inc ZPPtr3
sta (ZPPtr1)
inc ZPPtr1
bne .8
inc ZPPtr3+1
inc ZPPtr1+1
.8 rts
*--------------------------------------
K.StrFTime.DAY >PSTR "Monday"