Kernel version 0.9 : MEDIA reorganisation, FORMAT Cmd

This commit is contained in:
Rémy GIBERT 2017-03-30 18:11:31 +02:00
parent c20ea8b40f
commit 5284913187
23 changed files with 509 additions and 314 deletions

Binary file not shown.

Binary file not shown.

View File

@ -34,7 +34,11 @@ CS.START cld
.DA CS.DOEVENT .DA CS.DOEVENT
.DA CS.QUIT .DA CS.QUIT
L.LIBBLKDEV .DA LIBBLKDEV L.LIBBLKDEV .DA LIBBLKDEV
L.MSG.USAGE .DA MSG.USAGE L.BlkParams.Ptr .DA BlkParams.Ptr
L.MSG.USAGE .DA MSG.USAGE
L.MSG.INIT .DA MSG.INIT
L.MSG.OK .DA MSG.OK
L.MSG.ERR .DA MSG.ERR
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
CS.INIT >SYSCALL GetArgC CS.INIT >SYSCALL GetArgC
@ -82,27 +86,58 @@ CS.INIT >SYSCALL GetArgC
sta (pData),y sta (pData),y
bra .1 bra .1
.4 lda (pData) .4 ldy #hDev
bne .99 Already have a vol name...syntax error lda (pData),y
bne .5 Already have a dev name...go get VolName
lda (ZPPtr1) lda (ZPPtr1)
cmp #4
bne .99 DevName must be DxDy
>LDYA ZPPtr1
>SYSCALL GetDevByNameYA
bcs .99
txa
ldy #hDev
sta (pData),y
bra .1
.5 lda (ZPPtr1)
cmp #16 cmp #16
bcc .5 bcs .99 VolName too long
lda #15
.5 sta (ZPPtr1)
tay tay
.6 lda (ZPPtr1),y .6 lda (ZPPtr1),y
sta (pData),y sta (pData),y
dey dey
bne .6 bpl .6
bra .1 success, scan for any other args
bra .1 success, scan for any other args
.7 lda (pData) .7 lda (pData)
bne .8 Volume name ok bne .8 Volume name ok
lda A2osX.TIMER16
jsr A2CharAX
sta DefaultVolName+6
stx DefaultVolName+7
lda A2osX.TIMER16+1
jsr A2CharAX
sta DefaultVolName+8
stx DefaultVolName+9
lda A2osX.RANDOM16
jsr A2CharAX
sta DefaultVolName+10
stx DefaultVolName+11
lda A2osX.RANDOM16+1
jsr A2CharAX
sta DefaultVolName+12
stx DefaultVolName+13
ldy DefaultVolName ldy DefaultVolName
.71 lda DefaultVolName,y .71 lda DefaultVolName,y
@ -121,23 +156,113 @@ CS.INIT >SYSCALL GetArgC
clc clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN ldy #bCANCEL CS.RUN jsr CS.RUN.BuildCat
lda (pData),y bcs .9
bmi .99
jsr CS.RUN.WriteCat
bcs .9
>LDYA L.MSG.OK
.8 clc >SYSCALL CPrintFYA
rts lda #0
.99 lda #0
sec sec
rts rts
.9 pha
>PUSHA
>LDYA L.MSG.ERR
>SYSCALL CPrintFYA
pla
sec
rts
*--------------------------------------
CS.RUN.BuildCat ldy #hDev
lda (pData),y
>SYSCALL GetDevStatusA
bcs .99
>STYA ZPPtr1
ldy #S.DEVSTAT.SIZE
lda (ZPPtr1),y
sta BlockSize
iny
lda (ZPPtr1),y
sta BlockSize+1
ldy #hDev
lda (pData),y
>SYSCALL GetDevByIDA
bcs .99
pha
tya
adc #S.DEV.NAME
sta ZPPtr2
pla
adc /S.DEV.NAME
sta ZPPtr2+1
>PUSHW pData
>PUSHW BlockSize
>PUSHW ZPPtr2
>LDYA L.MSG.INIT
>SYSCALL CPrintFYA
bcs .9
>PUSHW BlockSize
>LIBCALL hLIBBLKDEV,LIBBLKDEV.GetProDOSCatSize
.99 bcs .9
stx BlkCnt
>PUSHYA BufferSize
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
bcs .9
>STYA BlkParams.Ptr
txa
ldy #hBuf
sta (pData),y
>PUSHW BlockSize
>PUSHW pData
>PUSHW BlkParams.Ptr
>LIBCALL hLIBBLKDEV,LIBBLKDEV.BuildProDOSCat
.9 rts
*--------------------------------------
CS.RUN.WriteCat stz BlkParams.Num
stz BlkParams.Num+1
ldy #hDev
lda (pData),y
>SYSCALL GetDevByIDA
bcs .9
>STYA pDev
.1 >LDYA L.BlkParams.Ptr
ldx #DEVMGR.WRITEBLOCK
>DEBUG
jsr pDevJmp
bcs .9
inc BlkParams.Ptr+1
inc BlkParams.Ptr+1
inc BlkParams.Num
dec BlkCnt
bne .1
.9 rts
*-------------------------------------- *--------------------------------------
CS.DOEVENT sec CS.DOEVENT sec
rts rts
*-------------------------------------- *--------------------------------------
CS.QUIT lda hLIBBLKDEV CS.QUIT ldy #hBuf
lda (pData),y
beq .1
>SYSCALL FreeMemA
.1 lda hLIBBLKDEV
beq .8 beq .8
>SYSCALL UnloadLibA >SYSCALL UnloadLibA
@ -145,6 +270,25 @@ CS.QUIT lda hLIBBLKDEV
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
A2CharAX pha
lsr
lsr
lsr
lsr
and #$0F
ora #$30
cmp #'9'+1
bcc .1
adc #6
.1 tax
pla
and #$0F
ora #$30
cmp #'9'+1
bcc .8
adc #6
.8 rts
*--------------------------------------
CS.END CS.END
*-------------------------------------- *--------------------------------------
OptionList >PSTR "L" OptionList >PSTR "L"
@ -153,19 +297,24 @@ OptionVars .DA #bLL
MSG.USAGE >CSTR "Usage : FORMAT <BLOCKDEV> [VOLUME.NAME]\r\n -L : Low-Level Format\r\n" MSG.USAGE >CSTR "Usage : FORMAT <BLOCKDEV> [VOLUME.NAME]\r\n -L : Low-Level Format\r\n"
MSG.OK >CSTR "[OK]\r\n" MSG.OK >CSTR "[OK]\r\n"
MSG.ERR >CSTR "[%h]\r\n" MSG.ERR >CSTR "[%h]\r\n"
MSG.INIT >CSTR "Formatting %S (%D Blks),Volname:%S..."
*-------------------------------------- *--------------------------------------
LIBBLKDEV >PSTR "libblkdev.o" LIBBLKDEV >PSTR "libblkdev.o"
DefaultVolName >PSTR "BLANK" DefaultVolName >PSTR "BLANKXXXXXXXX"
ArgCount .BS 1 ArgCount .BS 1
ArgIndex .BS 1 ArgIndex .BS 1
hLIBBLKDEV .BS 1 hLIBBLKDEV .BS 1
BlockSize .BS 2
hBuf .BS 1
BlkCnt .BS 1
BlkParams.Ptr .BS 2
BlkParams.Num .BS 2
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0
DS.START DS.START
VolName .BS 16 VolName .BS 16
DevName .BS 4 hDev .BS 5
bCANCEL .BS 1
bLL .BS 1 bLL .BS 1
DS.END DS.END
.ED .ED

View File

