A2osX/_Docs/KERNEL.md

224 lines
3.9 KiB
Markdown
Raw Normal View History

2016-10-22 20:52:00 +00:00
*** Auto generated by docgen.cmd ***
2016-10-22 20:59:49 +00:00
2016-10-23 16:27:20 +00:00
#GetArgC
##In:
+ none.
##Out:
+ A = Command line Arg Count (Including /path/cmd)
#GetArgA
##In:
+ none.
##Out:
+ CC : success
+ Y,A = PStr To Arg[A]
+ CS : Out Of Bound
2016-10-23 20:50:23 +00:00
#PrintFYA :
Prints C-Style String
##In:
+ Y,A = PTR to CStr
+ %a : pull 2 bytes to Print Access right String 'drwxrwxrwx'
+ %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 2 bytes PTR to 4 bytes long unsigned DEC 0..4294967295
+ %e : pull 2 bytes PTR to 6 Bytes Real +1.23456789e+12
+ %f : pull 2 bytes PTR to 6 Bytes Real 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 2 bytes PTR to 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
+ \e Print 'ESC' ($1B,27)
+ \n Print CR=13
+ \\ Print \
+ \% Print %
+ Modifiers for len and padding :
+ %d '9' '12'
+ %2d ' 9' '12'
+ %02d '09' '12'
+ %11s 'ABCDEFGH '
+ %011s 'ABCDEFGH000'
+ %2f '3.14'
2016-10-22 20:47:32 +00:00
#FOpen
2016-10-22 20:48:45 +00:00
Open a file
2016-10-22 20:58:29 +00:00
2016-10-22 20:47:32 +00:00
##In :
2016-10-22 20:48:45 +00:00
+ PUSHW = AUXTYPE
+ PUSHB = TYPE
+ PUSHB = MODE
2016-10-23 16:27:20 +00:00
+ SYS.FOPEN.R : if R and exists -> ERROR
+ SYS.FOPEN.W : if W and exists -> CREATE
+ SYS.FOPEN.A : Append
+ SYS.FOPEN.T : Open/Append in Text mode
+ SYS.FOPEN.X : Create if not exists
2016-10-22 20:46:04 +00:00
+ PUSHW = PATH (PSTR)
2016-10-22 20:53:35 +00:00
2016-10-22 20:52:00 +00:00
##Out :
2016-10-22 20:48:45 +00:00
+ CC : A = hFILE
2016-10-22 20:45:19 +00:00
+ CS : A = EC
2016-10-22 20:59:49 +00:00
2016-10-22 20:48:45 +00:00
#FCloseA
Close a file
2016-10-22 20:58:29 +00:00
2016-10-22 20:48:45 +00:00
##In :
+ A = hFILE
2016-10-22 20:58:29 +00:00
2016-10-22 20:48:45 +00:00
##Out :
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#FRead
Read bytes from file
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##In :
+ PULLB = hFILE
+ PULLW = Bytes To Read
+ PULLW = Dest Ptr
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##Out :
+ Y,A = Bytes Read
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#FWrite
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##In:
2016-10-22 20:52:00 +00:00
+ PULLB = hFILE
+ PULLW = Bytes To Write
+ PULLW = Src Ptr
2016-10-22 20:59:49 +00:00
2016-10-23 16:27:20 +00:00
#Out:
2016-10-22 20:52:00 +00:00
+ Y,A = Bytes Written
2016-10-22 20:59:49 +00:00
2016-10-23 16:27:20 +00:00
#FFLUSHA
##In:
+ A = hFILE
#FSEEK
##In:
+ PUSHW = OffsetHi
+ PUSHW = OffsetLo
+ PUSHB = From
+ PUSHB = hFILE
#FTELLA
##In:
+ A = hFILE
##Out:
+ Y,A,X = Offset
#FEOFA
##In:
+ A = hFILE
##Out:
+ CC :
+ A=0 EOF
+ A =0 NOT EOF
+ CS :
#REMOVEYA
#RENAME
Rename a file
##In :
+ PUSHW = New Name
+ PUSHW = Old Name
##Out :
#STAT
Return information about a file
##In :
+ PUSHW = PTR to S.STAT buffer
+ PUSHW = PTR to Filename (PSTR)
##Out :
2016-10-22 20:52:00 +00:00
#NewPStrYA
Create a new copy of PSTR
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##In:
+ Y,A = PTR to buffer
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##Out:
+ CC : success
+ Y,A = PTR to String
+ X = hMem (PSTRING)
+ CS : error
+ A = SYS error code
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#PStrMatch
Compare a String against pattern
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##In:
+ PUSHW = PTR to Pattern (e.g. '*test?.txt')
+ PUSHW = PTR to Src String
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##Out:
+ CC : match
+ CS : no match
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#PStrUprYA/PStrLwrYA
Convert string to UPPERCASE/lowercase
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##In:
+ Y,A = PTR to String (PSTRING)
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##Out:
+ Uppercased/lowercased String in Buffer
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#PStrFTime
Convert S.TIME struct to PSTR
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##In:
2016-10-22 20:52:00 +00:00
+ PUSHW = Dst PTR To PSTR Buf
+ PUSHW = Src PTR To Format String
+ %a : Abbreviated weekday name : Thu
+ %A : Full weekday name : Thursday
+ %b : Abbreviated month name : Aug
+ %B : Full month name : August
+ %d : Day of the month, zero-padded (01-31)
+ %H : Hour in 24h format (00-23) 14
+ %I : Hour in 12h format (01-12) 02
+ %m : Month as a decimal number (01-12) 08
+ %M : Minute (00-59) 55
+ %p : AM or PM designation PM
+ %S : Second (00-61) 02
+ %w : Weekday as a decimal number with Sunday as 0 (0-6)
+ %y : Year, last two digits (00-99)
+ %Y : Year four digits 2001
+ PUSHW = Src PTR To S.Time
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##Out:
2016-10-22 20:52:00 +00:00
+ none. always succeed.
2016-10-22 20:59:49 +00:00
2016-10-23 16:27:20 +00:00
#PStr2StrArrayYA
2016-10-22 20:52:00 +00:00
Convert a PSTR (e.g. : command Line) to a Array of PSTRs (Args[])
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##In:
2016-10-22 20:52:00 +00:00
+ Y,A = PTR to String
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##Out:
2016-10-22 20:52:00 +00:00
+ CC : success
+ Y,A = PTR to StrArray
+ X = hMem
+ CS : error
+ A = SYS error code