mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-11 10:29:46 +00:00
Kernel 0.9.2
This commit is contained in:
parent
dc592f1bd3
commit
c179b37d98
@ -167,7 +167,11 @@ Return X+Y, X-Y, X*Y, X/Y, X^Y
|
||||
**In:**
|
||||
`>PUSHF X (float)`
|
||||
`>PUSHF Y (float)`
|
||||
`>SYSCALL fadd
|
||||
`>SYSCALL fadd`
|
||||
`>SYSCALL fsub`
|
||||
`>SYSCALL fmult`
|
||||
`>SYSCALL fdiv`
|
||||
`>SYSCALL fpwr`
|
||||
**Out:**
|
||||
On stack (float)
|
||||
|
||||
@ -190,17 +194,28 @@ Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
||||
**Out:**
|
||||
On stack (Float)
|
||||
|
||||
# Float
|
||||
# float
|
||||
Return 'floated' long
|
||||
**In:**
|
||||
PUSHL = X (long)
|
||||
**Out:**
|
||||
On stack (Float)
|
||||
|
||||
# LRIntF
|
||||
Return Float rounded into a long
|
||||
## C
|
||||
`float f = (float)12345678;
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
PUSHF = X (Float)
|
||||
`>PUSHL X` (long)
|
||||
**Out:**
|
||||
On stack (float)
|
||||
|
||||
# lrintf
|
||||
Return float rounded into a long
|
||||
|
||||
## C
|
||||
`long int lrintf (float x);`
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`>PUSHF x`
|
||||
`>SYSCALL lrintf`
|
||||
**Out:**
|
||||
On stack (long)
|
||||
|
||||
@ -637,7 +652,7 @@ Rename a file
|
||||
PUSHW = Old Name
|
||||
**Out:**
|
||||
|
||||
# StrToF
|
||||
# strtof
|
||||
Convert String to 40 bits Float
|
||||
|
||||
##C
|
||||
@ -660,6 +675,7 @@ Convert String to 40 bits Float
|
||||
## ASM
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
`>SYSCALL atof`
|
||||
**Out:**
|
||||
On stack (float)
|
||||
|
||||
@ -674,12 +690,13 @@ Convert String to 32 bits (unsigned) int
|
||||
**In:**
|
||||
`>PUSHB Base`
|
||||
`>PUSHWI EndPtr`
|
||||
`>LDYA str`
|
||||
`>LDYAI str`
|
||||
`>SYSCALL strtol`
|
||||
**Out:**
|
||||
On stack (long)
|
||||
|
||||
# AToL
|
||||
Convert String to 32 bits int
|
||||
# atol
|
||||
Convert String to 32 bits long
|
||||
|
||||
## C
|
||||
`long atol ( const char * str );`
|
||||
@ -687,24 +704,33 @@ Convert String to 32 bits int
|
||||
## ASM
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
`>SYSCALL atol`
|
||||
**Out:**
|
||||
On stack (long)
|
||||
|
||||
# AToI.YA
|
||||
# atoi
|
||||
Convert String to 16 bits int
|
||||
|
||||
## C
|
||||
`int atoi ( const char * str );`
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
`>LDYA str`
|
||||
`>LDYAI str`
|
||||
`>SYSCALL atoi`
|
||||
**Out:**
|
||||
Y,A = Int
|
||||
Y,A = int
|
||||
|
||||
# RealPath.YA
|
||||
# realpath
|
||||
Return the canonicalized absolute pathname
|
||||
|
||||
## C
|
||||
`unsigned short int realpath (const char* str);`
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
Y,A = Ptr to Relative Filename (C-String)
|
||||
`>LDYA str`
|
||||
`>SYSCALL realpath`
|
||||
**Out:**
|
||||
CC : success
|
||||
Y,A = Ptr to Full Path (C-String)
|
||||
|
@ -2,11 +2,16 @@
|
||||
|
||||
# Pak
|
||||
**In:**
|
||||
|
||||
##ASM
|
||||
PUSHW = Src PTR
|
||||
PUSHW = Src Length
|
||||
PUSHW = Dst PTR Output Buffer
|
||||
PUSHW = Dst PTR S.PAKSTAT
|
||||
UnPak
|
||||
In :
|
||||
|
||||
#UnPak
|
||||
|
||||
##ASM
|
||||
**In:**
|
||||
PUSHW = Src PTR Compressed Buffer
|
||||
PUSHW = Dst PTR
|
||||
|
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
title Kernel DOC generator
|
||||
title A2osX DOC generator
|
||||
COLOR 2A
|
||||
prompt ]
|
||||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
@ -20,11 +20,6 @@ set SRCDIR=%~dp0..\SYS
|
||||
set FILTER=KERNEL.S*.txt
|
||||
Call :SCAN
|
||||
|
||||
set DOCFILE=%~dp0..\.Docs\LIBTCPIP.md
|
||||
set SRCDIR=%~dp0..\LIB
|
||||
set FILTER=LIBTCPIP.S*.txt
|
||||
Call :SCAN
|
||||
|
||||
set DOCFILE=%~dp0..\.Docs\LIBBLKDEV.md
|
||||
set SRCDIR=%~dp0..\LIB
|
||||
set FILTER=LIBBLKDEV.S*.txt
|
||||
@ -35,6 +30,21 @@ set SRCDIR=%~dp0..\LIB
|
||||
set FILTER=LIBCRYPT.S*.txt
|
||||
Call :SCAN
|
||||
|
||||
set DOCFILE=%~dp0..\.Docs\LIBGUI.md
|
||||
set SRCDIR=%~dp0..\LIB
|
||||
set FILTER=LIBGUI.S*.txt
|
||||
Call :SCAN
|
||||
|
||||
set DOCFILE=%~dp0..\.Docs\LIBPAK.md
|
||||
set SRCDIR=%~dp0..\LIB
|
||||
set FILTER=LIBPAK.S*.txt
|
||||
Call :SCAN
|
||||
|
||||
set DOCFILE=%~dp0..\.Docs\LIBTCPIP.md
|
||||
set SRCDIR=%~dp0..\LIB
|
||||
set FILTER=LIBTCPIP.S*.txt
|
||||
Call :SCAN
|
||||
|
||||
echo.
|
||||
echo All done : !c! Files scanned.
|
||||
echo.
|
||||
@ -49,7 +59,6 @@ exit 0
|
||||
|
||||
echo.
|
||||
echo Scanning %FILTER% Files...
|
||||
echo.
|
||||
|
||||
for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do (
|
||||
set FN=%%F
|
||||
|
@ -43,6 +43,7 @@ LIB.UNLOAD clc
|
||||
*/--------------------------------------
|
||||
* # Pak
|
||||
* **In:**
|
||||
* ##ASM
|
||||
* PUSHW = Src PTR
|
||||
* PUSHW = Src Length
|
||||
* PUSHW = Dst PTR Output Buffer
|
||||
@ -495,11 +496,12 @@ Pak.UpdateStats inc Pak.Stat,x
|
||||
inc Pak.Stat+1,x
|
||||
.8 rts
|
||||
*/--------------------------------------
|
||||
* UnPak
|
||||
* In :
|
||||
* #UnPak
|
||||
* ##ASM
|
||||
* **In:**
|
||||
* PUSHW = Src PTR Compressed Buffer
|
||||
* PUSHW = Dst PTR
|
||||
*/--------------------------------------
|
||||
*\--------------------------------------
|
||||
UnZPSrcPtr .EQ ZPLIB
|
||||
UnZPDstPtr .EQ ZPLIB+2
|
||||
UnPak.ShrtTbl .EQ ZPLIB+4
|
||||
|
@ -540,6 +540,6 @@ DevMgr.SYS.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0
|
||||
DevMgr.SYS.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE /A2OSX.SRC/SYS/KERNEL.S.D01
|
||||
SAVE /A2OSX.SRC/SYS/KERNEL.S.DRV
|
||||
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
||||
ASM
|
@ -4,11 +4,17 @@ AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* # FAdd,FSub,FMult,FDiv,FPwr
|
||||
* Return X+Y, X-Y, X*Y, X/Y, X^Y
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHF = X (Float)
|
||||
* PUSHF = Y (Float)
|
||||
* `>PUSHF X (float)`
|
||||
* `>PUSHF Y (float)`
|
||||
* `>SYSCALL fadd`
|
||||
* `>SYSCALL fsub`
|
||||
* `>SYSCALL fmult`
|
||||
* `>SYSCALL fdiv`
|
||||
* `>SYSCALL fpwr`
|
||||
* **Out:**
|
||||
* On stack (Float)
|
||||
* On stack (float)
|
||||
*\--------------------------------------
|
||||
K.FAdd ldx #ROM.FADD
|
||||
.HS 2C BIT ABS
|
||||
@ -29,8 +35,18 @@ K.FPwr ldx #ROM.PWR
|
||||
*/--------------------------------------
|
||||
* # Log,Sqr,Exp,Cos,Sin,Tan,ATan
|
||||
* Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
||||
* ## C
|
||||
* `float log ( float x);`
|
||||
* `float sqr ( float x);`
|
||||
* `float exp ( float x);`
|
||||
* `float cos ( float x);`
|
||||
* `float sin ( float x);`
|
||||
* `float tan ( float x);`
|
||||
* `float atan ( float x);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHF = X (Float)
|
||||
* `>PUSHF x (Float)`
|
||||
* `>SYSCALL log`
|
||||
* **Out:**
|
||||
* On stack (Float)
|
||||
*\--------------------------------------
|
||||
@ -54,12 +70,15 @@ K.ATan ldx #ROM.ATAN
|
||||
plx
|
||||
bra MATH.Go
|
||||
*/--------------------------------------
|
||||
* # Float
|
||||
* # float
|
||||
* Return 'floated' long
|
||||
* ## C
|
||||
* `float f = (float)12345678;
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHL = X (long)
|
||||
* `>PUSHL X` (long)
|
||||
* **Out:**
|
||||
* On stack (Float)
|
||||
* On stack (float)
|
||||
*\--------------------------------------
|
||||
K.Float >PULLW FAC+1
|
||||
>PULLW FAC+3
|
||||
@ -86,14 +105,18 @@ MATH.Go jsr GP.ROMCALL
|
||||
clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # LRIntF
|
||||
* Return Float rounded into a long
|
||||
* # lrintf
|
||||
* Return float rounded into a long
|
||||
* ## C
|
||||
* `long int lrintf (float x);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHF = X (Float)
|
||||
* `>PUSHF x`
|
||||
* `>SYSCALL lrintf`
|
||||
* **Out:**
|
||||
* On stack (long)
|
||||
*\--------------------------------------
|
||||
K.LRIntF jsr MATH.PullFAC
|
||||
K.lrintf jsr MATH.PullFAC
|
||||
|
||||
ldx #ROM.QINT
|
||||
jsr GP.ROMCALL
|
||||
|
@ -10,13 +10,6 @@ ZPSListIBlkPtr .EQ ZPMEMMGR+8
|
||||
ZPSListDBlkPtr .EQ ZPMEMMGR+10
|
||||
ZPSListKeyPtr .EQ ZPMEMMGR+12
|
||||
ZPSListDataPtr .EQ ZPMEMMGR+14
|
||||
*--------------------------------------
|
||||
* TODO :
|
||||
* - Create a 256 bytes table
|
||||
* mapping hMem's to real memory blocks to help
|
||||
* Garbage collector move blocks
|
||||
* - mem.ID=0 always used! useful to test if hMem=0
|
||||
*--------------------------------------
|
||||
*/--------------------------------------
|
||||
* # GetMem0
|
||||
* **In:**
|
||||
|
@ -874,16 +874,19 @@ K.SScanF.GetVAL tya Y=char count parsed
|
||||
*/--------------------------------------
|
||||
* # FOpen
|
||||
* Open a file
|
||||
* ## C
|
||||
* `hFILE fopen ( const char * filename, short int mode, short int ftype, int auxtype );`
|
||||
* **In:**
|
||||
* PUSHW = AUXTYPE
|
||||
* PUSHB = TYPE
|
||||
* PUSHB = MODE
|
||||
* 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
|
||||
* PUSHW = PATH (PSTR)
|
||||
* ## ASM
|
||||
* `>PUSHWI auxtype`
|
||||
* `>PUSHBI ftype`
|
||||
* `>PUSHBI mode`
|
||||
* + 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
|
||||
* `>LDYAI filename`
|
||||
* **Out:**
|
||||
* CC : A = hFILE
|
||||
* CS : A = EC
|
||||
|
@ -2,7 +2,7 @@ NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
*/--------------------------------------
|
||||
* # StrToF
|
||||
* # strtof
|
||||
* Convert String to 40 bits Float
|
||||
* ##C
|
||||
* `float strtof (const char* str, char** endptr);`
|
||||
@ -10,10 +10,11 @@ AUTO 4,1
|
||||
* **In:**
|
||||
* `>PUSHWI EndPtr`
|
||||
* `>LDYA str`
|
||||
* `>SYSCALL strtof`
|
||||
* **Out:**
|
||||
* On stack (float)
|
||||
*\--------------------------------------
|
||||
K.StrToF >STYA TXTPTR Ptr to source string
|
||||
K.strtof >STYA TXTPTR Ptr to source string
|
||||
>PULLW ZPPtr1
|
||||
|
||||
jsr K.AToF.I
|
||||
@ -32,6 +33,7 @@ K.StrToF >STYA TXTPTR Ptr to source string
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>LDYA str`
|
||||
* `>SYSCALL atof`
|
||||
* **Out:**
|
||||
* On stack (float)
|
||||
*\--------------------------------------
|
||||
@ -66,7 +68,8 @@ K.AToF.I jsr CHARGOT
|
||||
* **In:**
|
||||
* `>PUSHB Base`
|
||||
* `>PUSHWI EndPtr`
|
||||
* `>LDYA str`
|
||||
* `>LDYAI str`
|
||||
* `>SYSCALL strtol`
|
||||
* **Out:**
|
||||
* On stack (long)
|
||||
*\--------------------------------------
|
||||
@ -90,13 +93,14 @@ K.StrToUL.Exit adc ZPPtr2
|
||||
|
||||
K.StrToUL.rts rts
|
||||
*/--------------------------------------
|
||||
* # AToL
|
||||
* Convert String to 32 bits int
|
||||
* # atol
|
||||
* Convert String to 32 bits long
|
||||
* ## C
|
||||
* `long atol ( const char * str );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>LDYA str`
|
||||
* `>SYSCALL atol`
|
||||
* **Out:**
|
||||
* On stack (long)
|
||||
*\--------------------------------------
|
||||
@ -124,16 +128,18 @@ K.AToL.I jsr STDLIB.GetDec
|
||||
|
||||
.9 rts
|
||||
*/--------------------------------------
|
||||
* # AToI.YA
|
||||
* # atoi
|
||||
* Convert String to 16 bits int
|
||||
* ## C
|
||||
* `int atoi ( const char * str );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>LDYA str`
|
||||
* `>LDYAI str`
|
||||
* `>SYSCALL atoi`
|
||||
* **Out:**
|
||||
* Y,A = Int
|
||||
* Y,A = int
|
||||
*\--------------------------------------
|
||||
K.AToI.YA >STYA ZPPtr2
|
||||
K.atoi >STYA ZPPtr2
|
||||
lda #10 base 10
|
||||
sec signed
|
||||
|
||||
@ -272,17 +278,21 @@ STDLIB.32.Clear ldx #3
|
||||
bpl .1
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # RealPath.YA
|
||||
* # realpath
|
||||
* Return the canonicalized absolute pathname
|
||||
* ## C
|
||||
* `unsigned short int realpath (const char* str);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* Y,A = Ptr to Relative Filename (C-String)
|
||||
* `>LDYA str`
|
||||
* `>SYSCALL realpath`
|
||||
* **Out:**
|
||||
* CC : success
|
||||
* Y,A = Ptr to Full Path (C-String)
|
||||
* X = hMem of Full Path
|
||||
* CS : A = Error Code
|
||||
*\--------------------------------------
|
||||
K.RealPath.YA >STYA ZPPtr1
|
||||
K.realpath >STYA ZPPtr1
|
||||
ldx #$ff
|
||||
|
||||
lda (ZPPtr1)
|
||||
|
@ -19,7 +19,8 @@ AUTO 4,1
|
||||
.INB /A2OSX.SRC/X.PRINTF.S
|
||||
A2osX.MAIN .PH $1100
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.CORE
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.D01
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.IO
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.DRV
|
||||
.EP
|
||||
A2osX.AUX .PH $0C00
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.OSD
|
||||
@ -36,6 +37,7 @@ A2osX.D1 .PH $D000
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.STDLIB
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.PFT
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.DEV
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.FIO
|
||||
.EP
|
||||
A2osX.D2 .PH $D000
|
||||
.DA #RRAMWRAMBNK2
|
||||
@ -51,8 +53,6 @@ A2osX.E0 .PH $E000
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.JMP
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.IRQ
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.MEM
|
||||
********* TMP ***** go to A2osX.D1
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.FIO
|
||||
DevMgr.FreeMem .EQ *
|
||||
.EP
|
||||
A2osX.E0.E .EQ *
|
||||
|
Loading…
x
Reference in New Issue
Block a user