@ -75,13 +75,13 @@ L.TrkWriter .DA TrkWriter
L.ProDOS.Boot .DA ProDOS.Boot L.ProDOS.Boot .DA ProDOS.Boot
.DA 0 .DA 0
*/-------------------------------------- */--------------------------------------
* #GetProDOSCatSize * # GetProDOSCatSize
* Compute space needed for ProDOS Catalog * Compute space needed for ProDOS Catalog
* ##In : * ## In :
* PUSHW = DevSize (in 512b blocks) * PUSHW = DevSize (in 512b blocks)
* ##Out : * ## Out :
* X=BlockCount (max 22) * X=BlockCount (max 22)
* A=PageCount (max 44) * Y,A=BufSize (max $4400)
*\-------------------------------------- *\--------------------------------------
GetProDOSCatSize GetProDOSCatSize
>PULLAX A=DevSizeLo >PULLAX A=DevSizeLo
@ -109,8 +109,8 @@ GetProDOSCatSizeAX
asl A = Total pages needed to build catalog. asl A = Total pages needed to build catalog.
rts rts
*/-------------------------------------- */--------------------------------------
* #BuildProDOSCat * # BuildProDOSCat
* ##In : * ## In :
* PUSHW = DevSize (in 512b blocks) * PUSHW = DevSize (in 512b blocks)
* PUSHW = VolName (PSTR) * PUSHW = VolName (PSTR)
* PUSHW = DstBuf (Zero filled) * PUSHW = DstBuf (Zero filled)
@ -250,7 +250,8 @@ BuildProDOSCat >PULLW ZPPtr1 DstBuf
inc ZPPtr1+1 inc ZPPtr1+1
bra .7 bra .7
.88 rts .88 clc
rts
*/-------------------------------------- */--------------------------------------
*\-------------------------------------- *\--------------------------------------
D2TrkRNIB D2TrkRNIB
@ -258,13 +259,13 @@ D2TrkRNIB
*\-------------------------------------- *\--------------------------------------
D2TrkR16s D2TrkR16s
*/-------------------------------------- */--------------------------------------
* #TrkW16s * # TrkW16s
* Write a track (16 sectors) * Write a track (16 sectors)
* ##In: * ## In:
* PUSHW = Ptr to 16*256 buffer * PUSHW = Ptr to 16*256 buffer
* PUSHB = TrackNum * 4 : 0->140+ * PUSHB = TrackNum * 4 : 0->140+
* PUSHB = DSSS0000 * PUSHB = DSSS0000
* ##Out: * ## Out:
* CC : success * CC : success
* CS : A = Error * CS : A = Error
* A=0, currently starting/seeking... * A=0, currently starting/seeking...
@ -274,13 +275,13 @@ D2TrkW16s
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #TrkWNIB * # TrkWNIB
* Write a track (NIBBLE) * Write a track (NIBBLE)
* ##In: * ## In:
* PUSHW = Ptr to NIBBLE buffer (0 ended) * PUSHW = Ptr to NIBBLE buffer (0 ended)
* PUSHB = TrackNum * 4 : 0->140+ * PUSHB = TrackNum * 4 : 0->140+
* PUSHB = DSSS0000 * PUSHB = DSSS0000
* ##Out: * ## Out:
* CC : success * CC : success
* CS : A = Error * CS : A = Error
* A=0, currently starting/seeking... * A=0, currently starting/seeking...
@ -493,7 +494,38 @@ TrkWriter.Start lda D2ReadMode,x
TrkWriter.Size .EQ *-TrkWriter.Start TrkWriter.Size .EQ *-TrkWriter.Start
.EP .EP
*-------------------------------------- *--------------------------------------
ProDOS.Boot .BS 512 ProDOS.Boot .HS 01 38 b0 03 4c 32 a1 86 43 c9 03 08 8a 29 70 4a
.HS 4a 4a 4a 09 c0 85 49 a0 ff 84 48 28 c8 b1 48 d0
.HS 3a b0 0e a9 03 8d 00 08 e6 3d a5 49 48 a9 5b 48
.HS 60 85 40 85 48 a0 63 b1 48 99 94 09 c8 c0 eb d0
.HS f6 a2 06 bc 1d 09 bd 24 09 99 f2 09 bd 2b 09 9d
.HS 7f 0a ca 10 ee a9 09 85 49 a9 86 a0 00 c9 f9 b0
.HS 2f 85 48 84 60 84 4a 84 4c 84 4e 84 47 c8 84 42
.HS c8 84 46 a9 0c 85 61 85 4b 20 12 09 b0 68 e6 61
.HS e6 61 e6 46 a5 46 c9 06 90 ef ad 00 0c 0d 01 0c
.HS d0 6d a9 04 d0 02 a5 4a 18 6d 23 0c a8 90 0d e6
.HS 4b a5 4b 4a b0 06 c9 0a f0 55 a0 04 84 4a ad 02
.HS 09 29 0f a8 b1 4a d9 02 09 d0 db 88 10 f6 29 f0
.HS c9 20 d0 3b a0 10 b1 4a c9 ff d0 33 c8 b1 4a 85
.HS 46 c8 b1 4a 85 47 a9 00 85 4a a0 1e 84 4b 84 61
.HS c8 84 4d 20 12 09 b0 17 e6 61 e6 61 a4 4e e6 4e
.HS b1 4a 85 46 b1 4c 85 47 11 4a d0 e7 4c 00 20 4c
.HS 3f 09 26 50 52 4f 44 4f 53 20 20 20 20 20 20 20
.HS 20 20 a5 60 85 44 a5 61 85 45 6c 48 00 08 1e 24
.HS 3f 45 47 76 f4 d7 d1 b6 4b b4 ac a6 2b 18 60 4c
.HS bc 09 a9 9f 48 a9 ff 48 a9 01 a2 00 4c 79 f4 20
.HS 58 fc a0 1c b9 50 09 99 ae 05 88 10 f7 4c 4d 09
.HS aa aa aa a0 d5 ce c1 c2 cc c5 a0 d4 cf a0 cc cf
.HS c1 c4 a0 d0 d2 cf c4 cf d3 a0 aa aa aa a5 53 29
.HS 03 2a 05 2b aa bd 80 c0 a9 2c a2 11 ca d0 fd e9
.HS 01 d0 f7 a6 2b 60 a5 46 29 07 c9 04 29 03 08 0a
.HS 28 2a 85 3d a5 47 4a a5 46 6a 4a 4a 85 41 0a 85
.HS 51 a5 45 85 27 a6 2b bd 89 c0 20 bc 09 e6 27 e6
.HS 3d e6 3d b0 03 20 bc 09 bc 88 c0 60 a5 40 0a 85
.HS 53 a9 00 85 54 a5 53 85 50 38 e5 51 f0 14 b0 04
.HS e6 53 90 02 c6 53 38 20 6d 09 a5 50 18 20 6f 09
.HS d0 e3 a0 7f 84 52 08 28 38 c6 52 f0 ce 18 08 88
.HS f0 f5 bd 8c c0 10 fb 00 00 00 00 00 00 00 00 00
*-------------------------------------- *--------------------------------------
VolDirHdr .DA 0 pointer to previous block VolDirHdr .DA 0 pointer to previous block
.DA 3 pointer to next block .DA 3 pointer to next block

View File

@ -5,10 +5,10 @@ INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
*/-------------------------------------- */--------------------------------------
* #ARP.Clear * # ARP.Clear
* Clear ARP Cache * Clear ARP Cache
* ##In : * ## In :
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
ARP.Clear ldx #K.ARPCACHE.SIZE*S.ARPCACHE ARP.Clear ldx #K.ARPCACHE.SIZE*S.ARPCACHE
.1 stz ARP.CACHE-1,x .1 stz ARP.CACHE-1,x
@ -17,12 +17,12 @@ ARP.Clear ldx #K.ARPCACHE.SIZE*S.ARPCACHE
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #ARP.Query * # ARP.Query
* Query ARP Cache and returns HW address * Query ARP Cache and returns HW address
* ##In: * ## In:
* PUSHW PTR to MAC (to fill) * PUSHW PTR to MAC (to fill)
* PUSHW PTR to IP * PUSHW PTR to IP
* ##Out: * ## Out:
* CC: hit: MAC filled * CC: hit: MAC filled
* CS: missed * CS: missed
*\-------------------------------------- *\--------------------------------------
@ -45,9 +45,9 @@ ARP.Query >PULLW ZPPtrIP IP
clc clc
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #ARP.Add * # ARP.Add
* Add a static ARP cache record * Add a static ARP cache record
* ##In: * ## In:
* PUSHW PTR to MAC * PUSHW PTR to MAC
* PUSHW PTR to IP * PUSHW PTR to IP
*\-------------------------------------- *\--------------------------------------
@ -86,10 +86,10 @@ ARP.ADD.I sta ARP.TmpCache
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #ARP.GetCache * # ARP.GetCache
* Return a Ptr to ARP Cache Table * Return a Ptr to ARP Cache Table
* ##In: * ## In:
* ##Out: * ## Out:
* Y,A = PTR to ARP.CACHE * Y,A = PTR to ARP.CACHE
*\-------------------------------------- *\--------------------------------------
ARP.GetCache >LDYA L.ARP.CACHE ARP.GetCache >LDYA L.ARP.CACHE

View File

