mirror of
https://github.com/A2osX/A2osX.git
synced 2024-07-07 04:28:56 +00:00
Kernel 0.9.1 : Floating point ROM hooks....
This commit is contained in:
parent
5dff2a4459
commit
bbbdd3d867
Binary file not shown.
Binary file not shown.
@ -139,8 +139,8 @@ SYS.ChGrp .EQ $6E
|
||||
SYS.AToF .EQ $70
|
||||
SYS.AToI.YA .EQ $72
|
||||
SYS.AToL .EQ $74
|
||||
* .EQ $76
|
||||
* .EQ $78
|
||||
SYS.StrToF .EQ $76
|
||||
SYS.StrToL .EQ $78
|
||||
* .EQ $7A
|
||||
SYS.RealPath.YA .EQ $7C
|
||||
* .EQ $7E
|
||||
|
@ -51,6 +51,9 @@ FMULT .EQ $E97F
|
||||
* FAC = (Y,A) / FAC
|
||||
*--------------------------------------
|
||||
FDIV .EQ $EA66
|
||||
|
||||
LOAD.FAC.FROM.YA
|
||||
.EQ $EAF9
|
||||
*--------------------------------------
|
||||
* CONVERT STRING TO FP VALUE IN FAC
|
||||
* STRING POINTED TO BY TXTPTR
|
||||
@ -58,6 +61,7 @@ FDIV .EQ $EA66
|
||||
* (A) = FIRST CHAR, C=0 IF DIGIT.
|
||||
*--------------------------------------
|
||||
FIN .EQ $EC4A
|
||||
FOUT .EQ $ED34
|
||||
*--------------------------------------
|
||||
SQR .EQ $EE8D
|
||||
*--------------------------------------
|
||||
|
@ -44,10 +44,21 @@ ZPPtr4 .EQ ZPKERNEL+6
|
||||
*--------------------------------------
|
||||
ZPMEMMGR .EQ $8
|
||||
*--------------------------------------
|
||||
*--------------------------------------
|
||||
* $42-$47 ProDOS Block Device Drivers Main
|
||||
*--------------------------------------
|
||||
* $5E-$C8 RESERVED APPLESOFT Main/Aux (ROM Call, no need to switch back MainZP)
|
||||
*--------------------------------------
|
||||
*INDEX .EQ $5E ->$5F
|
||||
FAC .EQ $9D ->$A1
|
||||
FAC.SIGN .EQ $A2
|
||||
FAC.EXTENSION .EQ $AC
|
||||
TXTPTR .EQ $B8
|
||||
*--------------------------------------
|
||||
* ROM Entry Point
|
||||
*--------------------------------------
|
||||
ROM.FIN .EQ $0
|
||||
ROM.FOUT .EQ $2
|
||||
*--------------------------------------
|
||||
* Memory Map
|
||||
*--------------------------------------
|
||||
A2osX.SaveSM .EQ $100 Aux
|
||||
|
@ -110,6 +110,11 @@ AUTO 6
|
||||
.FIN
|
||||
jsr A2osX.MLICALL
|
||||
.EM
|
||||
*--------------------------------------
|
||||
.MA ROMCALL
|
||||
ldx #ROM.]1
|
||||
jsr A2osX.ROMCALL
|
||||
.EM
|
||||
*--------------------------------------
|
||||
* Global DATA Segment Access
|
||||
*--------------------------------------
|
||||
|
@ -101,7 +101,23 @@ A2osX.MLICALL1 stx .1
|
||||
jsr GO.A2osX
|
||||
rts
|
||||
*--------------------------------------
|
||||
A2osX.ROMCALL1 bra *
|
||||
A2osX.ROMCALL1 phx
|
||||
ldx $D000
|
||||
stx .8+1
|
||||
|
||||
bit RROMBNK1
|
||||
|
||||
plx
|
||||
jsr .1
|
||||
|
||||
.8 ldx #$ff
|
||||
bit $C000,x
|
||||
bit $C000,x
|
||||
rts
|
||||
|
||||
.1 jmp (.2,x)
|
||||
.2 .DA $EC4A FIN
|
||||
.DA $ED36 FOUT.1
|
||||
*--------------------------------------
|
||||
* A2osX.DIIDrv
|
||||
* X = DEVMGR.cmd
|
||||
|
@ -98,6 +98,13 @@ Kernel.Init3 sta SETALTZP
|
||||
bit RRAMWRAMBNK1
|
||||
bit RRAMWRAMBNK1
|
||||
|
||||
ldx #Kernel.ZP.S-1
|
||||
|
||||
.1 lda Kernel.ZP,x
|
||||
sta CHARGET,x
|
||||
dex
|
||||
bpl .1
|
||||
|
||||
jsr MemMgrInit
|
||||
jsr PS0Init
|
||||
bcs *
|
||||
@ -153,6 +160,27 @@ Kernel.Init3 sta SETALTZP
|
||||
>SYSCALL PrintF.YA
|
||||
bra * No need to discard Expanded CMDLINE
|
||||
*--------------------------------------
|
||||
* Modified CHARGET/CHARGOT for ROM CALL
|
||||
* CHRGET .EQ $B1 - C8
|
||||
*--------------------------------------
|
||||
Kernel.ZP .PH $B1
|
||||
CHARGET inc TXTPTR
|
||||
bne CHARGOT
|
||||
inc TXTPTR+1
|
||||
|
||||
CHARGOT lda $ffff
|
||||
beq IsDigit.9
|
||||
|
||||
IsDigit cmp #'0'
|
||||
bcc IsDigit.9
|
||||
cmp #'9'+1
|
||||
rts
|
||||
|
||||
IsDigit.9 sec
|
||||
rts
|
||||
.EP
|
||||
Kernel.ZP.S .EQ *-Kernel.ZP
|
||||
*--------------------------------------
|
||||
Kernel.Move ldy #0
|
||||
.1 inc ZPPtr3
|
||||
bne .2
|
||||
|
@ -74,8 +74,8 @@ K.SYSCALL.JMP .DA 0 $00
|
||||
.DA K.AToF $70
|
||||
.DA K.AToI.YA
|
||||
.DA K.AToL
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA K.StrToF
|
||||
.DA K.StrToL
|
||||
.DA 0
|
||||
.DA K.RealPath.YA
|
||||
.DA 0
|
||||
|
@ -728,8 +728,8 @@ K.SScanF.IncPtr1
|
||||
* %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 5 Bytes float +1.23456789e+12
|
||||
* %f : pull 2 bytes PTR to 5 Bytes float 3.1415
|
||||
* %e : pull 2 bytes PTR to 5 Bytes float (-)1.23456789e+12
|
||||
* %f : pull 2 bytes PTR to 5 Bytes float (-)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
|
||||
@ -933,17 +933,48 @@ PrintF.U.1 bcc .8 unsigned, nothing to check
|
||||
sec tell to print a "-" sign....
|
||||
|
||||
.8 jmp HEX2DEC
|
||||
*--------------------------------------
|
||||
* .HS 9E 6E6B2800 1,000,000,000
|
||||
*--------------------------------------
|
||||
* EXP(8) 1(s) 1significants(31)
|
||||
* http://apple2.org.za/gswv/a2zine/GS.WorldView/Resources/GS.TECH.INFO/AppleSoft/
|
||||
*--------------------------------------
|
||||
PrintF.E
|
||||
* >PULLW ZPPtr2
|
||||
* rts
|
||||
*--------------------------------------
|
||||
PrintF.F >PULLW ZPPtr2
|
||||
rts
|
||||
PrintF.E sec Force "E+12"
|
||||
.HS 90 BCC
|
||||
PrintF.F clc
|
||||
>PULLW ZPPtr2
|
||||
|
||||
ldy #4
|
||||
|
||||
.1 lda (ZPPtr2),y
|
||||
sta FAC,y
|
||||
dey
|
||||
bne .1
|
||||
|
||||
sta FAC.SIGN
|
||||
ora #$80
|
||||
sta FAC+1
|
||||
|
||||
lda (ZPPtr2)
|
||||
sta FAC
|
||||
|
||||
stz FAC.EXTENSION
|
||||
|
||||
ldy #3 In order not to trash A2osX.SaveSM,A2osX.SaveSX
|
||||
>ROMCALL FOUT
|
||||
|
||||
ldx #0
|
||||
|
||||
.2 lda $102,x
|
||||
beq .8
|
||||
|
||||
phx
|
||||
jsr Printf.Cout
|
||||
plx
|
||||
inx
|
||||
bne .2
|
||||
|
||||
.8 clc
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
PrintF.HH >PULLA
|
||||
pha
|
||||
|
@ -13,9 +13,18 @@ AUTO 6
|
||||
* ## Out:
|
||||
*\--------------------------------------
|
||||
K.StrToF jsr PullPtr1Ptr2Ptr3
|
||||
jsr K.AToF.I
|
||||
bcc K.StrToUL.Exit
|
||||
* jsr K.AToF.I
|
||||
* bcc K.StrToUL.Exit
|
||||
|
||||
>LDYA ZPPtr2
|
||||
>STYA TXTPTR
|
||||
|
||||
jsr CHARGOT
|
||||
|
||||
>ROMCALL FIN
|
||||
|
||||
|
||||
|
||||
.9 rts
|
||||
*/--------------------------------------
|
||||
* # AToF
|
||||
|
90
TEST.S.txt
Normal file
90
TEST.S.txt
Normal file
@ -0,0 +1,90 @@
|
||||
PR#3
|
||||
PREFIX /A2OSX.BUILD
|
||||
NEW
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
.OP 65C02
|
||||
.OR $2000
|
||||
.TF /A2OSX.BUILD/TEST
|
||||
*--------------------------------------
|
||||
.INB /A2OSX.BUILD/INC/MACROS.I
|
||||
.INB /A2OSX.BUILD/INC/A2OSX.I
|
||||
*--------------------------------------
|
||||
* File Header (16 Bytes)
|
||||
*--------------------------------------
|
||||
CS.START cld
|
||||
jmp (.1,x)
|
||||
.DA #$61 6502,Level 1 (65c02)
|
||||
.DA #1 BIN Layout Version 1
|
||||
.DA 0
|
||||
.DA CS.END-CS.START CS
|
||||
.DA DS.END-DS.START DS
|
||||
.DA #64 SS
|
||||
.DA #0 ZP
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
* Relocation Table
|
||||
*--------------------------------------
|
||||
.1 .DA CS.INIT
|
||||
.DA CS.RUN
|
||||
.DA CS.DOEVENT
|
||||
.DA CS.QUIT
|
||||
L.FLOAT1 .DA FLOAT1
|
||||
L.FLOAT2 .DA FLOAT2
|
||||
L.FLOAT3 .DA FLOAT3
|
||||
L.FLOAT4 .DA FLOAT4
|
||||
L.FLOAT5 .DA FLOAT5
|
||||
L.MSG .DA MSG
|
||||
L.CONST .DA CONST
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
CS.INIT clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.RUN >PUSHEA.G ENDPTR
|
||||
>LDYA L.CONST
|
||||
>PUSHEA.G MYFLOAT
|
||||
>SYSCALL StrToF
|
||||
|
||||
>PUSHEA.G MYFLOAT
|
||||
>PUSHW L.FLOAT5
|
||||
>PUSHW L.FLOAT4
|
||||
>PUSHW L.FLOAT3
|
||||
>PUSHW L.FLOAT2
|
||||
>PUSHW L.FLOAT1
|
||||
|
||||
>LDYA L.MSG
|
||||
|
||||
>SYSCALL PrintF.YA
|
||||
|
||||
lda #0
|
||||
sec
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CS.DOEVENT sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.QUIT clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.END
|
||||
MSG >CSTR "TEST: %e, %e, %e\r\n %e, %e, %e\r\n"
|
||||
FLOAT1 .HS 9B3EBC1FFD 99,999,999.9
|
||||
FLOAT2 .HS 9E6E6B27FD 999,999,999
|
||||
FLOAT3 .HS 9E6E6B2800 1,000,000,000
|
||||
FLOAT4 .HS 8100000000 1
|
||||
FLOAT5 .HS 9080000000 -32768
|
||||
CONST >CSTR "3.141592653"
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
DS.START
|
||||
MYFLOAT .BS 5
|
||||
ENDPTR .BS 2
|
||||
DS.END
|
||||
.ED
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE /A2OSX.BUILD/TEST.S
|
||||
ASM
|
Loading…
Reference in New Issue
Block a user