mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-23 21:30:48 +00:00
Kernel 0.9.1 : Math API, bug fix, and L To F conversion
This commit is contained in:
parent
4cd04a6f2c
commit
698bad1b63
@ -198,6 +198,13 @@ Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
||||
+ PUSHW = X (*Float)
|
||||
+ Y,A = Dest (*Float)
|
||||
|
||||
# Float
|
||||
Return return 'floated' long
|
||||
|
||||
## In:
|
||||
+ PUSHW = X (*long)
|
||||
+ Y,A = Dest (*float)
|
||||
|
||||
# LRIntF
|
||||
Return Float rounded into a long
|
||||
|
||||
@ -371,7 +378,7 @@ Return information about a file
|
||||
|
||||
## Out :
|
||||
|
||||
# MKDirYA
|
||||
# MKDir.YA
|
||||
|
||||
## In:
|
||||
+ Y,A = DIR name
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -192,7 +192,7 @@ SYS.FDiv .EQ $C6
|
||||
SYS.FPwr .EQ $C8
|
||||
* .EQ $CA
|
||||
SYS.LRIntF .EQ $CC
|
||||
* .EQ $CE
|
||||
SYS.Float .EQ $CE
|
||||
|
||||
SYS.Log .EQ $D0
|
||||
SYS.Sqr .EQ $D2
|
||||
|
@ -45,7 +45,7 @@ SIGNFLG .EQ $16 COS,SIN,TAN
|
||||
INDEX .EQ $5E ->$5F
|
||||
FORPNT .EQ $85 ->$86
|
||||
FAC .EQ $9D ->$A1
|
||||
*FAC.SIGN .EQ $A2
|
||||
FAC.SIGN .EQ $A2
|
||||
*FAC.EXTENSION .EQ $AC
|
||||
TXTPTR .EQ $B8
|
||||
*--------------------------------------
|
||||
|
@ -125,7 +125,7 @@ K.SYSCALL.JMP .DA 0 $00
|
||||
.DA K.FPwr
|
||||
.DA 0
|
||||
.DA K.LRIntF
|
||||
.DA 0
|
||||
.DA K.Float
|
||||
|
||||
.DA K.Log $D0
|
||||
.DA K.Sqr
|
||||
|
@ -48,7 +48,32 @@ K.ATan ldx #ROM.ATAN
|
||||
>STYA FORPNT
|
||||
phx
|
||||
jsr MATH.PullFAC
|
||||
bra MATH.Go
|
||||
*/--------------------------------------
|
||||
* # Float
|
||||
* Return return 'floated' long
|
||||
* ## In:
|
||||
* PUSHW = X (*long)
|
||||
* Y,A = Dest (*float)
|
||||
*\--------------------------------------
|
||||
K.Float >STYA FORPNT
|
||||
>PULLW INDEX
|
||||
|
||||
ldx #1
|
||||
ldy #3
|
||||
|
||||
.1 lda (INDEX),y
|
||||
sta FAC,x
|
||||
inx
|
||||
dey
|
||||
bpl .1
|
||||
stz FAC.SIGN
|
||||
lda #$A0
|
||||
sta FAC Exp=32
|
||||
|
||||
ldx #ROM.LTOF
|
||||
phx
|
||||
|
||||
MATH.Go plx
|
||||
lda SIGNFLG pPs !!!!
|
||||
pha
|
||||
|
@ -86,7 +86,7 @@ K.Stat.DST .DA #S.STAT.P.TYPE
|
||||
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
|
||||
.DA #S.STAT.BLOCKS,#S.STAT.BLOCKS+1
|
||||
*/-------------------------------------
|
||||
* # MKDirYA
|
||||
* # MKDir.YA
|
||||
* ## In:
|
||||
* Y,A = DIR name
|
||||
* ## Out:
|
||||
|
12
TEST.S.txt
12
TEST.S.txt
@ -37,10 +37,12 @@ L.FLOAT4 .DA FLOAT4
|
||||
L.FLOAT5 .DA FLOAT5
|
||||
L.CONST1 .DA CONST1
|
||||
L.CONST2 .DA CONST2
|
||||
L.LONG1 .DA LONG1
|
||||
L.MSG1 .DA MSG1
|
||||
L.MSG2 .DA MSG2
|
||||
L.MSG3 .DA MSG3
|
||||
L.MSG4 .DA MSG4
|
||||
L.MSG5 .DA MSG5
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
CS.INIT clc
|
||||
@ -91,6 +93,14 @@ CS.RUN >PUSHEA.G ENDPTR
|
||||
>PUSHEA.G MYLONG
|
||||
>LDYA L.MSG4
|
||||
>SYSCALL PrintF.YA
|
||||
*--------------------------------------
|
||||
>PUSHW L.LONG1
|
||||
>LEA.G MYFLOAT1
|
||||
>SYSCALL Float
|
||||
|
||||
>PUSHEA.G MYFLOAT1
|
||||
>LDYA L.MSG5
|
||||
>SYSCALL PrintF.YA
|
||||
*--------------------------------------
|
||||
lda #0
|
||||
sec
|
||||
@ -111,9 +121,11 @@ FLOAT4 .HS 8100000000 1
|
||||
FLOAT5 .HS 9080000000 -32768
|
||||
CONST1 >CSTR "3.141592653"
|
||||
CONST2 >CSTR "3"
|
||||
LONG1 .DA 123456789
|
||||
MSG2 >CSTR "PI/3=%e\r\n"
|
||||
MSG3 >CSTR "COS(PI/3)=%e\r\n"
|
||||
MSG4 >CSTR "Long=%L\r\n"
|
||||
MSG5 >CSTR "Float=%e\r\n"
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
|
Loading…
Reference in New Issue
Block a user