@ -5,10 +5,10 @@ INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
*/-------------------------------------- */--------------------------------------
* #DNS.Clear * # DNS.Clear
* Clear DNS Cache * Clear DNS Cache
* ##In : * ## In :
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
DNS.Clear ldx #K.DNSCACHE.SIZE*S.DNSCACHE DNS.Clear ldx #K.DNSCACHE.SIZE*S.DNSCACHE
.1 stz DNS.CACHE-1,x .1 stz DNS.CACHE-1,x
@ -17,12 +17,12 @@ DNS.Clear ldx #K.DNSCACHE.SIZE*S.DNSCACHE
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #DNS.Query * # DNS.Query
* Query DNS for specified host * Query DNS for specified host
* ##In: * ## In:
* PUSHW = PTR to IP to fill with cached data * PUSHW = PTR to IP to fill with cached data
* PUSHW = hostname PTR to PSTR * PUSHW = hostname PTR to PSTR
* ##Out: * ## Out:
* CC: hit: IP filled with address * CC: hit: IP filled with address
* CS: missed * CS: missed
*\-------------------------------------- *\--------------------------------------
@ -125,9 +125,9 @@ DNS.REQUEST lda hDNSSocket1
.9 sec .9 sec
rts rts
*/-------------------------------------- */--------------------------------------
* #DNS.Add * # DNS.Add
* Add a static DNS record * Add a static DNS record
* ##In: * ## In:
* PUSHW = PTR to IP * PUSHW = PTR to IP
* PUSHW = hostname PSTR to Add * PUSHW = hostname PSTR to Add
*\-------------------------------------- *\--------------------------------------
@ -175,10 +175,10 @@ DNS.ADD.I sta DNS.TmpCache
clc clc
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #DNS.GetCache * # DNS.GetCache
* Return a Ptr to DNS Cache Table * Return a Ptr to DNS Cache Table
* ##In: * ## In:
* ##Out: * ## Out:
* Y,A = PTR to DNS.CACHE * Y,A = PTR to DNS.CACHE
*\-------------------------------------- *\--------------------------------------
DNS.GetCache >LDYA L.DNS.CACHE DNS.GetCache >LDYA L.DNS.CACHE

View File

@ -5,11 +5,11 @@ INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
*/-------------------------------------- */--------------------------------------
* #SKT.New * # SKT.New
* Create a new socket * Create a new socket
* ##In : * ## In :
* PUSHW = PTR to S.SOCKET template * PUSHW = PTR to S.SOCKET template
* ##Out : * ## Out :
* YA = PTR to new S.SOCKET * YA = PTR to new S.SOCKET
* X = hSocket * X = hSocket
*\-------------------------------------- *\--------------------------------------
@ -122,11 +122,11 @@ SKT.New.Listen sec
sec sec
.99 rts .99 rts
*/-------------------------------------- */--------------------------------------
* #SKT.CloseA * # SKT.CloseA
* Close socket * Close socket
* ##In : * ## In :
* A = hSocket * A = hSocket
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
SKT.CloseA and #$7f SKT.CloseA and #$7f
cmp #K.SKTTABLE.SIZE cmp #K.SKTTABLE.SIZE
@ -193,11 +193,11 @@ SKT.CloseA and #$7f
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #SKT.GetA * # SKT.GetA
* Get Ptr to socket * Get Ptr to socket
* ##In : * ## In :
* A = hSocket * A = hSocket
* ##Out : * ## Out :
* Y,A = pS.SOCKET * Y,A = pS.SOCKET
*\-------------------------------------- *\--------------------------------------
SKT.GetA jsr SKT.GetA.I SKT.GetA jsr SKT.GetA.I
@ -250,10 +250,10 @@ SKT.GetA.I and #$7f
sec sec
rts rts
*/-------------------------------------- */--------------------------------------
* #SKT.GetTable * # SKT.GetTable
* Get socket table * Get socket table
* ##In : * ## In :
* ##Out : * ## Out :
* Y,A = pS.SOCKET * Y,A = pS.SOCKET
*\-------------------------------------- *\--------------------------------------
SKT.GetTable lda hSocketTable SKT.GetTable lda hSocketTable
@ -261,11 +261,11 @@ SKT.GetTable lda hSocketTable
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #SKT.AcceptA * # SKT.AcceptA
* Check for an incoming connection * Check for an incoming connection
* ##In : * ## In :
* A = hListeningSocket * A = hListeningSocket
* ##Out : * ## Out :
* A = hSocket * A = hSocket
*\-------------------------------------- *\--------------------------------------
SKT.AcceptA jsr SKT.GetA.I SKT.AcceptA jsr SKT.GetA.I
@ -302,11 +302,11 @@ SKT.AcceptA jsr SKT.GetA.I
sec sec
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #SKT.MkNodA * # SKT.MkNodA
* Create a new file from TCP socket * Create a new file from TCP socket
* ##In : * ## In :
* A = hSocket * A = hSocket
* ##Out : * ## Out :
* A = hFile * A = hFile
*\-------------------------------------- *\--------------------------------------
SKT.MkNodA SKT.MkNodA
@ -314,13 +314,13 @@ SKT.MkNodA
sec sec
rts rts
*/-------------------------------------- */--------------------------------------
* #SKT.Write (DGRAM,STREAM,RAW) * # SKT.Write (DGRAM,STREAM,RAW)
* Send block of data * Send block of data
* ##In : * ## In :
* PUSHB = hSocket * PUSHB = hSocket
* PUSHW = pBuf * PUSHW = pBuf
* PUSHW = len * PUSHW = len
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
SKT.Write >PULLW ZPDataInLen SKT.Write >PULLW ZPDataInLen
>PULLW ZPDataInPtr >PULLW ZPDataInPtr
@ -419,10 +419,10 @@ SKT.Write.TCP ldy #S.SOCKET.TCP.STATUS
sec sec
.99 rts .99 rts
*/-------------------------------------- */--------------------------------------
* #SKT.ReadA (DGRAM,RAW) * # SKT.ReadA (DGRAM,RAW)
* ##In : * ## In :
* A = hSocket * A = hSocket
* ##Out : * ## Out :
* A = hFrame * A = hFrame
*\-------------------------------------- *\--------------------------------------
SKT.ReadA jsr SKT.GetA.I SKT.ReadA jsr SKT.GetA.I
@ -455,12 +455,12 @@ SKT.ReadA jsr SKT.GetA.I
.99 sec .99 sec
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #SKT.PutC (STREAM) * # SKT.PutC (STREAM)
* Write a Char To Stream * Write a Char To Stream
* ##In : * ## In :
* PUSHB = hSocket * PUSHB = hSocket
* PUSHB = Char * PUSHB = Char
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
SKT.PutC >PULLB TmpByte SKT.PutC >PULLB TmpByte
@ -475,12 +475,12 @@ SKT.PutC >PULLB TmpByte
stx ZPDataInPtr+1 stx ZPDataInPtr+1
bra SKT.PutS.1 bra SKT.PutS.1
*/-------------------------------------- */--------------------------------------
* #SKT.PutS (STREAM) * # SKT.PutS (STREAM)
* Write Line in pBuf * Write Line in pBuf
* ##In : * ## In :
* PUSHB = hSocket * PUSHB = hSocket
* PUSHW = PSTR * PUSHW = PSTR
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
SKT.PutS >PULLW ZPDataOutPtr SKT.PutS >PULLW ZPDataOutPtr
lda (ZPDataInPtr) lda (ZPDataInPtr)
@ -505,11 +505,11 @@ SKT.PutS.1 >PULLA
sec sec
rts rts
*/-------------------------------------- */--------------------------------------
* #SKT.GetCA (STREAM) * # SKT.GetCA (STREAM)
* Read a Char From Stream in A * Read a Char From Stream in A
* ##In : * ## In :
* A = hSocket * A = hSocket
* ##Out : * ## Out :
* A = char * A = char
*\-------------------------------------- *\--------------------------------------
SKT.GetCA stz bTextMode SKT.GetCA stz bTextMode
@ -529,25 +529,25 @@ SKT.GetCA stz bTextMode
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #SKT.GetS (STREAM) * # SKT.GetS (STREAM)
* Read a CR terminated Line in pBuf * Read a CR terminated Line in pBuf
* ##In : * ## In :
* PUSHB = hSocket * PUSHB = hSocket
* PUSHW = pBuf * PUSHW = pBuf
* PUSHW = len * PUSHW = len
* ##Out : * ## Out :
* Y,A = bytes read * Y,A = bytes read
*\-------------------------------------- *\--------------------------------------
SKT.GetS sec SKT.GetS sec
.HS 90 bcc .HS 90 bcc
*/-------------------------------------- */--------------------------------------
* #SKT.Read (STREAM) * # SKT.Read (STREAM)
* Read data in pBuf * Read data in pBuf
* ##In : * ## In :
* PUSHB = hSocket * PUSHB = hSocket
* PUSHW = pBuf * PUSHW = pBuf
* PUSHW = len * PUSHW = len
* ##Out : * ## Out :
* Y,A = bytes transfered * Y,A = bytes transfered
*\-------------------------------------- *\--------------------------------------
SKT.Read clc SKT.Read clc

View File

