mirror of
https://github.com/A2osX/A2osX.git
synced 2025-08-15 01:27:49 +00:00
Kernel 0.9.2
This commit is contained in:
@@ -163,18 +163,22 @@ Load a file in memory
|
|||||||
# FAdd,FSub,FMult,FDiv,FPwr
|
# FAdd,FSub,FMult,FDiv,FPwr
|
||||||
Return X+Y, X-Y, X*Y, X/Y, X^Y
|
Return X+Y, X-Y, X*Y, X/Y, X^Y
|
||||||
|
|
||||||
##ASM
|
## ASM
|
||||||
**In:**
|
**In:**
|
||||||
`>PUSHF X (float)`
|
`>PUSHF X (float)`
|
||||||
`>PUSHF Y (float)`
|
`>PUSHF Y (float)`
|
||||||
`>SYSCALL fadd
|
`>SYSCALL fadd`
|
||||||
|
`>SYSCALL fsub`
|
||||||
|
`>SYSCALL fmult`
|
||||||
|
`>SYSCALL fdiv`
|
||||||
|
`>SYSCALL fpwr`
|
||||||
**Out:**
|
**Out:**
|
||||||
On stack (float)
|
On stack (float)
|
||||||
|
|
||||||
# Log,Sqr,Exp,Cos,Sin,Tan,ATan
|
# Log,Sqr,Exp,Cos,Sin,Tan,ATan
|
||||||
Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
||||||
|
|
||||||
##C
|
## C
|
||||||
`float log ( float x);`
|
`float log ( float x);`
|
||||||
`float sqr ( float x);`
|
`float sqr ( float x);`
|
||||||
`float exp ( float x);`
|
`float exp ( float x);`
|
||||||
@@ -183,24 +187,35 @@ Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
|||||||
`float tan ( float x);`
|
`float tan ( float x);`
|
||||||
`float atan ( float x);`
|
`float atan ( float x);`
|
||||||
|
|
||||||
##ASM
|
## ASM
|
||||||
**In:**
|
**In:**
|
||||||
`>PUSHF x (Float)`
|
`>PUSHF x (Float)`
|
||||||
`>SYSCALL log`
|
`>SYSCALL log`
|
||||||
**Out:**
|
**Out:**
|
||||||
On stack (Float)
|
On stack (Float)
|
||||||
|
|
||||||
# Float
|
# float
|
||||||
Return 'floated' long
|
Return 'floated' long
|
||||||
**In:**
|
|
||||||
PUSHL = X (long)
|
|
||||||
**Out:**
|
|
||||||
On stack (Float)
|
|
||||||
|
|
||||||
# LRIntF
|
## C
|
||||||
Return Float rounded into a long
|
`float f = (float)12345678;
|
||||||
|
|
||||||
|
## ASM
|
||||||
**In:**
|
**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:**
|
**Out:**
|
||||||
On stack (long)
|
On stack (long)
|
||||||
|
|
||||||
@@ -637,7 +652,7 @@ Rename a file
|
|||||||
PUSHW = Old Name
|
PUSHW = Old Name
|
||||||
**Out:**
|
**Out:**
|
||||||
|
|
||||||
# StrToF
|
# strtof
|
||||||
Convert String to 40 bits Float
|
Convert String to 40 bits Float
|
||||||
|
|
||||||
##C
|
##C
|
||||||
@@ -660,6 +675,7 @@ Convert String to 40 bits Float
|
|||||||
## ASM
|
## ASM
|
||||||
**In:**
|
**In:**
|
||||||
`>LDYA str`
|
`>LDYA str`
|
||||||
|
`>SYSCALL atof`
|
||||||
**Out:**
|
**Out:**
|
||||||
On stack (float)
|
On stack (float)
|
||||||
|
|
||||||
@@ -674,12 +690,13 @@ Convert String to 32 bits (unsigned) int
|
|||||||
**In:**
|
**In:**
|
||||||
`>PUSHB Base`
|
`>PUSHB Base`
|
||||||
`>PUSHWI EndPtr`
|
`>PUSHWI EndPtr`
|
||||||
`>LDYA str`
|
`>LDYAI str`
|
||||||
|
`>SYSCALL strtol`
|
||||||
**Out:**
|
**Out:**
|
||||||
On stack (long)
|
On stack (long)
|
||||||
|
|
||||||
# AToL
|
# atol
|
||||||
Convert String to 32 bits int
|
Convert String to 32 bits long
|
||||||
|
|
||||||
## C
|
## C
|
||||||
`long atol ( const char * str );`
|
`long atol ( const char * str );`
|
||||||
@@ -687,29 +704,38 @@ Convert String to 32 bits int
|
|||||||
## ASM
|
## ASM
|
||||||
**In:**
|
**In:**
|
||||||
`>LDYA str`
|
`>LDYA str`
|
||||||
|
`>SYSCALL atol`
|
||||||
**Out:**
|
**Out:**
|
||||||
On stack (long)
|
On stack (long)
|
||||||
|
|
||||||
# AToI.YA
|
# atoi
|
||||||
|
Convert String to 16 bits int
|
||||||
|
|
||||||
## C
|
## C
|
||||||
`int atoi ( const char * str );`
|
`int atoi ( const char * str );`
|
||||||
|
|
||||||
## ASM
|
## ASM
|
||||||
**In:**
|
**In:**
|
||||||
`>LDYA str`
|
`>LDYAI str`
|
||||||
|
`>SYSCALL atoi`
|
||||||
**Out:**
|
**Out:**
|
||||||
Y,A = Int
|
Y,A = int
|
||||||
|
|
||||||
# RealPath.YA
|
# realpath
|
||||||
Return the canonicalized absolute pathname
|
Return the canonicalized absolute pathname
|
||||||
|
|
||||||
|
## C
|
||||||
|
`unsigned short int realpath (const char* str);`
|
||||||
|
|
||||||
|
## ASM
|
||||||
**In:**
|
**In:**
|
||||||
Y,A = Ptr to Relative Filename (C-String)
|
`>LDYA str`
|
||||||
|
`>SYSCALL realpath`
|
||||||
**Out:**
|
**Out:**
|
||||||
CC : success
|
CC : success
|
||||||
Y,A = Ptr to Full Path (C-String)
|
Y,A = Ptr to Full Path (C-String)
|
||||||
X = hMem of Full Path
|
X = hMem of Full Path
|
||||||
CS : A = Error Code
|
CS : A = Error Code
|
||||||
|
|
||||||
# StrLen
|
# StrLen
|
||||||
Returns Length of C-String
|
Returns Length of C-String
|
||||||
|
@@ -1,12 +1,17 @@
|
|||||||
*** Auto generated by docgen.cmd ***
|
*** Auto generated by docgen.cmd ***
|
||||||
|
|
||||||
# Pak
|
# Pak
|
||||||
|
**In:**
|
||||||
|
|
||||||
|
##ASM
|
||||||
|
PUSHW = Src PTR
|
||||||
|
PUSHW = Src Length
|
||||||
|
PUSHW = Dst PTR Output Buffer
|
||||||
|
PUSHW = Dst PTR S.PAKSTAT
|
||||||
|
|
||||||
|
#UnPak
|
||||||
|
|
||||||
|
##ASM
|
||||||
**In:**
|
**In:**
|
||||||
PUSHW = Src PTR
|
PUSHW = Src PTR Compressed Buffer
|
||||||
PUSHW = Src Length
|
PUSHW = Dst PTR
|
||||||
PUSHW = Dst PTR Output Buffer
|
|
||||||
PUSHW = Dst PTR S.PAKSTAT
|
|
||||||
UnPak
|
|
||||||
In :
|
|
||||||
PUSHW = Src PTR Compressed Buffer
|
|
||||||
PUSHW = Dst PTR
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
title Kernel DOC generator
|
title A2osX DOC generator
|
||||||
COLOR 2A
|
COLOR 2A
|
||||||
prompt ]
|
prompt ]
|
||||||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||||
@@ -9,7 +9,7 @@ for /f %%a in ('copy /Z "%~f0" nul') do set "CR=%%a"
|
|||||||
mode con:cols=80 lines=24
|
mode con:cols=80 lines=24
|
||||||
|
|
||||||
cls
|
cls
|
||||||
echo Apple //e
|
echo Apple //e
|
||||||
|
|
||||||
set /a c=0
|
set /a c=0
|
||||||
|
|
||||||
@@ -20,11 +20,6 @@ set SRCDIR=%~dp0..\SYS
|
|||||||
set FILTER=KERNEL.S*.txt
|
set FILTER=KERNEL.S*.txt
|
||||||
Call :SCAN
|
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 DOCFILE=%~dp0..\.Docs\LIBBLKDEV.md
|
||||||
set SRCDIR=%~dp0..\LIB
|
set SRCDIR=%~dp0..\LIB
|
||||||
set FILTER=LIBBLKDEV.S*.txt
|
set FILTER=LIBBLKDEV.S*.txt
|
||||||
@@ -35,6 +30,21 @@ set SRCDIR=%~dp0..\LIB
|
|||||||
set FILTER=LIBCRYPT.S*.txt
|
set FILTER=LIBCRYPT.S*.txt
|
||||||
Call :SCAN
|
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.
|
||||||
echo All done : !c! Files scanned.
|
echo All done : !c! Files scanned.
|
||||||
echo.
|
echo.
|
||||||
@@ -49,7 +59,6 @@ exit 0
|
|||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Scanning %FILTER% Files...
|
echo Scanning %FILTER% Files...
|
||||||
echo.
|
|
||||||
|
|
||||||
for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do (
|
for /f %%F in ('dir /b /ogn "%SRCDIR%\%FILTER%"') do (
|
||||||
set FN=%%F
|
set FN=%%F
|
||||||
|
100
INC/A2osX.I.txt
100
INC/A2osX.I.txt
@@ -279,54 +279,54 @@ S.MSTAT .EQ 24
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* S.NODE
|
* S.NODE
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
S.NODE.HANDLER .EQ 0 0=KRNL,!0=hLIB (LIBNFS,LIBTCPIP.....)
|
S.NODE.HANDLER .EQ 0 0=KRNL,!0=hLIB (LIBNFS,LIBTCPIP.....)
|
||||||
S.NODE.T .EQ 1
|
S.NODE.T .EQ 1
|
||||||
S.NODE.T.REG .EQ 0
|
S.NODE.T.REG .EQ 0
|
||||||
S.NODE.T.DIR .EQ 1
|
S.NODE.T.DIR .EQ 1
|
||||||
S.NODE.T.CDEV .EQ 2
|
S.NODE.T.CDEV .EQ 2
|
||||||
S.NODE.T.BDEV .EQ 3
|
S.NODE.T.BDEV .EQ 3
|
||||||
S.NODE.T.LNK .EQ 4
|
S.NODE.T.LNK .EQ 4
|
||||||
S.NODE.T.DSOCK .EQ 5
|
S.NODE.T.DSOCK .EQ 5
|
||||||
S.NODE.T.SSOCK .EQ 6
|
S.NODE.T.SSOCK .EQ 6
|
||||||
S.NODE.T.FIFO .EQ 7
|
S.NODE.T.FIFO .EQ 7
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
S.NODE.REG.REF .EQ 2
|
S.NODE.REG.REF .EQ 2
|
||||||
S.NODE.REG.IOBUF .EQ 3
|
S.NODE.REG.IOBUF .EQ 3
|
||||||
*
|
*
|
||||||
S.NODE.REG .EQ 4
|
S.NODE.REG .EQ 4
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
S.NODE.DIR.REF .EQ 2
|
S.NODE.DIR.REF .EQ 2
|
||||||
S.NODE.DIR.IOBUF .EQ 3
|
S.NODE.DIR.IOBUF .EQ 3
|
||||||
S.NODE.DIR.EL .EQ 4
|
S.NODE.DIR.EL .EQ 4
|
||||||
S.NODE.DIR.EPB .EQ 5
|
S.NODE.DIR.EPB .EQ 5
|
||||||
S.NODE.DIR.FC .EQ 6 word
|
S.NODE.DIR.FC .EQ 6 word
|
||||||
*
|
*
|
||||||
S.NODE.DIR .EQ 8
|
S.NODE.DIR .EQ 8
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
S.NODE.DEV.ID .EQ 2
|
S.NODE.DEV.ID .EQ 2
|
||||||
S.NODE.DEV.JMP .EQ 3 word
|
S.NODE.DEV.JMP .EQ 3 word
|
||||||
*
|
*
|
||||||
S.NODE.DEV .EQ 5
|
S.NODE.DEV .EQ 5
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* S.NODE.LNK
|
* S.NODE.LNK
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
S.NODE.SSOCK.HSKT .EQ 2
|
S.NODE.SSOCK.HSKT .EQ 2
|
||||||
S.NODE.SSOCK.OPEN .EQ 3
|
S.NODE.SSOCK.OPEN .EQ 3
|
||||||
S.NODE.SSOCK.CLOSE .EQ 4
|
S.NODE.SSOCK.CLOSE .EQ 4
|
||||||
S.NODE.SSOCK.READ .EQ 5
|
S.NODE.SSOCK.READ .EQ 5
|
||||||
S.NODE.SSOCK.WRITE .EQ 6
|
S.NODE.SSOCK.WRITE .EQ 6
|
||||||
S.NODE.SSOCK.STATUS .EQ 7
|
S.NODE.SSOCK.STATUS .EQ 7
|
||||||
*
|
*
|
||||||
S.NODE.SSOCK .EQ 8
|
S.NODE.SSOCK .EQ 8
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
S.NODE.FIFO.S .EQ 2
|
S.NODE.FIFO.S .EQ 2
|
||||||
S.NODE.FIFO.S.Opened .EQ 1
|
S.NODE.FIFO.S.Opened .EQ 1
|
||||||
S.NODE.FIFO.S.Closed .EQ 2
|
S.NODE.FIFO.S.Closed .EQ 2
|
||||||
S.NODE.FIFO.hMem .EQ 3
|
S.NODE.FIFO.hMem .EQ 3
|
||||||
S.NODE.FIFO.Tail .EQ 4
|
S.NODE.FIFO.Tail .EQ 4
|
||||||
S.NODE.FIFO.Head .EQ 5
|
S.NODE.FIFO.Head .EQ 5
|
||||||
*
|
*
|
||||||
S.NODE.FIFO .EQ 6
|
S.NODE.FIFO .EQ 6
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* DEVMGR (new API) = Smartport
|
* DEVMGR (new API) = Smartport
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@@ -335,24 +335,24 @@ S.NODE.FIFO .EQ 6
|
|||||||
* BLK : ROM Entry point Cn($Cnff)
|
* BLK : ROM Entry point Cn($Cnff)
|
||||||
* PRT : ROM Entry point Cn($Cnff)+3
|
* PRT : ROM Entry point Cn($Cnff)+3
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
S.DEV.DRV.JMP .EQ 2
|
S.DEV.DRV.JMP .EQ 2
|
||||||
S.DEV.S .EQ 4
|
S.DEV.S .EQ 4
|
||||||
S.DEV.S.BLOCK .EQ %10000000
|
S.DEV.S.BLOCK .EQ %10000000
|
||||||
S.DEV.S.WRITE .EQ %01000000
|
S.DEV.S.WRITE .EQ %01000000
|
||||||
S.DEV.S.READ .EQ %00100000
|
S.DEV.S.READ .EQ %00100000
|
||||||
S.DEV.S.ONLINE .EQ %00010000
|
S.DEV.S.ONLINE .EQ %00010000
|
||||||
S.DEV.S.NOFMT .EQ %00001000
|
S.DEV.S.NOFMT .EQ %00001000
|
||||||
S.DEV.S.WENABL .EQ %00000100
|
S.DEV.S.WENABL .EQ %00000100
|
||||||
S.DEV.S.IRQ .EQ %00000010
|
S.DEV.S.IRQ .EQ %00000010
|
||||||
S.DEV.S.OPENED .EQ %00000001
|
S.DEV.S.OPENED .EQ %00000001
|
||||||
S.DEV.F .EQ 5
|
S.DEV.F .EQ 5
|
||||||
S.DEV.BUSID .EQ 6
|
S.DEV.BUSID .EQ 6
|
||||||
S.DEV.DEVID .EQ 7
|
S.DEV.DEVID .EQ 7
|
||||||
S.DEV.ROM.JMP .EQ 8 word
|
S.DEV.ROM.JMP .EQ 8 word
|
||||||
*
|
*
|
||||||
S.DEV.NAME .EQ 11 4+\0 MAX
|
S.DEV.NAME .EQ 11 4+\0 MAX
|
||||||
*
|
*
|
||||||
S.DEV .EQ 16
|
S.DEV .EQ 16
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IOCTL.STATUS .EQ 0
|
IOCTL.STATUS .EQ 0
|
||||||
IOCTL.READBLOCK .EQ 2
|
IOCTL.READBLOCK .EQ 2
|
||||||
|
@@ -42,11 +42,12 @@ LIB.UNLOAD clc
|
|||||||
rts
|
rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # Pak
|
* # Pak
|
||||||
* **In:**
|
* **In:**
|
||||||
* PUSHW = Src PTR
|
* ##ASM
|
||||||
* PUSHW = Src Length
|
* PUSHW = Src PTR
|
||||||
* PUSHW = Dst PTR Output Buffer
|
* PUSHW = Src Length
|
||||||
* PUSHW = Dst PTR S.PAKSTAT
|
* PUSHW = Dst PTR Output Buffer
|
||||||
|
* PUSHW = Dst PTR S.PAKSTAT
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
* PASS #1 : BL+REP dryrun with raw BYTE store (no bit prefix) -> Dst
|
* PASS #1 : BL+REP dryrun with raw BYTE store (no bit prefix) -> Dst
|
||||||
* if BL stat=0, disable BL in PASS #2
|
* if BL stat=0, disable BL in PASS #2
|
||||||
@@ -495,11 +496,12 @@ Pak.UpdateStats inc Pak.Stat,x
|
|||||||
inc Pak.Stat+1,x
|
inc Pak.Stat+1,x
|
||||||
.8 rts
|
.8 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* UnPak
|
* #UnPak
|
||||||
* In :
|
* ##ASM
|
||||||
* PUSHW = Src PTR Compressed Buffer
|
* **In:**
|
||||||
* PUSHW = Dst PTR
|
* PUSHW = Src PTR Compressed Buffer
|
||||||
*/--------------------------------------
|
* PUSHW = Dst PTR
|
||||||
|
*\--------------------------------------
|
||||||
UnZPSrcPtr .EQ ZPLIB
|
UnZPSrcPtr .EQ ZPLIB
|
||||||
UnZPDstPtr .EQ ZPLIB+2
|
UnZPDstPtr .EQ ZPLIB+2
|
||||||
UnPak.ShrtTbl .EQ ZPLIB+4
|
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
|
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
|
MAN
|
||||||
SAVE /A2OSX.SRC/SYS/KERNEL.S.D01
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.DRV
|
||||||
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
||||||
ASM
|
ASM
|
@@ -4,11 +4,17 @@ AUTO 4,1
|
|||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # FAdd,FSub,FMult,FDiv,FPwr
|
* # FAdd,FSub,FMult,FDiv,FPwr
|
||||||
* Return X+Y, X-Y, X*Y, X/Y, X^Y
|
* Return X+Y, X-Y, X*Y, X/Y, X^Y
|
||||||
|
* ## ASM
|
||||||
* **In:**
|
* **In:**
|
||||||
* PUSHF = X (Float)
|
* `>PUSHF X (float)`
|
||||||
* PUSHF = Y (Float)
|
* `>PUSHF Y (float)`
|
||||||
|
* `>SYSCALL fadd`
|
||||||
|
* `>SYSCALL fsub`
|
||||||
|
* `>SYSCALL fmult`
|
||||||
|
* `>SYSCALL fdiv`
|
||||||
|
* `>SYSCALL fpwr`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* On stack (Float)
|
* On stack (float)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.FAdd ldx #ROM.FADD
|
K.FAdd ldx #ROM.FADD
|
||||||
.HS 2C BIT ABS
|
.HS 2C BIT ABS
|
||||||
@@ -29,8 +35,18 @@ K.FPwr ldx #ROM.PWR
|
|||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # Log,Sqr,Exp,Cos,Sin,Tan,ATan
|
* # Log,Sqr,Exp,Cos,Sin,Tan,ATan
|
||||||
* Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
* Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
||||||
|
* ## 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:**
|
* **In:**
|
||||||
* PUSHF = X (Float)
|
* `>PUSHF x (Float)`
|
||||||
|
* `>SYSCALL log`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* On stack (Float)
|
* On stack (Float)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
@@ -54,12 +70,15 @@ K.ATan ldx #ROM.ATAN
|
|||||||
plx
|
plx
|
||||||
bra MATH.Go
|
bra MATH.Go
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # Float
|
* # float
|
||||||
* Return 'floated' long
|
* Return 'floated' long
|
||||||
|
* ## C
|
||||||
|
* `float f = (float)12345678;
|
||||||
|
* ## ASM
|
||||||
* **In:**
|
* **In:**
|
||||||
* PUSHL = X (long)
|
* `>PUSHL X` (long)
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* On stack (Float)
|
* On stack (float)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.Float >PULLW FAC+1
|
K.Float >PULLW FAC+1
|
||||||
>PULLW FAC+3
|
>PULLW FAC+3
|
||||||
@@ -86,14 +105,18 @@ MATH.Go jsr GP.ROMCALL
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # LRIntF
|
* # lrintf
|
||||||
* Return Float rounded into a long
|
* Return float rounded into a long
|
||||||
|
* ## C
|
||||||
|
* `long int lrintf (float x);`
|
||||||
|
* ## ASM
|
||||||
* **In:**
|
* **In:**
|
||||||
* PUSHF = X (Float)
|
* `>PUSHF x`
|
||||||
|
* `>SYSCALL lrintf`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* On stack (long)
|
* On stack (long)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.LRIntF jsr MATH.PullFAC
|
K.lrintf jsr MATH.PullFAC
|
||||||
|
|
||||||
ldx #ROM.QINT
|
ldx #ROM.QINT
|
||||||
jsr GP.ROMCALL
|
jsr GP.ROMCALL
|
||||||
|
@@ -10,13 +10,6 @@ ZPSListIBlkPtr .EQ ZPMEMMGR+8
|
|||||||
ZPSListDBlkPtr .EQ ZPMEMMGR+10
|
ZPSListDBlkPtr .EQ ZPMEMMGR+10
|
||||||
ZPSListKeyPtr .EQ ZPMEMMGR+12
|
ZPSListKeyPtr .EQ ZPMEMMGR+12
|
||||||
ZPSListDataPtr .EQ ZPMEMMGR+14
|
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
|
* # GetMem0
|
||||||
* **In:**
|
* **In:**
|
||||||
|
@@ -874,16 +874,19 @@ K.SScanF.GetVAL tya Y=char count parsed
|
|||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # FOpen
|
* # FOpen
|
||||||
* Open a file
|
* Open a file
|
||||||
|
* ## C
|
||||||
|
* `hFILE fopen ( const char * filename, short int mode, short int ftype, int auxtype );`
|
||||||
* **In:**
|
* **In:**
|
||||||
* PUSHW = AUXTYPE
|
* ## ASM
|
||||||
* PUSHB = TYPE
|
* `>PUSHWI auxtype`
|
||||||
* PUSHB = MODE
|
* `>PUSHBI ftype`
|
||||||
* SYS.FOpen.R : if R and !exists -> ERROR
|
* `>PUSHBI mode`
|
||||||
* SYS.FOpen.W : if W and !exists -> CREATE
|
* + SYS.FOpen.R : if R and !exists -> ERROR
|
||||||
* SYS.FOpen.A : Append
|
* + SYS.FOpen.W : if W and !exists -> CREATE
|
||||||
* SYS.FOpen.T : Open/Append in Text mode
|
* + SYS.FOpen.A : Append
|
||||||
* SYS.FOpen.X : Create if not exists
|
* + SYS.FOpen.T : Open/Append in Text mode
|
||||||
* PUSHW = PATH (PSTR)
|
* + SYS.FOpen.X : Create if not exists
|
||||||
|
* `>LDYAI filename`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* CC : A = hFILE
|
* CC : A = hFILE
|
||||||
* CS : A = EC
|
* CS : A = EC
|
||||||
|
@@ -2,18 +2,19 @@ NEW
|
|||||||
PREFIX /A2OSX.BUILD
|
PREFIX /A2OSX.BUILD
|
||||||
AUTO 4,1
|
AUTO 4,1
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # StrToF
|
* # strtof
|
||||||
* Convert String to 40 bits Float
|
* Convert String to 40 bits Float
|
||||||
* ## C
|
* ##C
|
||||||
* `float strtof (const char* str, char** endptr);`
|
* `float strtof (const char* str, char** endptr);`
|
||||||
* ## ASM
|
* ##ASM
|
||||||
* **In:**
|
* **In:**
|
||||||
* `>PUSHWI EndPtr`
|
* `>PUSHWI EndPtr`
|
||||||
* `>LDYA str`
|
* `>LDYA str`
|
||||||
|
* `>SYSCALL strtof`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* On stack (float)
|
* On stack (float)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.StrToF >STYA TXTPTR Ptr to source string
|
K.strtof >STYA TXTPTR Ptr to source string
|
||||||
>PULLW ZPPtr1
|
>PULLW ZPPtr1
|
||||||
|
|
||||||
jsr K.AToF.I
|
jsr K.AToF.I
|
||||||
@@ -32,6 +33,7 @@ K.StrToF >STYA TXTPTR Ptr to source string
|
|||||||
* ## ASM
|
* ## ASM
|
||||||
* **In:**
|
* **In:**
|
||||||
* `>LDYA str`
|
* `>LDYA str`
|
||||||
|
* `>SYSCALL atof`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* On stack (float)
|
* On stack (float)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
@@ -66,7 +68,8 @@ K.AToF.I jsr CHARGOT
|
|||||||
* **In:**
|
* **In:**
|
||||||
* `>PUSHB Base`
|
* `>PUSHB Base`
|
||||||
* `>PUSHWI EndPtr`
|
* `>PUSHWI EndPtr`
|
||||||
* `>LDYA str`
|
* `>LDYAI str`
|
||||||
|
* `>SYSCALL strtol`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* On stack (long)
|
* On stack (long)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
@@ -90,13 +93,14 @@ K.StrToUL.Exit adc ZPPtr2
|
|||||||
|
|
||||||
K.StrToUL.rts rts
|
K.StrToUL.rts rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # AToL
|
* # atol
|
||||||
* Convert String to 32 bits int
|
* Convert String to 32 bits long
|
||||||
* ## C
|
* ## C
|
||||||
* `long atol ( const char * str );`
|
* `long atol ( const char * str );`
|
||||||
* ## ASM
|
* ## ASM
|
||||||
* **In:**
|
* **In:**
|
||||||
* `>LDYA str`
|
* `>LDYA str`
|
||||||
|
* `>SYSCALL atol`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* On stack (long)
|
* On stack (long)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
@@ -124,16 +128,18 @@ K.AToL.I jsr STDLIB.GetDec
|
|||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # AToI.YA
|
* # atoi
|
||||||
|
* Convert String to 16 bits int
|
||||||
* ## C
|
* ## C
|
||||||
* `int atoi ( const char * str );`
|
* `int atoi ( const char * str );`
|
||||||
* ## ASM
|
* ## ASM
|
||||||
* **In:**
|
* **In:**
|
||||||
* `>LDYA str`
|
* `>LDYAI str`
|
||||||
|
* `>SYSCALL atoi`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* Y,A = Int
|
* Y,A = int
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.AToI.YA >STYA ZPPtr2
|
K.atoi >STYA ZPPtr2
|
||||||
lda #10 base 10
|
lda #10 base 10
|
||||||
sec signed
|
sec signed
|
||||||
|
|
||||||
@@ -272,17 +278,21 @@ STDLIB.32.Clear ldx #3
|
|||||||
bpl .1
|
bpl .1
|
||||||
rts
|
rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # RealPath.YA
|
* # realpath
|
||||||
* Return the canonicalized absolute pathname
|
* Return the canonicalized absolute pathname
|
||||||
|
* ## C
|
||||||
|
* `unsigned short int realpath (const char* str);`
|
||||||
|
* ## ASM
|
||||||
* **In:**
|
* **In:**
|
||||||
* Y,A = Ptr to Relative Filename (C-String)
|
* `>LDYA str`
|
||||||
|
* `>SYSCALL realpath`
|
||||||
* **Out:**
|
* **Out:**
|
||||||
* CC : success
|
* CC : success
|
||||||
* Y,A = Ptr to Full Path (C-String)
|
* Y,A = Ptr to Full Path (C-String)
|
||||||
* X = hMem of Full Path
|
* X = hMem of Full Path
|
||||||
* CS : A = Error Code
|
* CS : A = Error Code
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.RealPath.YA >STYA ZPPtr1
|
K.realpath >STYA ZPPtr1
|
||||||
ldx #$ff
|
ldx #$ff
|
||||||
|
|
||||||
lda (ZPPtr1)
|
lda (ZPPtr1)
|
||||||
|
@@ -19,7 +19,8 @@ AUTO 4,1
|
|||||||
.INB /A2OSX.SRC/X.PRINTF.S
|
.INB /A2OSX.SRC/X.PRINTF.S
|
||||||
A2osX.MAIN .PH $1100
|
A2osX.MAIN .PH $1100
|
||||||
.INB /A2OSX.SRC/SYS/KERNEL.S.CORE
|
.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
|
.EP
|
||||||
A2osX.AUX .PH $0C00
|
A2osX.AUX .PH $0C00
|
||||||
.INB /A2OSX.SRC/SYS/KERNEL.S.OSD
|
.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.STDLIB
|
||||||
.INB /A2OSX.SRC/SYS/KERNEL.S.PFT
|
.INB /A2OSX.SRC/SYS/KERNEL.S.PFT
|
||||||
.INB /A2OSX.SRC/SYS/KERNEL.S.DEV
|
.INB /A2OSX.SRC/SYS/KERNEL.S.DEV
|
||||||
|
.INB /A2OSX.SRC/SYS/KERNEL.S.FIO
|
||||||
.EP
|
.EP
|
||||||
A2osX.D2 .PH $D000
|
A2osX.D2 .PH $D000
|
||||||
.DA #RRAMWRAMBNK2
|
.DA #RRAMWRAMBNK2
|
||||||
@@ -51,8 +53,6 @@ A2osX.E0 .PH $E000
|
|||||||
.INB /A2OSX.SRC/SYS/KERNEL.S.JMP
|
.INB /A2OSX.SRC/SYS/KERNEL.S.JMP
|
||||||
.INB /A2OSX.SRC/SYS/KERNEL.S.IRQ
|
.INB /A2OSX.SRC/SYS/KERNEL.S.IRQ
|
||||||
.INB /A2OSX.SRC/SYS/KERNEL.S.MEM
|
.INB /A2OSX.SRC/SYS/KERNEL.S.MEM
|
||||||
********* TMP ***** go to A2osX.D1
|
|
||||||
.INB /A2OSX.SRC/SYS/KERNEL.S.FIO
|
|
||||||
DevMgr.FreeMem .EQ *
|
DevMgr.FreeMem .EQ *
|
||||||
.EP
|
.EP
|
||||||
A2osX.E0.E .EQ *
|
A2osX.E0.E .EQ *
|
||||||
|
Reference in New Issue
Block a user