mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-16 18:30:26 +00:00
Kernel 0.94
This commit is contained in:
parent
a06c3ef2bc
commit
044e5b5c09
@ -15,8 +15,7 @@ NEW
|
|||||||
ZS.START
|
ZS.START
|
||||||
SessionID .BS 1
|
SessionID .BS 1
|
||||||
ZPSessionPtr .BS 2
|
ZPSessionPtr .BS 2
|
||||||
ZS.END
|
ZS.END .ED
|
||||||
.ED
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* File Header (16 Bytes)
|
* File Header (16 Bytes)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -12,8 +12,12 @@ NEW
|
|||||||
.INB INC/NIC.8900A.I
|
.INB INC/NIC.8900A.I
|
||||||
.INB INC/ETH.I
|
.INB INC/ETH.I
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
ZPArgPtr .EQ ZPBIN
|
.DUMMY
|
||||||
DEVSLOT0x .EQ ZPBIN+2
|
.OR ZPBIN
|
||||||
|
ZS.START
|
||||||
|
ZPArgPtr .BS 2
|
||||||
|
DEVSLOT0x .BS 1
|
||||||
|
ZS.END .ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* File Header (16 Bytes)
|
* File Header (16 Bytes)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -37,16 +41,18 @@ L.FD.DEV .DA FD.DEV
|
|||||||
L.FD.DEV.NAME .DA FD.DEV.NAME
|
L.FD.DEV.NAME .DA FD.DEV.NAME
|
||||||
L.SSCANF.MAC .DA SSCANF.MAC
|
L.SSCANF.MAC .DA SSCANF.MAC
|
||||||
L.MAC0 .DA DCB+S.DCB.NIC.MAC
|
L.MAC0 .DA DCB+S.DCB.NIC.MAC
|
||||||
L.MAC1 .DA DCB+S.DCB.NIC.MAC+1
|
.DA DCB+S.DCB.NIC.MAC+1
|
||||||
L.MAC2 .DA DCB+S.DCB.NIC.MAC+2
|
.DA DCB+S.DCB.NIC.MAC+2
|
||||||
L.MAC3 .DA DCB+S.DCB.NIC.MAC+3
|
.DA DCB+S.DCB.NIC.MAC+3
|
||||||
L.MAC4 .DA DCB+S.DCB.NIC.MAC+4
|
.DA DCB+S.DCB.NIC.MAC+4
|
||||||
L.MAC5 .DA DCB+S.DCB.NIC.MAC+5
|
.DA DCB+S.DCB.NIC.MAC+5
|
||||||
.DA 0 End Of Reloc Table
|
.DA 0 End Of Reloc Table
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Dev.Detect >STYA ARGS
|
Dev.Detect >STYA ZPArgPtr
|
||||||
|
|
||||||
>LDYA L.MSG.DETECT
|
>LDYA L.MSG.DETECT
|
||||||
>SYSCALL PutS
|
>SYSCALL PutS
|
||||||
|
|
||||||
ldx #$70
|
ldx #$70
|
||||||
ldy #7
|
ldy #7
|
||||||
|
|
||||||
@ -76,6 +82,7 @@ Dev.Detect >STYA ARGS
|
|||||||
lda #MLI.E.NODEV
|
lda #MLI.E.NODEV
|
||||||
sec
|
sec
|
||||||
.99 rts
|
.99 rts
|
||||||
|
|
||||||
.3 stx DEVSLOTx0
|
.3 stx DEVSLOTx0
|
||||||
sty DEVSLOT0x
|
sty DEVSLOT0x
|
||||||
lda /PP.REVISION Get Revision# of ths chip...
|
lda /PP.REVISION Get Revision# of ths chip...
|
||||||
@ -114,9 +121,7 @@ Dev.Detect >STYA ARGS
|
|||||||
* clc
|
* clc
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Dev.ParseArgs >LDYA ARGS
|
Dev.ParseArgs lda (ZPArgPTR)
|
||||||
>STYA ZPArgPTR
|
|
||||||
lda (ZPArgPTR)
|
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
lda A2osX.RANDOM16
|
lda A2osX.RANDOM16
|
||||||
@ -129,25 +134,29 @@ Dev.ParseArgs >LDYA ARGS
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.1 >PUSHW ZPArgPtr
|
.1 >LDYA ZPArgPtr
|
||||||
|
>SYSCALL puts
|
||||||
|
|
||||||
|
>PUSHW ZPArgPtr
|
||||||
>PUSHW L.SSCANF.MAC
|
>PUSHW L.SSCANF.MAC
|
||||||
|
|
||||||
ldx #10
|
ldx #0
|
||||||
|
|
||||||
.2 >PUSHW L.MAC0,x
|
.2 >PUSHW L.MAC0,x
|
||||||
dex
|
inx
|
||||||
dex
|
inx
|
||||||
bpl .2
|
cpx #12
|
||||||
|
bne .2
|
||||||
|
|
||||||
>PUSHBI 12 6 x byte PTRs
|
>PUSHBI 12 6 x byte PTRs
|
||||||
>SYSCALL sscanf
|
>SYSCALL sscanf
|
||||||
bcc .8
|
bcc .8
|
||||||
|
|
||||||
lda #E.SYN
|
lda #E.SYN
|
||||||
sec
|
* sec
|
||||||
.8 rts
|
.8 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.END
|
CS.END
|
||||||
ARGS .BS 2
|
|
||||||
MSG.DETECT .AZ "UtherNet/CS8900A Driver."
|
MSG.DETECT .AZ "UtherNet/CS8900A Driver."
|
||||||
MSG.DETECT.OK .AZ "UtherNet/CS8900A Installed As Device : %s\r\n"
|
MSG.DETECT.OK .AZ "UtherNet/CS8900A Installed As Device : %s\r\n"
|
||||||
MSG.DETECT.KO .AZ "Hardware Not Found."
|
MSG.DETECT.KO .AZ "Hardware Not Found."
|
||||||
|
@ -4,13 +4,15 @@ NEW
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
FRM.Send ldx #3
|
FRM.Send ldx #3
|
||||||
|
|
||||||
.1 lda ZPFrameOutPtr,x Get Frame Ptr & Len
|
.1 lda ZPFrameOutPtr,x Get Frame Ptr & Len
|
||||||
sta IOCTL+S.IOCTL.BUFPTR,x
|
sta IOCTL+S.IOCTL.BUFPTR,x
|
||||||
dex
|
dex
|
||||||
bpl .1
|
bpl .1
|
||||||
FRM.Send.IOCTL >PUSHW L.IOCTL
|
|
||||||
|
FRM.Send.IOCTL >PUSHB ETKCFG+S.NETCFG.DevID
|
||||||
>PUSHBI IOCTL.WRITE
|
>PUSHBI IOCTL.WRITE
|
||||||
lda ETKCFG+S.NETCFG.DevID
|
>PUSHW L.IOCTL
|
||||||
>SYSCALL2 IOCTL
|
>SYSCALL2 IOCTL
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -40,10 +40,8 @@ CFG.SET >PULLW ZPTmpPtr1 IPCFG
|
|||||||
lda #S.IOCTL.STATCODE.GETDCB
|
lda #S.IOCTL.STATCODE.GETDCB
|
||||||
sta IOCTL+S.IOCTL.STATCODE
|
sta IOCTL+S.IOCTL.STATCODE
|
||||||
|
|
||||||
>PUSHW L.IOCTL
|
ldx #IOCTL.STATUS
|
||||||
>PUSHBI IOCTL.STATUS
|
jsr CFG.SET.IOCTL
|
||||||
lda IPCFG+S.NETCFG.DevID
|
|
||||||
>SYSCALL2 IOCTL
|
|
||||||
bcs .99
|
bcs .99
|
||||||
|
|
||||||
ldx #11 IP/MASK/GW
|
ldx #11 IP/MASK/GW
|
||||||
@ -56,10 +54,8 @@ CFG.SET >PULLW ZPTmpPtr1 IPCFG
|
|||||||
lda #S.IOCTL.CTRLCODE.SETDCB
|
lda #S.IOCTL.CTRLCODE.SETDCB
|
||||||
sta IOCTL+S.IOCTL.CTRLCODE
|
sta IOCTL+S.IOCTL.CTRLCODE
|
||||||
|
|
||||||
>PUSHW L.IOCTL
|
ldx #IOCTL.CONTROL
|
||||||
>PUSHBI IOCTL.CONTROL
|
jsr CFG.SET.IOCTL
|
||||||
lda IPCFG+S.NETCFG.DevID
|
|
||||||
>SYSCALL2 IOCTL
|
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
.5 lda hDNSSocket
|
.5 lda hDNSSocket
|
||||||
@ -97,6 +93,13 @@ CFG.SET >PULLW ZPTmpPtr1 IPCFG
|
|||||||
.8 clc
|
.8 clc
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
CFG.SET.IOCTL >PUSHB IPCFG+S.NETCFG.DevID
|
||||||
|
txa
|
||||||
|
>PUSHA
|
||||||
|
>PUSHW L.IOCTL
|
||||||
|
>SYSCALL2 IOCTL
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
CFG.GET >LDYA L.IPCFG
|
CFG.GET >LDYA L.IPCFG
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
@ -332,9 +332,9 @@ FRM.Send ldx #3
|
|||||||
dex
|
dex
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
FRM.Send.IOCTL >PUSHW L.IOCTL
|
FRM.Send.IOCTL >PUSHB IPCFG+S.NETCFG.DevID
|
||||||
>PUSHBI IOCTL.WRITE
|
>PUSHBI IOCTL.WRITE
|
||||||
lda IPCFG+S.NETCFG.DevID
|
>PUSHW L.IOCTL
|
||||||
>SYSCALL2 IOCTL
|
>SYSCALL2 IOCTL
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -5,7 +5,10 @@ NEW
|
|||||||
HST.GetByName >PULLW ZPPtrDNS
|
HST.GetByName >PULLW ZPPtrDNS
|
||||||
>PULLW ZPPtrIP
|
>PULLW ZPPtrIP
|
||||||
|
|
||||||
ldx #3
|
>PUSHW ZPPtrDNS
|
||||||
|
>PUSHW L.HST.SScanF
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
|
||||||
.1 txa
|
.1 txa
|
||||||
clc
|
clc
|
||||||
@ -16,12 +19,11 @@ HST.GetByName >PULLW ZPPtrDNS
|
|||||||
|
|
||||||
>PUSHYA @IP[3][2][1][0]
|
>PUSHYA @IP[3][2][1][0]
|
||||||
|
|
||||||
dex
|
inx
|
||||||
bpl .1
|
cpx #4
|
||||||
|
bne .1
|
||||||
|
|
||||||
>PUSHBI 8 4 PTRs on stack
|
>PUSHBI 8 4 PTRs on stack
|
||||||
>PUSHW L.HST.SScanF
|
|
||||||
>LDYA ZPPtrDNS
|
|
||||||
|
|
||||||
>SYSCALL2 SScanF
|
>SYSCALL2 SScanF
|
||||||
bcc .9
|
bcc .9
|
||||||
|
@ -1184,10 +1184,6 @@ SKT.SetRemAddr ldy #S.SOCKET.REM.PORT+1
|
|||||||
* SKT.LOC.ADDR = Incoming Frame DST
|
* SKT.LOC.ADDR = Incoming Frame DST
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SKT.FindMatchingLocRem
|
SKT.FindMatchingLocRem
|
||||||
.DO IPDEBUG=1
|
|
||||||
jsr FRM.Dump
|
|
||||||
.FIN
|
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
|
|
||||||
.1 lda SKT.TABLE,x
|
.1 lda SKT.TABLE,x
|
||||||
@ -1196,9 +1192,6 @@ SKT.FindMatchingLocRem
|
|||||||
phx
|
phx
|
||||||
>SYSCALL2 GetMemPtr
|
>SYSCALL2 GetMemPtr
|
||||||
>STYA ZPPtrSKT
|
>STYA ZPPtrSKT
|
||||||
.DO IPDEBUG=1
|
|
||||||
jsr SKT.Dump
|
|
||||||
.FIN
|
|
||||||
plx
|
plx
|
||||||
|
|
||||||
ldy #S.SOCKET.AF
|
ldy #S.SOCKET.AF
|
||||||
|
@ -122,9 +122,6 @@ TCP.IN.JMP.SYNRCVD
|
|||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TCP.IN.JMP.ESTBLSH
|
TCP.IN.JMP.ESTBLSH
|
||||||
.DO IPDEBUG=1
|
|
||||||
jsr DEBUG.IPID
|
|
||||||
.FIN
|
|
||||||
jsr SKT.GetTCB
|
jsr SKT.GetTCB
|
||||||
|
|
||||||
ldy #S.TCP.OPTIONS
|
ldy #S.TCP.OPTIONS
|
||||||
@ -569,19 +566,6 @@ TCP.AddAYToSktCacheAtX
|
|||||||
bne .8
|
bne .8
|
||||||
inc SKT.Cache,x
|
inc SKT.Cache,x
|
||||||
.8 rts
|
.8 rts
|
||||||
*--------------------------------------
|
|
||||||
.DO IPDEBUG=1
|
|
||||||
DEBUG.IPID ldy #S.IP.IDENTIFICATION
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
iny
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
>PUSHBI 2
|
|
||||||
>LDYA L.MSG.IPID
|
|
||||||
>SYSCALL PrintF
|
|
||||||
rts
|
|
||||||
.FIN
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
SAVE USR/SRC/LIB/LIBTCPIP.S.TCP
|
SAVE USR/SRC/LIB/LIBTCPIP.S.TCP
|
||||||
|
@ -5,13 +5,6 @@ NEW
|
|||||||
.OR $2000
|
.OR $2000
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
AUXPIPE .EQ 1
|
AUXPIPE .EQ 1
|
||||||
IPDEBUG .EQ 0
|
|
||||||
*--------------------------------------
|
|
||||||
.DO IPDEBUG=1
|
|
||||||
.TF lib/libtcpipd
|
|
||||||
.ELSE
|
|
||||||
.TF lib/libtcpip
|
|
||||||
.FIN
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.MA ADC16
|
.MA ADC16
|
||||||
clc
|
clc
|
||||||
@ -156,11 +149,6 @@ J.SKT.send .DA SKT.send.RAW
|
|||||||
.DA SKT.send.DGRAM
|
.DA SKT.send.DGRAM
|
||||||
.DA SKT.send.SEQPACKET
|
.DA SKT.send.SEQPACKET
|
||||||
.DA SKT.send.STREAM
|
.DA SKT.send.STREAM
|
||||||
.DO IPDEBUG=1
|
|
||||||
L.MSG.IPID .DA MSG.IPID
|
|
||||||
L.MSG.FRM.Dump .DA MSG.FRM.Dump
|
|
||||||
L.MSG.SKT.Dump .DA MSG.SKT.Dump
|
|
||||||
.FIN
|
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LIB.LOAD ldx RefCount
|
LIB.LOAD ldx RefCount
|
||||||
@ -258,90 +246,6 @@ GetDynPort inc DYNPORT.LAST
|
|||||||
ldx DYNPORT.LAST+1
|
ldx DYNPORT.LAST+1
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
|
||||||
.DO IPDEBUG=1
|
|
||||||
FRM.Dump ldy #S.TCPUDP.DSTPORT
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
iny
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
ldy #S.IP.DST+3
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
ldy #S.TCPUDP.SRCPORT
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
iny
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
ldy #S.IP.SRC+3
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPFrameInPtr),y
|
|
||||||
>PUSHA
|
|
||||||
>PUSHBI 12
|
|
||||||
>LDYA L.MSG.FRM.Dump
|
|
||||||
>SYSCALL2 Printf
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
SKT.Dump ldy #S.SOCKET.REM.PORT+1
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
ldy #S.SOCKET.REM.ADDR+3
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
ldy #S.SOCKET.LOC.PORT+1
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
ldy #S.SOCKET.LOC.ADDR+3
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPPtrSKT),y
|
|
||||||
>PUSHA
|
|
||||||
>PUSHBI 12
|
|
||||||
>LDYA L.MSG.SKT.Dump
|
|
||||||
>SYSCALL2 Printf
|
|
||||||
rts
|
|
||||||
.FIN
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.INB USR/SRC/LIB/LIBTCPIP.S.ARP
|
.INB USR/SRC/LIB/LIBTCPIP.S.ARP
|
||||||
.INB USR/SRC/LIB/LIBTCPIP.S.CFG
|
.INB USR/SRC/LIB/LIBTCPIP.S.CFG
|
||||||
@ -466,11 +370,6 @@ hFrameIn .BS 1
|
|||||||
hFrameOut .BS 1
|
hFrameOut .BS 1
|
||||||
HST.SScanF .AZ "%d.%d.%d.%d"
|
HST.SScanF .AZ "%d.%d.%d.%d"
|
||||||
IP.ID .BS 2
|
IP.ID .BS 2
|
||||||
.DO IPDEBUG=1
|
|
||||||
MSG.IPID .AZ "IPID:%H\r\n"
|
|
||||||
MSG.FRM.Dump .AZ "->FRM:SRC=%d.%d.%d.%d:%D DST=%d.%d.%d.%d:%D\r\n"
|
|
||||||
MSG.SKT.Dump .AZ " ?SKT:LOC=%d.%d.%d.%d:%D REM=%d.%d.%d.%d:%D\r\n"
|
|
||||||
.FIN
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
SAVE USR/SRC/LIB/LIBTCPIP.S
|
SAVE USR/SRC/LIB/LIBTCPIP.S
|
||||||
|
@ -103,9 +103,9 @@ CS.INIT.DEV >PUSHBI 0
|
|||||||
lda #S.IOCTL.STATCODE.GETDCB
|
lda #S.IOCTL.STATCODE.GETDCB
|
||||||
sta IOCTL+S.IOCTL.STATCODE
|
sta IOCTL+S.IOCTL.STATCODE
|
||||||
|
|
||||||
|
>PUSHB DevID
|
||||||
>PUSHW L.IOCTL
|
>PUSHW L.IOCTL
|
||||||
>PUSHBI IOCTL.STATUS
|
>PUSHBI IOCTL.STATUS
|
||||||
lda DevID
|
|
||||||
>SYSCALL IOCTL
|
>SYSCALL IOCTL
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -225,10 +225,10 @@ CS.INIT.CONF >LDYAI 64
|
|||||||
* clc
|
* clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN >PUSHW L.IOCTL
|
CS.RUN >PUSHB DevID
|
||||||
|
>PUSHW L.IOCTL
|
||||||
>PUSHBI IOCTL.READ
|
>PUSHBI IOCTL.READ
|
||||||
lda DevID
|
|
||||||
|
|
||||||
>SYSCALL IOCTL
|
>SYSCALL IOCTL
|
||||||
bcs .8 No Frame
|
bcs .8 No Frame
|
||||||
|
|
||||||
@ -291,10 +291,9 @@ CS.QUIT ldx #0
|
|||||||
.7 lda DevID
|
.7 lda DevID
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
pha
|
>PUSHA
|
||||||
>PUSHWZ
|
>PUSHWZ
|
||||||
>PUSHBI IOCTL.CLOSE
|
>PUSHBI IOCTL.CLOSE
|
||||||
pla
|
|
||||||
>SYSCALL IOCTL
|
>SYSCALL IOCTL
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
|
@ -48,16 +48,16 @@ K.SYSCALL .DA K.ChTyp $00 : STAT
|
|||||||
.DA K.PrintF
|
.DA K.PrintF
|
||||||
.DA K.FPrintF
|
.DA K.FPrintF
|
||||||
.DA K.SPrintF
|
.DA K.SPrintF
|
||||||
.DA 0
|
.DA K.ScanF
|
||||||
|
|
||||||
.DA K.ScanF $50
|
.DA K.FScanF $50
|
||||||
.DA K.FScanF
|
|
||||||
.DA K.SScanF
|
.DA K.SScanF
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA 0
|
.DA 0
|
||||||
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Bank 2
|
* Bank 2
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -351,26 +351,36 @@ MATH32.ACC322STR10
|
|||||||
MATH32.Hex2ACC32
|
MATH32.Hex2ACC32
|
||||||
lda (ZPPtr2)
|
lda (ZPPtr2)
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
jsr SHARED.IsHexDigit
|
jsr SHARED.IsHexDigit
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
jsr MATH32.A2ACC32
|
jsr MATH32.A2ACC32
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
|
|
||||||
.1 iny
|
.1 iny
|
||||||
lda (ZPPtr2),y
|
lda (ZPPtr2),y
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
jsr SHARED.IsHexDigit
|
jsr SHARED.IsHexDigit
|
||||||
bcs .8
|
bcs .8
|
||||||
|
|
||||||
pha
|
pha
|
||||||
ldx #4
|
ldx #4
|
||||||
|
|
||||||
.2 jsr MATH32.ACC32.T2
|
.2 jsr MATH32.ACC32.T2
|
||||||
dex
|
dex
|
||||||
bne .2
|
bne .2
|
||||||
|
|
||||||
pla
|
pla
|
||||||
ora ACC32
|
ora ACC32
|
||||||
sta ACC32
|
sta ACC32
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.9 sec
|
.9 sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -87,7 +87,7 @@ K.FPrintf ldx #2
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.SPrintf ldx #3
|
K.SPrintf ldx #3
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.PrintF.1 jsr STDIO.GetFormat
|
K.PrintF.1 jsr STDIO.GetParams
|
||||||
sty STDIO.Exit.Cnt+1 Total bytes to POP
|
sty STDIO.Exit.Cnt+1 Total bytes to POP
|
||||||
|
|
||||||
stz PrintF.Cnt
|
stz PrintF.Cnt
|
||||||
@ -170,7 +170,7 @@ K.PrintF.1 jsr STDIO.GetFormat
|
|||||||
bra .20
|
bra .20
|
||||||
.19 lda PrintFTBL2.OUT,x
|
.19 lda PrintFTBL2.OUT,x
|
||||||
|
|
||||||
.20 jsr PrintF.COut
|
.20 jsr PrintF.PutC
|
||||||
bcc .11
|
bcc .11
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.99 lda #E.BADARG
|
.99 lda #E.BADARG
|
||||||
@ -223,7 +223,7 @@ PrintF.B jsr STDIO.GetStackByte
|
|||||||
pha
|
pha
|
||||||
lda #'0'/2
|
lda #'0'/2
|
||||||
rol
|
rol
|
||||||
jsr PrintF.COut
|
jsr PrintF.PutC
|
||||||
bcs .9
|
bcs .9
|
||||||
pla
|
pla
|
||||||
dey
|
dey
|
||||||
@ -294,7 +294,7 @@ PrintF.StrNum ldy #0
|
|||||||
.2 lda A2osX.NumStrBuf,y
|
.2 lda A2osX.NumStrBuf,y
|
||||||
beq .8
|
beq .8
|
||||||
iny
|
iny
|
||||||
jsr PrintF.COut
|
jsr PrintF.PutC
|
||||||
bcc .2
|
bcc .2
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
@ -331,7 +331,7 @@ PrintF.SS ldy #$00 PSTR
|
|||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
beq .2
|
beq .2
|
||||||
|
|
||||||
jsr PrintF.COut
|
jsr PrintF.PutC
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
lda K.PrintF.PadL
|
lda K.PrintF.PadL
|
||||||
@ -346,7 +346,7 @@ PrintF.SS ldy #$00 PSTR
|
|||||||
.3 cpy K.PrintF.PadL
|
.3 cpy K.PrintF.PadL
|
||||||
beq .8
|
beq .8
|
||||||
lda K.PrintF.PadC
|
lda K.PrintF.PadC
|
||||||
jsr PrintF.COut
|
jsr PrintF.PutC
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
iny
|
iny
|
||||||
@ -356,27 +356,27 @@ PrintF.SS ldy #$00 PSTR
|
|||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
PrintF.HH jsr STDIO.GetStackByte
|
PrintF.HH jsr STDIO.GetStackByte
|
||||||
bcs PrintF.COut.RTS
|
bcs PrintF.PutC.RTS
|
||||||
pha LO byte
|
pha LO byte
|
||||||
jsr STDIO.GetStackByte
|
jsr STDIO.GetStackByte
|
||||||
plx
|
plx
|
||||||
bcs PrintF.COut.RTS
|
bcs PrintF.PutC.RTS
|
||||||
pha
|
pha
|
||||||
txa
|
txa
|
||||||
jsr PrintF.H.1
|
jsr PrintF.H.1
|
||||||
plx
|
plx
|
||||||
bcs PrintF.COut.RTS
|
bcs PrintF.PutC.RTS
|
||||||
txa
|
txa
|
||||||
bra PrintF.H.1
|
bra PrintF.H.1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
PrintF.H jsr STDIO.GetStackByte
|
PrintF.H jsr STDIO.GetStackByte
|
||||||
bcs PrintF.COut.RTS
|
bcs PrintF.PutC.RTS
|
||||||
PrintF.H.1 jsr MATH32.AToHexAX
|
PrintF.H.1 jsr MATH32.AToHexAX
|
||||||
jsr PrintF.COut
|
jsr PrintF.PutC
|
||||||
bcs PrintF.COut.RTS
|
bcs PrintF.PutC.RTS
|
||||||
txa
|
txa
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
PrintF.COut phy
|
PrintF.PutC phy
|
||||||
ldy PrintF.Cnt
|
ldy PrintF.Cnt
|
||||||
sta (pIOBuf),y
|
sta (pIOBuf),y
|
||||||
ply
|
ply
|
||||||
@ -392,7 +392,7 @@ PrintF.COut phy
|
|||||||
|
|
||||||
.9 lda #E.BUF
|
.9 lda #E.BUF
|
||||||
sec
|
sec
|
||||||
PrintF.COut.RTS rts
|
PrintF.PutC.RTS rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # ScanF (BLOCKING)
|
* # ScanF (BLOCKING)
|
||||||
* # FScanF (BLOCKING)
|
* # FScanF (BLOCKING)
|
||||||
@ -450,7 +450,7 @@ K.FScanF ldx #2
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.SScanF ldx #3
|
K.SScanF ldx #3
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.SScanF.1 jsr STDIO.GetFormat
|
K.SScanF.1 jsr STDIO.GetParams
|
||||||
sty STDIO.Exit.Cnt+1 Total bytes to POP
|
sty STDIO.Exit.Cnt+1 Total bytes to POP
|
||||||
|
|
||||||
.1 jsr SHARED.GetCharPtr2 End Of format?
|
.1 jsr SHARED.GetCharPtr2 End Of format?
|
||||||
@ -461,20 +461,21 @@ K.SScanF.1 jsr STDIO.GetFormat
|
|||||||
|
|
||||||
cmp #C.SPACE Space ?
|
cmp #C.SPACE Space ?
|
||||||
beq .12
|
beq .12
|
||||||
|
|
||||||
cmp (ZPPtr1) Same char in string?
|
sta .11+1
|
||||||
bne .9
|
|
||||||
|
jsr Scanf.GetC
|
||||||
inc ZPPtr1
|
bcs .9
|
||||||
bne .1
|
|
||||||
inc ZPPtr1+1
|
|
||||||
bra .1
|
|
||||||
|
|
||||||
.12 inc ZPPtr1
|
|
||||||
bne .13
|
|
||||||
inc ZPPtr1+1
|
|
||||||
|
|
||||||
.13 cmp (ZPPtr1) another one ?
|
.11 cmp #$ff Same char in string?
|
||||||
|
beq .1
|
||||||
|
|
||||||
|
bra .9
|
||||||
|
|
||||||
|
.12 jsr Scanf.GetC
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
cmp #C.SPACE another space ?
|
||||||
beq .12
|
beq .12
|
||||||
|
|
||||||
bne .1
|
bne .1
|
||||||
@ -570,24 +571,43 @@ K.SScanF.S ldy #$ff
|
|||||||
|
|
||||||
K.SScanF.Fwd jmp SHARED.AddYToPtr1 Y=char count parsed
|
K.SScanF.Fwd jmp SHARED.AddYToPtr1 Y=char count parsed
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
Scanf.GetC lda PrintF.hFILE
|
||||||
|
beq .7
|
||||||
|
|
||||||
|
|
||||||
|
bra *
|
||||||
|
|
||||||
|
|
||||||
|
.7 lda (pIOBuf)
|
||||||
|
beq .9
|
||||||
|
|
||||||
|
inc pIOBuf
|
||||||
|
bne .8
|
||||||
|
inc pIOBuf+1
|
||||||
|
|
||||||
|
.8 clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.9 sec
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
* Y = Bytecount
|
* Y = Bytecount
|
||||||
* X = 3 : get format & buffer
|
* X = 3 : get format & buffer
|
||||||
* X = 2 : get format & hFile
|
* X = 2 : get format & hFile
|
||||||
* X = 1 : get format only
|
* X = 1 : get format only
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
STDIO.GetFormat lda (pStack) Bytecount
|
STDIO.GetParams lda (pStack) Bytecount
|
||||||
|
|
||||||
tay
|
tay
|
||||||
sty STDIO.GetStackByte.ptr+1
|
sty STDIO.GetStackByte.ptr+1
|
||||||
|
|
||||||
iny
|
iny
|
||||||
|
|
||||||
lda (pStack),y format LO
|
lda (pStack),y format LO
|
||||||
sta ZPPtr2
|
sta ZPPtr2
|
||||||
|
|
||||||
iny
|
iny
|
||||||
lda (pStack),y format HI
|
lda (pStack),y format HI
|
||||||
sta ZPPtr2+1
|
sta ZPPtr2+1
|
||||||
iny
|
|
||||||
|
|
||||||
dex
|
dex
|
||||||
beq .1
|
beq .1
|
||||||
@ -597,20 +617,20 @@ STDIO.GetFormat lda (pStack) Bytecount
|
|||||||
|
|
||||||
.3 stz PrintF.hFILE
|
.3 stz PrintF.hFILE
|
||||||
|
|
||||||
|
iny
|
||||||
lda (pStack),y str LO
|
lda (pStack),y str LO
|
||||||
sta pIOBuf
|
sta pIOBuf
|
||||||
|
|
||||||
iny
|
iny
|
||||||
lda (pStack),y str HI
|
lda (pStack),y str HI
|
||||||
sta pIOBuf+1
|
sta pIOBuf+1
|
||||||
iny
|
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.2 lda (pStack),y hFILE
|
.2 iny
|
||||||
|
lda (pStack),y hFILE
|
||||||
sta PrintF.hFILE
|
sta PrintF.hFILE
|
||||||
|
|
||||||
iny
|
|
||||||
|
|
||||||
.1 lda #K.IOBuf
|
.1 lda #K.IOBuf
|
||||||
sta pIOBuf
|
sta pIOBuf
|
||||||
lda /K.IOBuf
|
lda /K.IOBuf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user