@ -146,6 +146,7 @@ note : '$VAR' does NOT expand Variable
| CAT | Working | -A : Show All non printable caracters | 0.9 | | CAT | Working | -A : Show All non printable caracters | 0.9 |
| | | -N : Number all output lines | | | | | -N : Number all output lines | |
| | | -S : Suppress repeated empty output lines | | | | | -S : Suppress repeated empty output lines | |
| FORMAT | In Progress | -L : Low-Level Format | 0.9 |
| EDIT | Working | still missing : find/replace | 0.9 | | EDIT | Working | still missing : find/replace | 0.9 |
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.9 | | NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.9 |
| ---- | ------ | ------- | ----- | | ---- | ------ | ------- | ----- |

View File

@ -4,11 +4,11 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #GetArgC * # GetArgC
* Returns argument count in the process command line. * Returns argument count in the process command line.
* ##In: * ## In:
* none. * none.
* ##Out: * ## Out:
* A = Command line Arg Count (Including /path/cmd) * A = Command line Arg Count (Including /path/cmd)
*\-------------------------------------- *\--------------------------------------
K.GetArgC jsr ARG.InitArgPtr1 K.GetArgC jsr ARG.InitArgPtr1
@ -25,10 +25,10 @@ K.GetArgC jsr ARG.InitArgPtr1
.8 txa .8 txa
rts rts
*/-------------------------------------- */--------------------------------------
* #GetArgA * # GetArgA
* ##In: * ## In:
* A = argument index. * A = argument index.
* ##Out: * ## Out:
* CC : success * CC : success
* Y,A = PStr To Arg[A] * Y,A = PStr To Arg[A]
* CS : Out Of Bound * CS : Out Of Bound

View File

@ -4,12 +4,12 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #FPutCAY * # FPutCAY
* Print A (char) to File * Print A (char) to File
* ##In: * ## In:
* A : char to print * A : char to print
* Y = hFILE * Y = hFILE
* ##Out: * ## Out:
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.FPutCAY sta K.PutC.Char K.FPutCAY sta K.PutC.Char
@ -21,11 +21,11 @@ K.PutCA.8 ply
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #PutCA * # PutCA
* Print A (char) to StdOut * Print A (char) to StdOut
* ##In: * ## In:
* A : char to print * A : char to print
* ##Out: * ## Out:
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.PutCA sta K.PutC.Char K.PutCA sta K.PutC.Char
@ -123,20 +123,20 @@ K.PutCA.FIFO ldy #S.NODE.FIFO.S
K.PutC.Char .BS 1 K.PutC.Char .BS 1
K.PutC.Node .BS 1 K.PutC.Node .BS 1
*/-------------------------------------- */--------------------------------------
* #FGetCA * # FGetCA
* Get char from File * Get char from File
* ##In: * ## In:
* A = hFILE * A = hFILE
* ##Out: * ## Out:
* CC = success * CC = success
* A = char * A = char
*\-------------------------------------- *\--------------------------------------
*/-------------------------------------- */--------------------------------------
* #GetC * # GetC
* Get char from StdIn * Get char from StdIn
* ##In: * ## In:
* none. * none.
* ##Out: * ## Out:
* CC = success * CC = success
* A = char * A = char
*\-------------------------------------- *\--------------------------------------
@ -190,40 +190,40 @@ K.GetC.SSOCK lda (pDev) #S.NODE.HANDLER
*-------------------------------------- *--------------------------------------
K.GetC.FIFO K.GetC.FIFO
*/-------------------------------------- */--------------------------------------
* #FPutS * # FPutS
* Write String to FILE * Write String to FILE
* ##In: * ## In:
* PUSHW : CPtr * PUSHW : CPtr
* PUSHB : hFILE * PUSHB : hFILE
* ##Out: * ## Out:
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.FPutS K.FPutS
*/-------------------------------------- */--------------------------------------
* #PutSYA * # PutSYA
* Write String to StdOut * Write String to StdOut
* ##In: * ## In:
* Y,A : CPtr * Y,A : CPtr
* ##Out: * ## Out:
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.PutSYA K.PutSYA
*/-------------------------------------- */--------------------------------------
* #FGetS * # FGetS
* Read String From FILE * Read String From FILE
* ##In: * ## In:
* PUSHW : CPtr * PUSHW : CPtr
* PUSHB : hFILE * PUSHB : hFILE
* ##Out: * ## Out:
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.FGetS K.FGetS
*/-------------------------------------- */--------------------------------------
* #GetSYA * # GetSYA
* Read String From StdIn * Read String From StdIn
* ##In: * ## In:
* Y,A : CPtr * Y,A : CPtr
* ##Out: * ## Out:
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.GetSYA K.GetSYA

View File

@ -4,14 +4,14 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #SScanF * # SScanF
* Scan a PStr (in progress) * Scan a PStr (in progress)
* ##In: * ## In:
* PUSHW PTR to target buffer * PUSHW PTR to target buffer
* PUSHW PSTR pattern (ex: "%d.%d.%d.%d") * PUSHW PSTR pattern (ex: "%d.%d.%d.%d")
* %d : byte * %d : byte
* PUSHW PSTR to scan (ex: "192.168.1.5") * PUSHW PSTR to scan (ex: "192.168.1.5")
* ##Out: * ## Out:
*\-------------------------------------- *\--------------------------------------
K.SScanF jsr PullPtr1Ptr2Ptr3 K.SScanF jsr PullPtr1Ptr2Ptr3
@ -102,9 +102,9 @@ K.SScanF.IsDigit
.1 sec .1 sec
rts rts
*/-------------------------------------- */--------------------------------------
* #PPrintFYA/CPrintFYA * # PPrintFYA/CPrintFYA
* Prints Pascal/C-Style String * Prints Pascal/C-Style String
* ##In: * ## In:
* Y,A = PTR to PStr/CStr * Y,A = PTR to PStr/CStr
* %a : pull 2 bytes to Print Access right String 'drwxrwxrwx' * %a : pull 2 bytes to Print Access right String 'drwxrwxrwx'
* %b : pull 1 byte to Print BIN * %b : pull 1 byte to Print BIN
@ -137,7 +137,7 @@ K.SScanF.IsDigit
* %11s : 'ABCDEFGH ' * %11s : 'ABCDEFGH '
* %011s : 'ABCDEFGH000' * %011s : 'ABCDEFGH000'
* %2f : '3.14' * %2f : '3.14'
* ##Out: * ## Out:
* CC : success * CC : success
* CS : I/O error from COut * CS : I/O error from COut
*\-------------------------------------- *\--------------------------------------

View File

@ -46,7 +46,7 @@ A2osX.PrtDrv.Go.Cmd
*-------------------------------------- *--------------------------------------
A2osX.PrtDrv.GetParam A2osX.PrtDrv.GetParam
>STYA ZPDRV Get Ptr To ParamList >STYA ZPDRV Get Ptr To ParamList
jsr A2osX.Blk.GetDev jsr A2osX.Blk.GetCmdAndDev
ldy #7 ldy #7

View File

@ -4,10 +4,10 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #GetDevByIDA * # GetDevByIDA
* ##IN: * ## IN:
* A = DevID * A = DevID
* ##OUT: * ## OUT:
* CC = OK, CS = ERROR * CC = OK, CS = ERROR
* Y,A = DEVSLOT * Y,A = DEVSLOT
* note: X Unmodified * note: X Unmodified
@ -29,10 +29,10 @@ K.GetDevByIDA cmp DevMgr.Count
adc /DevMgr.Table adc /DevMgr.Table
rts CC rts CC
*/-------------------------------------- */--------------------------------------
* #GetDevByNameYA * # GetDevByNameYA
* ##IN: * ## IN:
* Y,A = Ptr to device name (PStr) * Y,A = Ptr to device name (PStr)
* ##OUT: * ## OUT:
* CC = OK, CS = ERROR * CC = OK, CS = ERROR
* X = DEVID * X = DEVID
* Y,A = DEVSLOT * Y,A = DEVSLOT
@ -81,10 +81,10 @@ K.GetDevByNameYA
K.GetDevDNF lda #MLI.ERR.NODEV CS from cpx/beq K.GetDevDNF lda #MLI.ERR.NODEV CS from cpx/beq
rts rts
*/-------------------------------------- */--------------------------------------
* #GetDevStatusA * # GetDevStatusA
* ##IN: * ## IN:
* A = DevID * A = DevID
* ##OUT: * ## OUT:
* CC = OK, CS = ERROR * CC = OK, CS = ERROR
* Y,A = Ptr to S.DEVINFO * Y,A = Ptr to S.DEVINFO
*\-------------------------------------- *\--------------------------------------
@ -94,11 +94,11 @@ K.GetDevStatusA jsr K.GetDevByIDA
ldx #DEVMGR.STATUS ldx #DEVMGR.STATUS
jmp (ZPPtr1) jmp (ZPPtr1)
*/-------------------------------------- */--------------------------------------
* #MkNodYA * # MkNodYA
* return a hFile for a given Device Name * return a hFile for a given Device Name
* ##IN: * ## IN:
* Y,A=DevName * Y,A=DevName
* ##OUT: * ## OUT:
* CC = OK, CS = ERROR * CC = OK, CS = ERROR
* A = hFILE * A = hFILE
*\-------------------------------------- *\--------------------------------------
@ -148,11 +148,11 @@ K.MkNodYA jsr K.GetDevByNameYA Ptr1=NAME
sec sec
rts rts
*/-------------------------------------- */--------------------------------------
* #MkNodA * # MkNodA
* return a hFile for a given Socket * return a hFile for a given Socket
* ##IN: * ## IN:
* A=hSocket * A=hSocket
* ##OUT: * ## OUT:
* CC = OK, CS = ERROR * CC = OK, CS = ERROR
* A = hFILE * A = hFILE
*\-------------------------------------- *\--------------------------------------
@ -175,10 +175,10 @@ K.MkNodA sta .1+1
txa txa
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #MKFIFO * # MKFIFO
* return a S.FILE to a new FIFO * return a S.FILE to a new FIFO
* ##IN: * ## IN:
* ##OUT: * ## OUT:
* CC = OK, CS = ERROR * CC = OK, CS = ERROR
* A = hFILE * A = hFILE
*\-------------------------------------- *\--------------------------------------

View File

@ -4,10 +4,10 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #OpenDirYA * # OpenDirYA
* ##In: * ## In:
* Y,A = PATH (PSTR) * Y,A = PATH (PSTR)
* ##Out: * ## Out:
* CC : success * CC : success
* A = hDIR * A = hDIR
* CS : error * CS : error
@ -64,10 +64,10 @@ K.OpenDirYA jsr PFT.CheckPathYA
sec sec
.99 rts .99 rts
*/-------------------------------------- */--------------------------------------
* #ReadDirA * # ReadDirA
* ##In: * ## In:
* A = hDIR * A = hDIR
* ##Out: * ## Out:
* CC : success * CC : success
* X = hDIRENT * X = hDIRENT
* Y,A = PTR to S.DIRENT * Y,A = PTR to S.DIRENT
@ -565,10 +565,10 @@ ADDF.DST .DA #S.STAT.P.TYPE,#S.STAT.BLOCKS,#S.STAT.BLOCKS+1
.DA #S.STAT.SIZE,#S.STAT.SIZE+1,#S.STAT.SIZE+2 .DA #S.STAT.SIZE,#S.STAT.SIZE+1,#S.STAT.SIZE+2
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1 .DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
*/------------------------------------- */-------------------------------------
* #CloseDirA * # CloseDirA
* ##In: * ## In:
* A = hDIR * A = hDIR
* ##Out: * ## Out:
* none, always succeed. * none, always succeed.
*\------------------------------------- *\-------------------------------------
K.CloseDirA .EQ K.FCloseA K.CloseDirA .EQ K.FCloseA
@ -594,10 +594,10 @@ K.CloseDirA.1 .EQ K.FCloseA.1
*.2 lda K.ReadDirA.hDir *.2 lda K.ReadDirA.hDir
* jmp K.FreeMemA * jmp K.FreeMemA
*/------------------------------------- */-------------------------------------
* #MKDirYA * # MKDirYA
* ##In: * ## In:
* Y,A = DIR name * Y,A = DIR name
* ##Out: * ## Out:
* CC : success * CC : success
* CS : error * CS : error
* A = EC * A = EC

View File

@ -4,10 +4,10 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #ExpandPStrYA * # ExpandPStrYA
* ##In: * ## In:
* Y,A = PTR to String to Expand (PSTR) * Y,A = PTR to String to Expand (PSTR)
* ##Out: * ## Out:
* X = hMem to Expanded String (PSTR) * X = hMem to Expanded String (PSTR)
* Y,A = PTR to Expanded String * Y,A = PTR to Expanded String
*\-------------------------------------- *\--------------------------------------
@ -173,10 +173,10 @@ K.ExpandPStr.bFound .BS 1
K.ExpandPStr.bNoExp .BS 1 K.ExpandPStr.bNoExp .BS 1
K.ExpandPStr.hPStr .BS 1 K.ExpandPStr.hPStr .BS 1
*/-------------------------------------- */--------------------------------------
* #PutEnvYA * # PutEnvYA
* ##In: * ## In:
* Y,A = PTR to String NAME=VALUE (PSTR) * Y,A = PTR to String NAME=VALUE (PSTR)
* ##Out: * ## Out:
*\-------------------------------------- *\--------------------------------------
K.PutEnvYA >STYA ZPPtr1 NAME=VALUE K.PutEnvYA >STYA ZPPtr1 NAME=VALUE
@ -227,11 +227,11 @@ K.PutEnvYA >STYA ZPPtr1 NAME=VALUE
.9 sec .9 sec
rts rts
*/-------------------------------------- */--------------------------------------
* #SetEnv * # SetEnv
* ##In: * ## In:
* PUSHW = PTR To Value (PSTR) * PUSHW = PTR To Value (PSTR)
* PUSHW = PTR To Name (PSTR) * PUSHW = PTR To Name (PSTR)
* ##Out: * ## Out:
*\-------------------------------------- *\--------------------------------------
K.SetEnv jsr PullPtr1Ptr2 Ptr1=NAME,Ptr2=VALUE K.SetEnv jsr PullPtr1Ptr2 Ptr1=NAME,Ptr2=VALUE
@ -306,10 +306,10 @@ K.SetEnvPtr1Ptr2
sec sec
rts rts
*/-------------------------------------- */--------------------------------------
* #GetEnvYA * # GetEnvYA
* ##In: * ## In:
* Y,A = PTR to NAME (PSTR) * Y,A = PTR to NAME (PSTR)
* ##Out: * ## Out:
* CC : Y,A = PTR to VALUE (PSTR) * CC : Y,A = PTR to VALUE (PSTR)
* CS : not found * CS : not found
*\-------------------------------------- *\--------------------------------------
@ -327,10 +327,10 @@ K.GetEnvYA >STYA ZPPtr1
.9 >LDYAI EmptyPSTR .9 >LDYAI EmptyPSTR
rts rts
*/-------------------------------------- */--------------------------------------
* #UnsetEnvYA * # UnsetEnvYA
* ##In: * ## In:
* Y,A = PTR To Name (PSTR) * Y,A = PTR To Name (PSTR)
* ##Out: * ## Out:
*\-------------------------------------- *\--------------------------------------
K.UnsetEnvYA >STYA ZPPtr1 Store VAR Name K.UnsetEnvYA >STYA ZPPtr1 Store VAR Name
S.UnsetEnvPtr1 jsr ENV.FindVarPtr1 S.UnsetEnvPtr1 jsr ENV.FindVarPtr1

View File

@ -8,9 +8,9 @@ AUTO 6
* Must be kept in X before calling * Must be kept in X before calling
* PFT.Check * PFT.Check
*/-------------------------------------- */--------------------------------------
* #FOpen * # FOpen
* Open a file * Open a file
* ##In : * ## In :
* PUSHW = AUXTYPE * PUSHW = AUXTYPE
* PUSHB = TYPE * PUSHB = TYPE
* PUSHB = MODE * PUSHB = MODE
@ -20,7 +20,7 @@ AUTO 6
* SYS.FOpen.T : Open/Append in Text mode * SYS.FOpen.T : Open/Append in Text mode
* SYS.FOpen.X : Create if not exists * SYS.FOpen.X : Create if not exists
* PUSHW = PATH (PSTR) * PUSHW = PATH (PSTR)
* ##Out : * ## Out :
* CC : A = hFILE * CC : A = hFILE
* CS : A = EC * CS : A = EC
*\-------------------------------------- *\--------------------------------------
@ -124,11 +124,11 @@ K.FOpen.TYPE .BS 1
K.FOpen.AUXTYPE .BS 2 K.FOpen.AUXTYPE .BS 2
hFILE .BS 1 hFILE .BS 1
*/-------------------------------------- */--------------------------------------
* #FCloseA * # FCloseA
* Close a file * Close a file
* ##In : * ## In :
* A = hFILE * A = hFILE
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
K.FCloseA jsr PFT.CheckNodeA K.FCloseA jsr PFT.CheckNodeA
sta K.FCloseA.2+1 sta K.FCloseA.2+1
@ -149,22 +149,22 @@ K.FCloseA.1 ldy #S.NODE.REG.REF
K.FCloseA.2 lda #$ff Self Modified K.FCloseA.2 lda #$ff Self Modified
jmp K.FreeMemA jmp K.FreeMemA
*/-------------------------------------- */--------------------------------------
* #FReadA * # FReadA
* Read ONE byte from file * Read ONE byte from file
* ##In : * ## In :
* A = hFILE * A = hFILE
* ##Out : * ## Out :
* A = Byte Read * A = Byte Read
*\-------------------------------------- *\--------------------------------------
K.FReadA jsr PFT.CheckNodeA K.FReadA jsr PFT.CheckNodeA
ldx #MLIREAD ldx #MLIREAD
bra K.FReadWrite.0 bra K.FReadWrite.0
*/-------------------------------------- */--------------------------------------
* #FWriteAY * # FWriteAY
* ##In: * ## In:
* A = hFILE * A = hFILE
* Y = char * Y = char
* #Out: * # Out:
* Y,A = Bytes Written * Y,A = Bytes Written
*\-------------------------------------- *\--------------------------------------
K.FWriteAY jsr PFT.CheckNodeA K.FWriteAY jsr PFT.CheckNodeA
@ -183,25 +183,25 @@ K.FReadWrite.0 jsr FILE.SetupPrt1A
.9 rts .9 rts
K.FWriteAY.Buf .BS 1 K.FWriteAY.Buf .BS 1
*/-------------------------------------- */--------------------------------------
* #FRead * # FRead
* Read bytes from file * Read bytes from file
* ##In : * ## In :
* PUSHW = Dest Ptr * PUSHW = Dest Ptr
* PUSHW = Bytes To Read * PUSHW = Bytes To Read
* PUSHB = hFILE * PUSHB = hFILE
* ##Out : * ## Out :
* Y,A = Bytes Read * Y,A = Bytes Read
*\-------------------------------------- *\--------------------------------------
K.FRead jsr PFT.CheckNodeSTK K.FRead jsr PFT.CheckNodeSTK
ldx #MLIREAD ldx #MLIREAD
bra K.FReadWrite.1 bra K.FReadWrite.1
*/-------------------------------------- */--------------------------------------
* #FWrite * # FWrite
* ##In: * ## In:
* PUSHW = Src Ptr * PUSHW = Src Ptr
* PUSHW = Bytes To Write * PUSHW = Bytes To Write
* PUSHB = hFILE * PUSHB = hFILE
* #Out: * # Out:
* Y,A = Bytes Written * Y,A = Bytes Written
*\-------------------------------------- *\--------------------------------------
K.FWrite jsr PFT.CheckNodeSTK K.FWrite jsr PFT.CheckNodeSTK
@ -217,8 +217,8 @@ K.FReadWrite.1 >PULLA
>LDYA K.MLI.PARAMS+6 >LDYA K.MLI.PARAMS+6
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #FFlushA * # FFlushA
* ##In: * ## In:
* A = hFILE * A = hFILE
*\-------------------------------------- *\--------------------------------------
K.FFlushA jsr PFT.CheckNodeA K.FFlushA jsr PFT.CheckNodeA
@ -226,8 +226,8 @@ K.FFlushA jsr PFT.CheckNodeA
>MLICALL MLIFLUSH >MLICALL MLIFLUSH
rts rts
*/------------------------------------- */-------------------------------------
* #FSeek * # FSeek
* ##In: * ## In:
* PUSHW = OffsetHi * PUSHW = OffsetHi
* PUSHW = OffsetLo * PUSHW = OffsetLo
* PUSHB = From * PUSHB = From
@ -285,10 +285,10 @@ K.FSeek jsr PFT.CheckNodeSTK
K.FSeek.FROM .BS 1 K.FSeek.FROM .BS 1
K.FSeek.OFFSET .BS 4 K.FSeek.OFFSET .BS 4
*/-------------------------------------- */--------------------------------------
* #FTellA * # FTellA
* ##In: * ## In:
* A = hFILE * A = hFILE
* ##Out: * ## Out:
* Y,A,X = Offset * Y,A,X = Offset
*\-------------------------------------- *\--------------------------------------
K.FTellA jsr PFT.CheckNodeA K.FTellA jsr PFT.CheckNodeA
@ -299,10 +299,10 @@ K.FTellA.1 jsr FILE.SetupPrt1A
ldx K.MLI.PARAMS+4 ldx K.MLI.PARAMS+4
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #FEOFA * # FEOFA
* ##In: * ## In:
* A = hFILE * A = hFILE
* ##Out: * ## Out:
* CC : * CC :
* A=0 EOF * A=0 EOF
* A !=0 NOT EOF * A !=0 NOT EOF
@ -331,19 +331,19 @@ K.FEOFA jsr PFT.CheckNodeA
.9 rts .9 rts
K.FEOFA.MARK .BS 3 K.FEOFA.MARK .BS 3
*/-------------------------------------- */--------------------------------------
* #RemoveYA * # RemoveYA
*\-------------------------------------- *\--------------------------------------
K.RemoveYA jsr PFT.CheckPathYA K.RemoveYA jsr PFT.CheckPathYA
>STYA K.MLI.PARAMS+1 >STYA K.MLI.PARAMS+1
>MLICALL MLIDESTROY >MLICALL MLIDESTROY
rts rts
*/-------------------------------------- */--------------------------------------
* #Rename * # Rename
* Rename a file * Rename a file
* ##In : * ## In :
* PUSHW = New Name * PUSHW = New Name
* PUSHW = Old Name * PUSHW = Old Name
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
K.Rename jsr PFT.CheckPathSTK K.Rename jsr PFT.CheckPathSTK
>PULLW K.MLI.PARAMS+1 >PULLW K.MLI.PARAMS+1
@ -351,12 +351,12 @@ K.Rename jsr PFT.CheckPathSTK
>MLICALL MLIRename >MLICALL MLIRename
rts rts
*/-------------------------------------- */--------------------------------------
* #Stat * # Stat
* Return information about a file * Return information about a file
* ##In : * ## In :
* PUSHW = PTR to S.STAT buffer * PUSHW = PTR to S.STAT buffer
* PUSHW = PTR to Filename (PSTR) * PUSHW = PTR to Filename (PSTR)
* ##Out : * ## Out :
*\-------------------------------------- *\--------------------------------------
K.Stat jsr PFT.CheckPathSTK K.Stat jsr PFT.CheckPathSTK
>PULLW K.MLI.PARAMS+1 >PULLW K.MLI.PARAMS+1

View File

@ -4,13 +4,13 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #FileSearch * # FileSearch
* Search a file in the provided PATH list * Search a file in the provided PATH list
* And return, if found, the full path to it. * And return, if found, the full path to it.
* ##In: * ## In:
* PUSHW = Ptr to Search Path (PSTR) %LIB%;/SYS/SLIB * PUSHW = Ptr to Search Path (PSTR) %LIB%;/SYS/SLIB
* PUSHW = Ptr to File Name (PSTR) * PUSHW = Ptr to File Name (PSTR)
* ##Out: * ## Out:
* CC : success * CC : success
* Y,A = PSTR to FilePath (PSTR) * Y,A = PSTR to FilePath (PSTR)
* X = hMem to FilePath * X = hMem to FilePath
@ -78,10 +78,10 @@ K.FileSearch >PULLW ZPPtr4 ZPPtr1 trashed by ExpandPStrYA
K.FileSearch.hSrch .BS 1 K.FileSearch.hSrch .BS 1
K.FileSearch.Index .BS 1 K.FileSearch.Index .BS 1
*/-------------------------------------- */--------------------------------------
* #GetFullPathYA * # GetFullPathYA
* ##In : * ## In :
* Y,A = Filename (PSTR) * Y,A = Filename (PSTR)
* ##Out : * ## Out :
* CC : success * CC : success
* Y,A = FullPath (PSTR) * Y,A = FullPath (PSTR)
* X = hMem of FullPath * X = hMem of FullPath
@ -117,13 +117,13 @@ K.GetFullPathYA.9
sec sec
rts rts
*/-------------------------------------- */--------------------------------------
* #LoadFile * # LoadFile
* ##In: * ## In:
* PUSHW = AUXTYPE (Handled by.... * PUSHW = AUXTYPE (Handled by....
* PUSHB = TYPE ... * PUSHB = TYPE ...
* PUSHB = MODE ... * PUSHB = MODE ...
* PUSHW = PATH ...FOpen) * PUSHW = PATH ...FOpen)
* ##Out: * ## Out:
* Y,A = File Length * Y,A = File Length
* X = hMem of Loaded File * X = hMem of Loaded File
*\-------------------------------------- *\--------------------------------------
@ -190,8 +190,8 @@ K.LoadFile.Seek >PUSHWI 0
>PUSHB K.LoadFile.hFile >PUSHB K.LoadFile.hFile
jmp K.FSeek jmp K.FSeek
*/-------------------------------------- */--------------------------------------
* #SaveFile * # SaveFile
* ##In: * ## In:
* PUSHW = SrcLen * PUSHW = SrcLen
* PUSHW = SrcPtr * PUSHW = SrcPtr
* PUSHW = AUXTYPE (Handled by.... * PUSHW = AUXTYPE (Handled by....

View File

@ -89,10 +89,10 @@ A2osX.MLICALL1 stx .1
jsr GO.A2osX jsr GO.A2osX
rts rts
*-------------------------------------- *--------------------------------------
* A2osX.DIIDrv,A2osX.BlkDrv * A2osX.DIIDrv
* X = DEVMGR.cmd * X = DEVMGR.cmd
* Y,A = PTR to Params * Y,A = PTR to Params
* pDev -> Dev Header * pDev -> Dev Header AUX!!!
* $42 Command Number * $42 Command Number
* $43 Unit Number * $43 Unit Number
* $44-$45 Buffer Pointer * $44-$45 Buffer Pointer
@ -102,21 +102,25 @@ A2osX.DIIDrv .DA A2osX.DIIDrv.S status
.DA A2osX.DIIDrv.RW Read .DA A2osX.DIIDrv.RW Read
.DA A2osX.DIIDrv.RW Write .DA A2osX.DIIDrv.RW Write
.DA A2osX.DRV.BadCall Format .DA A2osX.DRV.BadCall Format
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
*-------------------------------------- *--------------------------------------
A2osX.DIIDrv.S >LDYAI A2osx.DIIStat A2osX.DIIDrv.S >LDYAI A2osx.DIIStat
clc clc
rts rts
*-------------------------------------- *--------------------------------------
A2osX.DIIDrv.RW jsr A2osX.Blk.GetParam A2osX.DIIDrv.RW >STYA A2osX.Blk.GetParam.1+1
jsr A2osX.Blk.GetCmdAndDevAX
jsr GO.ProDOS jsr GO.ProDOS
stx $42
sta $43
jsr A2osX.Blk.GetParam
jsr $D000 jsr $D000
jsr GO.A2osX jsr GO.A2osX
rts rts
@ -130,35 +134,47 @@ A2osx.DIIStat .DA #S.DEVSTAT.S.BLOCK+S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
.DA #0 .DA #0
.DA #0,#9 .DA #0,#9
*-------------------------------------- *--------------------------------------
* Generic Blk Device * A2osX.BlkDrv
* X = DEVMGR.cmd
* Y,A = PTR to Params
* pDev -> Dev Header
* $42 Command Number
* $43 Unit Number
* $44-$45 Buffer Pointer
* $46-$47 Block Number
*-------------------------------------- *--------------------------------------
A2osX.BlkDrv .DA A2osX.BlkDrv.S status A2osX.BlkDrv .DA A2osX.BlkDrv.S status
.DA A2osX.BlkDrv.RW .DA A2osX.BlkDrv.RW
.DA A2osX.BlkDrv.RW .DA A2osX.BlkDrv.RW
.DA A2osX.BlkDrv.F .DA A2osX.BlkDrv.F
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
.DA A2osX.DRV.BadCall * .DA A2osX.DRV.BadCall
*-------------------------------------- *--------------------------------------
A2osX.BlkDrv.S jsr A2osX.Blk.GetDev A2osX.BlkDrv.S jsr A2osX.Blk.GetCmdAndDev
jsr A2osX.BlkDrv.Go jsr A2osX.BlkDrv.Go
bcs * bcs .9
stx A2osx.BlkStat+S.DEVSTAT.SIZE stx A2osx.BlkStat+S.DEVSTAT.SIZE
sty A2osx.BlkStat+S.DEVSTAT.SIZE+1 sty A2osx.BlkStat+S.DEVSTAT.SIZE+1
>LDYAI A2osX.BlkStat >LDYAI A2osX.BlkStat
clc clc
rts .9 rts
*-------------------------------------- *--------------------------------------
A2osX.BlkDrv.RW jsr A2osX.Blk.GetParam A2osX.BlkDrv.RW >STYA A2osX.Blk.GetParam.1+1
jsr A2osX.Blk.GetCmdAndDev
jsr A2osX.Blk.GetParam
bra A2osX.BlkDrv.Go bra A2osX.BlkDrv.Go
*-------------------------------------- *--------------------------------------
A2osX.BlkDrv.F jsr A2osX.Blk.GetDev A2osX.BlkDrv.F jsr A2osX.Blk.GetCmdAndDev
A2osX.BlkDrv.Go ldy #S.DEV.ROM.JMP A2osX.BlkDrv.Go ldy #S.DEV.ROM.JMP
lda (pDev),y lda (pDev),y
sta .8+1 sta .8+1
@ -175,21 +191,23 @@ A2osX.BlkStat .DA #S.DEVSTAT.S.BLOCK+S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
.DA #0,#9 .DA #0,#9
*-------------------------------------- *--------------------------------------
A2osX.Blk.GetParam A2osX.Blk.GetParam
>STYA ZPDRV Get Ptr To ParamList
jsr A2osX.Blk.GetDev
ldy #3 ldy #3
A2osX.Blk.GetParam.1
.1 lda (ZPDRV),y lda $ffff,y Self Modified
sta $44,y sta $44,y
dey dey
bpl .1 bpl A2osX.Blk.GetParam.1
rts rts
*-------------------------------------- *--------------------------------------
A2osX.Blk.GetDev A2osX.Blk.GetCmdAndDev
jsr A2osX.Blk.GetCmdAndDevAX
stx $42
sta $43
rts
A2osX.Blk.GetCmdAndDevAX
txa txa
asl lsr
sta $42 CMD tax CMD
ldy #S.DEV.DEVID Drive 1, or 2 ldy #S.DEV.DEVID Drive 1, or 2
lda (pDev),y lda (pDev),y
@ -205,8 +223,7 @@ A2osX.Blk.GetDev
asl asl
asl asl
plp plp
ror ror DSSS0000
sta $43 DSSS0000
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -22,13 +22,13 @@ MemMgr.ReqFlags .EQ ZPMEMMGR+10 store requested Flags
*-------------------------------------- *--------------------------------------
* PUBLIC * PUBLIC
*/-------------------------------------- */--------------------------------------
* #GetMem * # GetMem
* ##In: * ## In:
* PUSHW = Size Requested * PUSHW = Size Requested
* PUSHB = Options * PUSHB = Options
* S.MEM.F.INIT0 : init memory with 00 * S.MEM.F.INIT0 : init memory with 00
* S.MEM.F.ALIGN : page aligned * S.MEM.F.ALIGN : page aligned
* ##Out: * ## Out:
* CC : success * CC : success
* YA = PTR to Mem * YA = PTR to Mem
* X = hMem * X = hMem
@ -238,10 +238,10 @@ MemMgr.Init0 ldy #S.MEM.PTR
.8 rts .8 rts
*/-------------------------------------- */--------------------------------------
* #FreeMemA * # FreeMemA
* ##In: * ## In:
* A = hMem To Free * A = hMem To Free
* ##Out: * ## Out:
* none. * none.
* (X,Y unmodified) * (X,Y unmodified)
*\-------------------------------------- *\--------------------------------------
@ -327,10 +327,10 @@ K.FreeMemA phy
*-------------------------------------- *--------------------------------------
K.FreeMemA.ERR >CSTR "***MemMgr:Attempt to Free an already freed hMem at $%H" K.FreeMemA.ERR >CSTR "***MemMgr:Attempt to Free an already freed hMem at $%H"
*/-------------------------------------- */--------------------------------------
* #GetMemPtrA * # GetMemPtrA
* ##In: * ## In:
* A = hMem * A = hMem
* ##Out: * ## Out:
* Y,A = PTR to MemBlock * Y,A = PTR to MemBlock
* (X unmodified) * (X unmodified)
*\-------------------------------------- *\--------------------------------------
@ -343,10 +343,10 @@ K.GetMemPtrA jsr K.GetMemByIDA
ply ply
rts rts
*/-------------------------------------- */--------------------------------------
* #GetMemByIDA * # GetMemByIDA
* ##In: * ## In:
* A = hMem * A = hMem
* ##Out: * ## Out:
* Y,A = ZPMemMgrSPtr = PTR to S.MEM * Y,A = ZPMemMgrSPtr = PTR to S.MEM
* X unmodified * X unmodified
*\-------------------------------------- *\--------------------------------------
@ -403,10 +403,10 @@ K.SetLoMem
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #GetMemStatYA * # GetMemStatYA
* ##In: * ## In:
* Y,A = 24 bytes buffer * Y,A = 24 bytes buffer
* ##Out: * ## Out:
* Buffer filled with memory stats * Buffer filled with memory stats
*\-------------------------------------- *\--------------------------------------
K.GetMemStatYA >STYA ZPMemMgrDstPtr K.GetMemStatYA >STYA ZPMemMgrDstPtr

View File

@ -4,13 +4,13 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #ExecProcessNewEnvYA * # ExecProcessNewEnvYA
* #ExecProcessYA (Blocking Parent PID) * # ExecProcessYA (Blocking Parent PID)
* #CreateProcessNewEnvYA * # CreateProcessNewEnvYA
* #CreateProcessYA (Non Blocking) * # CreateProcessYA (Non Blocking)
* ##In: * ## In:
* Y,A = PTR To Cmd Line * Y,A = PTR To Cmd Line
* ##Out: * ## Out:
* A = Child PSID * A = Child PSID
*\-------------------------------------- *\--------------------------------------
K.ExecProcessNewEnvYA K.ExecProcessNewEnvYA
@ -47,10 +47,10 @@ K.CreateProcessYA
K.CreateProcess.Flags .BS 1 K.CreateProcess.Flags .BS 1
K.CreateProcess.CmdLine .BS 2 K.CreateProcess.CmdLine .BS 2
*/-------------------------------------- */--------------------------------------
* #GetPSByIDA * # GetPSByIDA
* ##In : * ## In :
* A = PID * A = PID
* ##Out : * ## Out :
* Y,A = PTR to TSKSLOT * Y,A = PTR to TSKSLOT
*\-------------------------------------- *\--------------------------------------
K.GetPSByIDA pha K.GetPSByIDA pha
@ -89,11 +89,11 @@ K.GetPSByIDA pha
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #Sleep * # Sleep
* Make current process suspend until next RUN * Make current process suspend until next RUN
* ##In : * ## In :
* (none) * (none)
* ##Out : * ## Out :
* (none) * (none)
*\-------------------------------------- *\--------------------------------------
K.Sleep pla get PC LO K.Sleep pla get PC LO

View File

@ -4,11 +4,11 @@ LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
*/-------------------------------------- */--------------------------------------
* #NewPStrYA * # NewPStrYA
* Create a new copy of PSTR * Create a new copy of PSTR
* ##In: * ## In:
* Y,A = PTR to buffer * Y,A = PTR to buffer
* ##Out: * ## Out:
* CC : success * CC : success
* Y,A = PTR to String * Y,A = PTR to String
* X = hMem (PSTR) * X = hMem (PSTR)
@ -34,12 +34,12 @@ K.NewPStrYA >STYA ZPPtr2
clc clc
.9 rts .9 rts
*/-------------------------------------- */--------------------------------------
* #PStrCpy * # PStrCpy
* Copy string * Copy string
* ##In: * ## In:
* PUSHW = Ptr to SRC (PSTR) * PUSHW = Ptr to SRC (PSTR)
* PUSHW = Ptr to DST (PSTR) * PUSHW = Ptr to DST (PSTR)
* ##Out: * ## Out:
* DST = SRC (PSTR) * DST = SRC (PSTR)
*\-------------------------------------- *\--------------------------------------
K.PStrCpy jsr PullPtr1Ptr2 K.PStrCpy jsr PullPtr1Ptr2
@ -58,12 +58,12 @@ K.PStrCpyPtr2Ptr1
.2 clc .2 clc
rts rts
*/-------------------------------------- */--------------------------------------
* #PStrCat * # PStrCat
* Append SRC to DST * Append SRC to DST
* ##In: * ## In:
* PUSHW = Ptr to SRC (PSTR) * PUSHW = Ptr to SRC (PSTR)
* PUSHW = Ptr to DST (PSTR) * PUSHW = Ptr to DST (PSTR)
* ##Out: * ## Out:
* DST = DST+SRC (PSTR) * DST = DST+SRC (PSTR)
*\-------------------------------------- *\--------------------------------------
K.PStrCat jsr PullPtr1Ptr2 K.PStrCat jsr PullPtr1Ptr2
@ -93,12 +93,12 @@ K.PStrCat jsr PullPtr1Ptr2
clc clc
rts rts
*/-------------------------------------- */--------------------------------------
* #PStrMatch * # PStrMatch
* Compare a String against pattern * Compare a String against pattern
* ##In: * ## In:
* PUSHW = PTR to Pattern (e.g. '*test?.txt') * PUSHW = PTR to Pattern (e.g. '*test?.txt')
* PUSHW = PTR to Src String * PUSHW = PTR to Src String
* ##Out: * ## Out:
* CC : match * CC : match
* CS : no match * CS : no match
*\-------------------------------------- *\--------------------------------------
@ -167,11 +167,11 @@ K.PStrMatch jsr PullPtr1Ptr2
.9 sec .9 sec
rts rts
*/-------------------------------------- */--------------------------------------
* #PStrUprYA/PStrLwrYA * # PStrUprYA/PStrLwrYA
* Convert string to UPPERCASE/lowercase * Convert string to UPPERCASE/lowercase
* ##In: * ## In:
* Y,A = PTR to String (PSTR) * Y,A = PTR to String (PSTR)
* ##Out: * ## Out:
* Uppercased/lowercased String in Buffer * Uppercased/lowercased String in Buffer
*\-------------------------------------- *\--------------------------------------
K.PStrUprYA ldx #0 K.PStrUprYA ldx #0
@ -202,9 +202,9 @@ K.PStrLwrYA ldx #2
*-------------------------------------- *--------------------------------------
K.PStrUprLwr .AS "azAZ" K.PStrUprLwr .AS "azAZ"
*/-------------------------------------- */--------------------------------------
* #PStrFTime * # PStrFTime
* Convert S.TIME struct to PSTR * Convert S.TIME struct to PSTR
* ##In: * ## In:
* PUSHW = Dst PTR To PSTR Buf * PUSHW = Dst PTR To PSTR Buf
* PUSHW = Src PTR To Format String * PUSHW = Src PTR To Format String
* %a : Abbreviated weekday name : Thu * %a : Abbreviated weekday name : Thu
@ -222,7 +222,7 @@ K.PStrUprLwr .AS "azAZ"
* %y : Year, last two digits (00-99) * %y : Year, last two digits (00-99)
* %Y : Year four digits 2001 * %Y : Year four digits 2001
* PUSHW = Src PTR To S.Time * PUSHW = Src PTR To S.Time
* ##Out: * ## Out:
* none. always succeed. * none. always succeed.
*\-------------------------------------- *\--------------------------------------
K.PStrFTime jsr PullPtr1Ptr2Ptr3 K.PStrFTime jsr PullPtr1Ptr2Ptr3
@ -452,11 +452,11 @@ K.PStrFTime.MON >PSTR "January"
K.PStrFTime.BIN .BS 1 K.PStrFTime.BIN .BS 1
K.PStrFTime.DEC .BS 1 always < 100 K.PStrFTime.DEC .BS 1 always < 100
*/-------------------------------------- */--------------------------------------
* #PStr2StrArrayYA * # PStr2StrArrayYA
* Convert a PSTR (e.g. : command Line) to a Array of PSTRs (Args[]) * Convert a PSTR (e.g. : command Line) to a Array of PSTRs (Args[])
* ##In: * ## In:
* Y,A = PTR to String * Y,A = PTR to String
* ##Out: * ## Out:
* CC : success * CC : success
* Y,A = PTR to StrArray * Y,A = PTR to StrArray
* X = hMem * X = hMem

View File

@ -98,21 +98,17 @@ A2osX.E0 .EQ *
A2osX.E0.SIZE .EQ *-A2osX.E0 A2osX.E0.SIZE .EQ *-A2osX.E0
* CONTROL SECTION : * CONTROL SECTION :
.DO A2osX.GP.SIZE>$1E0
.LIST ON .LIST ON
.DO A2osX.GP.SIZE>$1E0
* !!!!!!!!! ERROR:GP too big !!!!!!!!!! * !!!!!!!!! ERROR:GP too big !!!!!!!!!!
.LIST OFF
.FIN .FIN
.DO A2osX.D1.SIZE>$1000 .DO A2osX.D1.SIZE>$1000
.LIST ON
* !!!!!!!!! ERROR:BNK1 too big !!!!!!!! * !!!!!!!!! ERROR:BNK1 too big !!!!!!!!
.LIST OFF
.FIN .FIN
.DO A2osX.D2.SIZE>$1000 .DO A2osX.D2.SIZE>$1000
.LIST ON
* !!!!!!!!! ERROR:BNK2 too big !!!!!!!! * !!!!!!!!! ERROR:BNK2 too big !!!!!!!!
.LIST OFF
.FIN .FIN
.LIST OFF
MAN MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S SAVE /A2OSX.SRC/SYS/KERNEL.S
ASM ASM

View File

@ -8,7 +8,7 @@
## Out : ## Out :
+ X=BlockCount (max 22) + X=BlockCount (max 22)
+ A=PageCount (max 44) + Y,A=BufSize (max $4400)
# BuildProDOSCat # BuildProDOSCat