BugFix: IPCONFIG, STAT, EDIT, CIFS

This commit is contained in:
burniouf 2021-06-30 21:09:07 +02:00
parent a8f84a6e88
commit 45d654382a
13 changed files with 477 additions and 286 deletions

Binary file not shown.

View File

@ -39,28 +39,42 @@ A2osX.QC.Start1 sei
lda #$8C Reset 80 col screen ($0C=FF=HOME)
jsr $C300
ldx $280
ldx $280 some /PATH/.SYSTEM file passed ?
beq A2osX.QC.Start2
.2 dex
.2 dex
lda $280,x
cmp #'/'
bne .2
stx A2osX.QC.BOOT
stx A2osX.QC.BOOT get /PATH/ in QC.BOOT...
.3 lda $280,x
sta A2osX.QC.BOOT,x
dex
bne .3
jsr A2osX.QC.SetPFX
jsr A2osX.QC.SetPFX cd to QC.BOOT...
bcs A2osX.QC.Start2
jsr A2osX.QC.Load
bcs A2osX.QC.Start2
jmp $2000
lda $2000
cmp #$4C
bne .8
lda #$EE
cmp $2003
bne .8
cmp $2004
bne .8
.8 jmp $2000
A2osX.QC.Start2 sec
>LDYAI MSG.INIT1

View File

@ -11,41 +11,41 @@ BUF.InsertA sta TmpByte
>LDYAI 1
jsr BUF.BufPtrSetup
bcs .9
jsr BUF.MoveForwardTail
.2 lda TmpByte
sta (BufPtr)
jmp SCRN.UnSaved
.8 clc
.8 clc
.9 rts
*--------------------------------------
BUF.InsertTAB >LDA.G FileX
and #3 0-3
eor #$3 3-0
inc
sta TmpByte
jsr BUF.ComputeCOffset
tya
sec
adc TmpByte
bcs .8
ldy TmpByte
lda #0
jsr BUF.BufPtrSetup
bcs .9
jsr BUF.MoveForwardTail
lda #C.SPACE
ldy TmpByte
dey
.2 sta (BufPtr),y
dey
@ -54,24 +54,24 @@ BUF.InsertTAB >LDA.G FileX
jmp SCRN.UnSaved
.8 stz TmpByte
clc
.9 rts
clc
.9 rts
*--------------------------------------
BUF.DelCharAtCursor
lda BUF.COffset
clc
>ADC.G BufBase
sta BufPtrDst
lda BUF.COffset+1
>ADC.G BufBase+1
sta BufPtrDst+1
>LDYA BufPtrDst
iny
bne .1
inc
.1 >STYA BufPtr
lda (BufPtrDst)
@ -82,7 +82,7 @@ BUF.DelCharAtCursor
lda FileLen
bne .5
dec FileLen+1
.5 dec FileLen
.5 dec FileLen
jsr BUF.ResetSel
pla Get back deleted char
@ -99,45 +99,46 @@ BUF.InsertClipboard
jsr BUF.ComputeCOffset
>LDYA.G ClipBoardLen
>LDYA.G ClipBoardLen
jsr BUF.BufPtrSetup
bcs .9
jsr BUF.MoveForwardTail
>LDA.G ClipBoardLen
eor #$ff
tax
iny
lda (pData),y ClipBoardLen+1
eor #$ff
pha
ldy #0
.1 inx
bne .2
pla
inc
beq .3
pha
.2 lda (ClipboardPtr),y
sta (BufPtr),y
iny
bne .1
inc ClipboardPtr+1
inc BufPtr+1
bra .1
.3 jsr BUF.ResetSel
jsr SCRN.UpdateStatusBar
jmp SCRN.UnSaved
.8 clc
.8 clc
.9 rts
*--------------------------------------
BUF.DelSel jsr BUF.GetSelLen
@ -244,7 +245,7 @@ BUF.CopyClipboard
lda (pData),y
eor #$ff
pha
ldy #0
.1 inx
@ -277,6 +278,7 @@ BUF.CopyAddY tya
adc BufPtr
sta BufPtr
bcc .2
inc BufPtr+1
.2 rts
*--------------------------------------
@ -285,7 +287,7 @@ BUF.MoveBackTail
lda BufPtr+1
pha
.1 lda (BufPtr),y
sta (BufPtrDst),y
beq .8
@ -299,50 +301,50 @@ BUF.MoveBackTail
.8 pla
sta BufPtr+1
rts
*--------------------------------------
BUF.MoveForwardTail
BUF.MoveForwardTail
ldy #0
ldx #0
.1 lda (BufPtr),y
.1 lda (BufPtr),y
beq .2
iny
bne .1
inx
inc BufPtr+1
inc BufPtrDst+1
bra .1
.2 txa
eor #$ff
pha
tya
eor #$ff
tax will move tail len+1
.3 lda (BufPtr),y
sta (BufPtrDst),y
inx
bne .4
pla
inc
beq .8
pha
.4 tya
bne .5
dec BufPtr+1
dec BufPtrDst+1
.5 dey
bra .3
@ -389,7 +391,7 @@ BUF.GetLineAX sta BUF.TmpLine1 Requested Line
stz BUF.TmpLine2
stz BUF.TmpLine2+1
stz BUF.LOffset
stz BUF.LOffset+1
@ -403,6 +405,7 @@ BUF.GetLineAX sta BUF.TmpLine1 Requested Line
cmp #C.CR
beq .3
iny
bne .2
@ -419,6 +422,7 @@ BUF.GetLineAX sta BUF.TmpLine1 Requested Line
adc BufPtr
sta BufPtr
bcc .5
inc BufPtr+1
.5 tya
@ -426,10 +430,12 @@ BUF.GetLineAX sta BUF.TmpLine1 Requested Line
adc BUF.LOffset
sta BUF.LOffset
bcc .6
inc BUF.LOffset+1
.6 inc BUF.TmpLine2
bne .1
inc BUF.TmpLine2+1
bra .1
@ -477,7 +483,7 @@ BUF.CheckSelected
iny
lda (pData),y
sbc BUF.COffset+1
* CC:SelEnd < COffset
* CC:SelEnd < COffset
.9 lda #0
ror $80 = selected
rts
@ -487,7 +493,7 @@ BUF.GetSelLen ldy #SelEnd
sec
ldy #SelStart
sbc (pData),y
sta SelLen
tax
ldy #SelEnd+1
@ -508,33 +514,33 @@ BUF.GetSelLen ldy #SelEnd
.9 sec
rts
*--------------------------------------
* in : Y,A = cnt to insert at COffset
* in : Y,A = cnt to insert at COffset
*--------------------------------------
BUF.BufPtrSetup >STYA TmpLen
tya
clc
adc FileLen
sta FileLen
tay
lda TmpLen+1
adc FileLen+1
sta FileLen+1
cpy BufLen
sbc BufLen+1
bcc .8
jsr BUF.BufPtr.Realloc
bcs .9
jsr BUF.ComputeCOffset
.8 lda BUF.COffset
clc
>ADC.G BufBase
@ -552,7 +558,7 @@ BUF.BufPtrSetup >STYA TmpLen
lda BufPtr+1
adc TmpLen+1
sta BufPtrDst+1
clc
.9 rts
*--------------------------------------
@ -565,7 +571,7 @@ BUF.BufPtr.Realloc
sta BufLen+1
>PUSHA
>PUSHBI 0
>SYSCALL Realloc
bcs .9

View File

@ -89,62 +89,57 @@ FILE.Load.TXT stz FileLen
ldx #S.FI.T.TXT
jsr FILE.OpenTypeX
bcs .99
bcs .9
>PUSHA
>PUSHEA.G STATBUF
>SYSCALL FStat
bcs .99
bcs .9
jsr FILE.GetBuffer
.99 bcs .9
bcs .9
.1 ldy #254
jsr FILE.ReadY
.1 ldy #0
jsr FILE.ReadY read 256
bcs .7
lda #0
sta (ZPPTR1),y Y = line len
ldx #0
sty TmpCount Count read
ldy #0
lda (ZPPTR1)
beq .8
.2 lda (ZPPTR1),y
eor #C.LF
bne .2
cmp #C.LF
bne .3
phy
lda #2
>STA.G FileType
ply
iny
.2 lda (ZPPTR1),y
beq .4
bra .5
sta (BufPtr)
.3 sta (BufPtr)
inc BufPtr
bne .3
bne .4
inc BufPtr+1
.3 inx
iny
bra .2
.4 txa
clc
adc FileLen
sta FileLen
bcc .1
.4 cmp #C.CR
beq .5
inc FileLen
bne .5
inc FileLen+1
bra .1
.5 dec TmpCount
beq .1
iny
bra .2
.7 cmp #MLI.E.EOF
bne .9
@ -153,7 +148,8 @@ FILE.Load.TXT stz FileLen
sta (BufPtr)
clc
.HS B0 BCS
rts
.9 sec
rts
*--------------------------------------
@ -194,7 +190,8 @@ FILE.Load.ASM stz FileLen
sta (BufPtr)
clc
.HS B0 BCS
rts
.9 sec
.99 rts
*--------------------------------------
@ -249,13 +246,16 @@ FILE.Load.ASM.Decode
FILE.Load.ASM.2Buf
phy
phx
sta (BufPtr)
inc BufPtr
bne .1
inc BufPtr+1
.1 inc FileLen
bne .8
inc FileLen+1
lda FileLen+1
@ -275,6 +275,7 @@ FILE.Load.ASM.2Buf
sta BufPtr+1
.8 clc
.9 plx
ply
rts
@ -501,9 +502,13 @@ FILE.ReadY phy
>PUSHB TmpIndex
>PUSHW ZPPTR1
ply
lda #0
>PUSHYA
ply
bne .1
inc
.1 >PUSHYA
>SYSCALL FRead
rts
*--------------------------------------

View File

@ -15,15 +15,15 @@ SCRN.Init >PUSHW L.SEQ.INIT
SCRN.Repaint lda #$ff
>STA.G bUpdateTop
>STA.G bUpdateStatus
jsr SCRN.UpdateTopBar
bcs SCRN.Init.9
jsr SCRN.GotoCurXCurY
bcs SCRN.Init.9
jmp SCRN.UpdateMainAndStatus
SCRN.Init.9 rts
*--------------------------------------
SCRN.Home lda #0
@ -55,7 +55,7 @@ SCRN.UnSaved >LDA.G bUnSaved
SCRN.UpdateTopBar
>LDA.G bUpdateTop
bmi SCRN.UpdateTopBar.1
SCRN.UpdateTopBar.8
SCRN.UpdateTopBar.8
clc
rts
@ -64,56 +64,56 @@ SCRN.UpdateTopBar.1
sta (pData),y
jsr SCRN.LineBufInitBar
ldx #SEQ.CURSAVE-SEQS
jsr SCRN.SEQS.ToLineBuf
ldy #1
jsr SCRN.LineBufGotoLineY
bcs .9
>LDA.G ScreenW
tax
lda #C.SPACE
.1 jsr SCRN.ToLineBuf
dex
bne .1
lda #C.CR
jsr SCRN.ToLineBuf
>PUSHW LineBufPtr
>PUSHW L.MSG.TOPBAR
>PUSHW A2osX.KVER
>LDA.G hFileName
>SYSCALL GetMemPtr
>PUSHYA
>LDA.G FileType
tax
>PUSHW L.MSG.FILETYPES,x
>PUSHBI 6
jsr SCRN.LineBufSprintf
bcs .9
>LDA.G bUnSaved
beq .2
lda #'!'
jsr SCRN.ToLineBuf
.2 ldx #SEQ.CURRESTORE-SEQS
jsr SCRN.SEQS.ToLineBuf
jmp SCRN.LineBufOut
.8 clc
.8 clc
.9 rts
*--------------------------------------
SCRN.UpdateViewPort
SCRN.UpdateViewPort
stz bRepaint
.1 >LDA.G FileX
@ -127,7 +127,7 @@ SCRN.UpdateViewPort
.2 bit bRepaint
bmi .30
.21 >LDA.G ScreenX
clc
>ADC.G ScreenW
@ -142,7 +142,7 @@ SCRN.UpdateViewPort
.3 bit bRepaint
.30 bmi .6
.31 >LDA.G FileY+1
tax
dey
@ -158,13 +158,13 @@ SCRN.UpdateViewPort
bit bRepaint
bmi .31 skip scroll, will be repainted later
jsr SCRN.scrollDn ...and move content one line down
jsr SCRN.scrollDn ...and move content one line down
bcc .31
rts
.4 bit bRepaint
bmi .6
.41 >LDA.G ScreenY+1
tax
dey
@ -178,7 +178,7 @@ SCRN.UpdateViewPort
.5 >CMP.G FileY A,X = screen bottom
txa
iny FileY > screen bottom ?
iny FileY > screen bottom ?
sbc (pData),y
bcs .6 CS : fileY>= screen bottom
@ -202,7 +202,7 @@ SCRN.UpdateViewPort
jsr BUF.ComputeCOffset
jsr SCRN.GotoCurXCurY
bit bRepaint
bmi SCRN.UpdateMain
@ -220,7 +220,7 @@ SCRN.UpdateMain >LDA.G ScreenY
stz TmpByte
>LDA.G ViewPortH
bra SCRN.UpdateMain.1
SCRN.UpdateLast >LDA.G ViewPortHm1
sta TmpByte
clc
@ -230,11 +230,11 @@ SCRN.UpdateLast >LDA.G ViewPortHm1
lda (pData),y
adc #0
sta TmpIndex+1
lda #1
SCRN.UpdateMain.1
sta TmpCount
.1 lda TmpIndex
ldx TmpIndex+1
@ -291,10 +291,10 @@ SCRN.UpdateCurrentLine
.1 jsr BUF.GetLineAX
bcc .2
jsr SCRN.LineBufInitEdit
jmp SCRN.UpdateLineAtBufPtr.EOL
.2 phy
>LDA.G CurY
ply
@ -309,14 +309,14 @@ SCRN.UpdateLineAtALenY
sta TmpLen+1
jsr SCRN.LineBufInitEdit
ldy TmpLen+1
jsr SCRN.LineBufGotoLineY
>LDA.G ScreenX
cmp TmpLen
bcs SCRN.UpdateLineAtBufPtr.EOL
tay
clc
adc BUF.LOffset
@ -332,7 +332,7 @@ SCRN.UpdateLineAtALenY
bcc .2
inc BufPtr+1
.2
.2
SCRN.UpdateLineAtBufPtr
>LDA.G ScreenW
@ -357,12 +357,12 @@ SCRN.UpdateLineAtBufPtr
beq .50
cmp #'%'
bne .51
.50 pha
lda #'\'
jsr SCRN.ToLineBuf
pla
.51 jsr SCRN.ToLineBuf
inc BufPtr
bne .6
@ -407,15 +407,15 @@ SCRN.ToggleSel.RTS
SCRN.UpdateStatusBar
>LDA.G bUpdateStatus
bpl SCRN.ToggleSel.RTS
lda #0
lda #0
sta (pData),y
jsr SCRN.ResetStatusBar
>PUSHW LineBufPtr
>PUSHW L.MSG.STATUSBAR
>PUSHW FileLen
>PUSHW BUF.COffset
@ -436,7 +436,7 @@ SCRN.UpdateStatusBar
txa
>PUSHA
>PUSHBI 7
jsr SCRN.LineBufSprintf
bcs .9
@ -451,7 +451,7 @@ SCRN.UpdateStatusBar
*--------------------------------------
SCRN.ResetStatusBar
jsr SCRN.LineBufInitBar
ldx #SEQ.CURSAVE-SEQS
jsr SCRN.SEQS.ToLineBuf
@ -461,13 +461,13 @@ SCRN.ResetStatusBar
>LDA.G ScreenW
tax
lda #C.SPACE
.1 jsr SCRN.ToLineBuf
dex
bne .1
lda #C.CR
jmp SCRN.ToLineBuf
*--------------------------------------
@ -481,7 +481,7 @@ SCRN.CursorAdjust
.8 rts
*--------------------------------------
SCRN.GotoCurXCurY
SCRN.GotoCurXCurY
ldy #CurX
lda (pData),y
tax
@ -498,7 +498,7 @@ SCRN.GotoXY >PUSHW L.MSG.GOTOXY
inc
>PUSHA
>PUSHBI 2
>SYSCALL PrintF
rts
*--------------------------------------
@ -558,11 +558,11 @@ SCRN.LineBufInitLBL
phx
ldx #SEQ.DLG.LBL-SEQS
bra SCRN.LineBufInit
SCRN.LineBufInitTB
SCRN.LineBufInitTB
phx
ldx #SEQ.DLG.TB-SEQS
bra SCRN.LineBufInit
SCRN.LineBufInitBut
SCRN.LineBufInitBut
phx
ldx #SEQ.DLG.BUT-SEQS
bra SCRN.LineBufInit
@ -573,7 +573,7 @@ SCRN.LineBufInitEdit
SCRN.LineBufInit
>LDYA.G LineBufBase
>STYA LineBufPtr
jsr SCRN.SEQS.ToLineBuf
plx
rts
@ -598,16 +598,16 @@ SCRN.LineBufGotoLineY
SCRN.LineBufSprintf
>SYSCALL SPrintF
bcs .9
tya
clc
adc LineBufPtr
sta LineBufPtr
bcc .9
inc LineBufPtr+1
clc
.9 rts
*--------------------------------------
SCRN.ToLineBuf sta (LineBufPtr)

View File

@ -29,7 +29,6 @@ DHCP.INIT lda IPCFG+S.NETCFG.STATUS
.99 >LDYA L.MSG.DHCP.NA
>SYSCALL PutS
lda #0
sec
rts
*--------------------------------------
@ -83,6 +82,7 @@ DHCP.RUN.ROFFER jsr DHCP.RUN.SKT.RECV
.1 jsr CheckDHCPOffer
bcs DHCP.RUN.ROFFER
lda #S.IPCFG.STATUS.ROFFER
sta IPCFG
@ -193,20 +193,6 @@ DHCP.QUIT lda hSocket
CheckDHCPOffer jsr CheckDHCPXID
bcs .9
lda ZPFrameBase
clc
adc #S.DHCP.OPTIONS
sta ZPFramePtr
lda ZPFrameBase+1
adc /S.DHCP.OPTIONS
sta ZPFramePtr+1
lda (ZPFramePtr)
cmp #S.DHCP.OPTIONS.MSGTYPE
bne .9
ldy #2
lda (ZPFramePtr),y
cmp #S.DHCP.OPTIONS.DHCPOffer
bne .9
@ -250,7 +236,7 @@ CheckDHCPOffer jsr CheckDHCPXID
.6 lda (ZPFramePtr)
sec
adc ZPFramePtr add option len + 1
adc ZPFramePtr add option len + 1
sta ZPFramePtr
bcc .7
@ -260,15 +246,16 @@ CheckDHCPOffer jsr CheckDHCPXID
cmp #S.DHCP.OPTIONS.END
beq .8
jsr GetDHCPOption May override SVRIP
jsr GetDHCPOption May override SVRIP
bra .5
.8 jsr CS.RUN.DISCARD
clc
rts
.9 jsr CS.RUN.DISCARD
sec
.8 clc
.HS B0 BCS
.9 sec
php
lda hFrame
>SYSCALL FreeMem
plp
rts
*--------------------------------------
GetDHCPOption cmp #S.DHCP.OPTIONS.MASK
@ -349,33 +336,16 @@ GetDHCPOption.CopyIP
CheckDHCPAck jsr CheckDHCPXID
bcs .9
lda ZPFrameBase
clc
adc #S.DHCP.OPTIONS
sta ZPFramePtr
lda ZPFrameBase+1
adc /S.DHCP.OPTIONS
sta ZPFramePtr+1
lda (ZPFramePtr)
cmp #S.DHCP.OPTIONS.MSGTYPE
bne .9
ldy #2
lda (ZPFramePtr),y
cmp #S.DHCP.OPTIONS.DHCPAck
bne .9
jsr CS.RUN.DISCARD
clc
rts
.9 jsr CS.RUN.DISCARD
sec
rts
*--------------------------------------
CS.RUN.DISCARD lda hFrame
.8 clc
.HS B0 BCS
.9 sec
php
lda hFrame
>SYSCALL FreeMem
plp
rts
*--------------------------------------
CheckDHCPXID ldy #S.DHCP.XID+3
@ -389,6 +359,22 @@ CheckDHCPXID ldy #S.DHCP.XID+3
dex
bpl .1
lda ZPFrameBase
clc
adc #S.DHCP.OPTIONS
sta ZPFramePtr
lda ZPFrameBase+1
adc /S.DHCP.OPTIONS
sta ZPFramePtr+1
lda (ZPFramePtr)
cmp #S.DHCP.OPTIONS.MSGTYPE
bne .9
ldy #2
lda (ZPFramePtr),y
clc
rts

View File

@ -4,9 +4,12 @@ NEW
ETC.ReadFiles >LDYAI 256
>SYSCALL GetMem
bcc .1
rts
.1 >STYA ZPTmpPtr1
stx CFG.hBuf1
>LDYA L.HOSTNAME
jsr CFG.Read.PrintF
jsr CFG.Read.HOSTNAME
@ -55,23 +58,24 @@ CFG.Read.HOSTNAME
jsr CFG.Read.Open
jsr CFG.Read.Result
bcs .9
.1 jsr CFG.Read.GetS
bcs .8
lda (ZPTmpPtr1)
beq .1 empty line...
cmp #'#
beq .1 comment...
ldy #0
.2 lda (ZPTmpPtr1),y
sta IPCFG+S.IPCFG.HOSTNAME,y
beq .8 end of name
iny
cpy #15
bne .2
.8 clc
.HS B0 BCS
.9 sec
jmp CFG.Read.Close
*--------------------------------------
CFG.Read.TCPIP.CONF
@ -83,12 +87,6 @@ CFG.Read.TCPIP.CONF
.1 jsr CFG.Read.GetS
bcs .8
lda (ZPTmpPtr1)
beq .1 empty line...
cmp #'#'
beq .1 comment...
ldy #$ff
.2 iny
@ -143,6 +141,7 @@ CFG.Read.TCPIP.CONF
.8 clc
.HS B0 BCS
.9 sec
jmp CFG.Read.Close
.80 jmp (J.CFG.Keywords,x)
@ -202,21 +201,27 @@ CFG.Read.dnsdomain
adc ZPTmpPtr1
sta ZPTmpPtr1
bcc .1
inc ZPTmpPtr1+1
.1 ldy #$ff
.2 iny
lda (ZPTmpPtr1),y
sta IPCFG+S.IPCFG.DOMAIN,y
beq .8
cpy #K.DNS.MAXLEN
bne .2
lda #0
sta IPCFG+S.IPCFG.DOMAIN,y
.8 rts
*--------------------------------------
CFG.Read.HOSTS stz CFG.hBuf2
stz CFG.hBuf3
>LDYA L.HOSTS
jsr CFG.Read.Open
jsr CFG.Read.Result
@ -239,12 +244,6 @@ CFG.Read.HOSTS stz CFG.hBuf2
.1 jsr CFG.Read.GetS
bcs .8
lda (ZPTmpPtr1)
beq .1 empty line...
cmp #'#
beq .1 comment...
jsr CFG.Read.HOSTS.Scan
bcs .1
@ -267,8 +266,10 @@ CFG.Read.HOSTS stz CFG.hBuf2
pha
lda CFG.hBuf3
beq .90
>SYSCALL FreeMem
.90 lda CFG.hBuf2
beq .91
>SYSCALL FreeMem
@ -350,7 +351,17 @@ CFG.Read.GetS >PUSHB CFG.hCfgFile
>PUSHW ZPTmpPtr1
>PUSHWI 255
>SYSCALL FGetS
rts
bcs .9
lda (ZPTmpPtr1)
beq CFG.Read.GetS empty line...
cmp #'#'
beq CFG.Read.GetS comment...
clc
.9 rts
*--------------------------------------
MAN
SAVE usr/src/bin/ipconfig.s.etc

View File

@ -127,6 +127,7 @@ CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG
>STYA pIPCFG
ldy #S.IPCFG-1
.1 lda (pIPCFG),y
sta IPCFG,y
dey
@ -134,11 +135,14 @@ CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG
lda IPCFG+S.NETCFG.DevID
bne CS.RUN.SETUP
>LDYA L.MSG.NODEV
>SYSCALL PutS
lda #MLI.E.NODEV
sec
rts
*--------------------------------------
CS.RUN.SETUP
.1 inc ArgIndex
lda ArgIndex
@ -189,6 +193,7 @@ CS.RUN.SETUP
lda bETC
bpl .6
jsr ETC.ReadFiles
.6 lda bDHCP
@ -237,6 +242,7 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
ldy #DCB.NIC+S.DCB.NIC.MAC
ldx #6
.1 lda (pData),y
>PUSHA
iny
@ -252,7 +258,9 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
>LDA.G DCB.NIC+S.DCB.NIC.FLAGS
and #S.DCB.NIC.FLAGS.ARPOFFLOAD
beq .2
lda #1
.2 >PUSHA
>PUSHBI 1
@ -266,8 +274,8 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
beq .3
lda #1
.3
>PUSHA
.3 >PUSHA
>PUSHBI 1
>SYSCALL PrintF
@ -275,10 +283,11 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
>LDA.G DCB.NIC+S.DCB.NIC.LINK
and #S.DCB.NIC.LINK.OK
bne CS.RUN.LINK
>LDYA L.MSG1.LINK.KO
>SYSCALL PutS
bra CS.RUN.DUMPIP
*--------------------------------------
CS.RUN.LINK >LDYA L.MSG1.LINK.OK
>SYSCALL PutS
@ -289,18 +298,23 @@ CS.RUN.LINK >LDYA L.MSG1.LINK.OK
>LDA.G DCB.NIC+S.DCB.NIC.SPEED
and #$0F
tax
.4 phx
lda #'0'
>SYSCALL PutChar
plx
dex
bne .4
>LDA.G DCB.NIC+S.DCB.NIC.LINK
and #S.DCB.NIC.LINK.FD
bne .5
>LDYA L.MSG1.DPLX.HD
bra .6
.5 >LDYA L.MSG1.DPLX.FD
.6 >SYSCALL PutS
CS.RUN.DUMPIP >PUSHW L.MSG2
@ -310,14 +324,18 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
lda IPCFG+S.NETCFG.STATUS
and #S.IPCFG.STATUS.OK
beq .11
>LDYA L.MSG2.C
bra .10
.11 >LDYA L.MSG2.U
.10 >SYSCALL PutS
>PUSHW L.MSG2.DHCPSRVR
ldx #0
.2 >PUSHB IPCFG+S.IPCFG.DHCPSRVR,x
inx
cpx #4
@ -330,10 +348,12 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
>PUSHW L.MSG2.IPMASK
ldx #0 IP/MASK
.3 >PUSHB IPCFG+S.IPCFG.IP,x
inx
cpx #8
bne .3
>PUSHBI 8
>SYSCALL PrintF
@ -341,20 +361,24 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
>PUSHW L.MSG2.GW
ldx #0
.4 >PUSHB IPCFG+S.IPCFG.GW,x
inx
cpx #4
bne .4
>PUSHBI 4
>SYSCALL PrintF
>PUSHW L.MSG2.DNS
ldx #0
.5 >PUSHB IPCFG+S.IPCFG.DNS1,x
inx
cpx #8
bne .5
>PUSHBI 8
>SYSCALL PrintF
@ -365,6 +389,7 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
>PUSHBI 4
>SYSCALL PrintF
lda #0 tell TSKMGR that all done ok, but
sec we do not want to stay in memory
rts

View File

@ -70,6 +70,7 @@ CS.RUN dec bAll
lda ArgIndex
>SYSCALL ArgV
bcs .3
>STYA ZPPtr1
lda (ZPPtr1)
@ -106,7 +107,7 @@ CS.RUN dec bAll
bit bAll
bmi .7
jsr CS.RUN.PRINT
bcs .9
@ -123,14 +124,14 @@ CS.RUN.RTS rts
CS.RUN.PRINT bit bAccess
bpl .1
>LDYA.G ATTR
>LEA.G AttrBuf
>SYSCALL PutS
bcs CS.RUN.RTS
.1 bit bMod
bpl .2
>LDYA.G MOD
>LEA.G MOD
>SYSCALL PutS
bcs CS.RUN.RTS
@ -211,7 +212,7 @@ CS.RUN.DUMP lda ArgFile
>SYSCALL FreeMem
>PUSHW L.MSG.Access
>PUSHEA.G ATTR
>PUSHEA.G AttrBuf
>PUSHBI 2
>SYSCALL PrintF
@ -244,7 +245,7 @@ CS.RUN.CONVERT jsr Access2CSTR
Access2CSTR ldy #S.STAT.P.ACCESS
lda (pData),y
ldy #ATTR+15
ldy #AttrBuf+15
ldx #15
.1 lsr
@ -431,13 +432,12 @@ MSG.U .AZ "%u\r\n"
.OR 0
DS.START
StatBuf .BS S.STAT
ATTR .BS 17
AttrBuf .BS 17
MOD .BS 11 drwxrwxrwx + \0
TIME.Access .BS 20
TIME.Mod .BS 20
TIME.Create .BS 20
DS.END
.ED
DS.END .ED
*--------------------------------------
MAN
SAVE usr/src/bin/stat.s

View File

@ -15,6 +15,7 @@ S.SMB.H.CMD.FLUSH .EQ $05
S.SMB.H.CMD.DELETE .EQ $06
S.SMB.H.CMD.RENAME .EQ $07
S.SMB.H.CMD.SEEK .EQ $12
S.SMB.H.CMD.OPEN.ANDX .EQ $2D
S.SMB.H.CMD.READ.ANDX .EQ $2E
S.SMB.H.CMD.WRITE.ANDX .EQ $2F
S.SMB.H.CMD.TRANS2 .EQ $32

View File

@ -49,7 +49,7 @@ CIFS2.Stat jsr ReadSocket
jsr GetRespData
jsr CheckSMBStatus
lda #MLI.E.INVPATH Return this for stat() match ProDOS Behavior
bcs .90
@ -67,15 +67,15 @@ CIFS2.Stat jsr ReadSocket
.9 jsr Exit.NODATA
beq .99
.90 >POP 4
.99 rts
.99 rts
*--------------------------------------
CIFS.MKDir >STYA pPath resolved path
* jsr ClearSocket
jsr GetCtx
jsr RequestT2SetupX
@ -116,7 +116,7 @@ CIFS2.MKDir jsr ReadSocket
.9 jsr Exit.NODATA
beq .99
.90 >POP 4
.99 rts
@ -282,7 +282,7 @@ CIFS2.ReadDir jsr GetPFD
jsr CIFS2.ReadDir.FillBuf
jsr Exit.OK
>LDYA BufPtr
ldx hBuf
@ -327,12 +327,12 @@ CIFS2.ReadDir.GetBuf
jsr AddA2Ptr1
lda (ZPPtr1) Filename Len
sec
sec +\0
jsr AddA2Ptr2
lda (ZPPtr1) Filename Len
inc
sec
inc +1 skip Filename Len
sec +\0
jsr AddA2Ptr1
dex
@ -363,31 +363,94 @@ CIFS2.ReadDir.FillBuf
.10 lda (ZPRespPtr),y
tax
.1 jsr FileInfo2StatBuf
.1 phx
jsr FileInfo2StatBuf
lda #22
sec skip Filename Len
clc
jsr AddA2Ptr1
lda (ZPPtr1)
tax Save Filename Len
inc ZPPtr1 Skip Filename Len
bne .2
inc ZPPtr1+1
ldy #$ff
.2 ldy #$ff
.3 iny
lda (ZPPtr1),y
sta (ZPPtr2),y
bne .3
tya
txa
sec
jsr AddA2Ptr1
txa
sec
sbc #4 "x.EXT" ?
bcc .7
tay
lda (ZPPtr2),y
cmp #'.'
bne .7
ldx #0
.4 phy Y = '.' offset
phx
.5 lda PRODOS.FT.TXT,x
iny
cmp (ZPPtr2),y
bne .6
inx
txa
and #3
bne .5
pla
lsr
lsr
tax
lda PRODOS.FT.HEX,x
sta StatBuf+S.STAT.P.TYPE
ply
lda #0
sta (ZPPtr2),y
tya
tax
bra .7
.6 pla
clc
adc #4
tax
ply
cpx #PRODOS.FT.END
bne .4
.7 txa
sec +\0
jsr AddA2Ptr2
jsr StatBuf2Ptr2
jsr AddSTAT2Ptr2
.8 plx
dex
bne .1
@ -428,6 +491,11 @@ CIFS2.ChOwn
*--------------------------------------
CIFS.FOpen >STYA pPath resolved path
ldy #2
lda (pStack),y TYPE
jsr ProDOS2TypeLess
jsr GetCtx
ldx #S.SMB.H.CMD.NT.CREATE.ANDX
@ -457,10 +525,9 @@ CIFS.FOpen >STYA pPath resolved path
sta (ZPReqPtr),y
lda #0
ror
iny ByteCountOfs+1
sta (ZPReqPtr),y
jsr SetReqLen
ldx #1 FILE_OPEN
@ -469,15 +536,15 @@ CIFS.FOpen >STYA pPath resolved path
lda (pStack),y
bit #O.WRONLY
beq .8
bit #O.CREATE
bne .3
ldx #3 FILE_OPEN_IF
.3 bit #O.APPEND
bne .8
ldx #5 FILE_OVERWRITE_IF
.8 txa
@ -502,7 +569,7 @@ CIFS2.FOpen jsr ReadSocket
jsr CIFS.NewFD
bcs .91
ldy #S.NETBIOS+S.SMB.H+6 FileID
lda (ZPRespPtr),y
pha
@ -514,7 +581,7 @@ CIFS2.FOpen jsr ReadSocket
dey
pla
sta (pFD),y
ldy #3 fopen flags
lda (pStack),y
bit #O.APPEND
@ -522,24 +589,24 @@ CIFS2.FOpen jsr ReadSocket
ldy #S.NETBIOS+S.SMB.H+56+3 EOF
ldx #4
.1 lda (ZPRespPtr),y
pha
dey
dex
bne .1
ldx #4
ldy #S.FD.REG.REF+2
.2 pla
sta (pFD),y
iny
dex
bne .2
bra .8
.3 jsr CIFS.Seek0
.8 ldy #4 path
@ -553,12 +620,12 @@ CIFS2.FOpen jsr ReadSocket
>PUSHB hFD
>SYSCALL2 mknod
.91 jsr Exit.KO
.91 jsr Exit.KO
bra .90
.9 jsr Exit.NODATA
beq .99
.90 >POP 6
.99 rts
@ -615,7 +682,7 @@ CIFS2.FClose sta hFILE
lda hFILE
jsr CIFS.CloseDir
jmp Exit.OK
.9 jmp Exit.NODATA
@ -644,24 +711,24 @@ CIFS.FRead ldy #4 hNod
jsr ReqSetupPtr2
jsr CIFS.RWGetFidOfs
ldy #1 DataLen HI
lda (pStack),y
beq .2
lda #0
ldx #1 256 bytes to read
bra .3
.2 lda (pStack) DataLen LO
.2 lda (pStack) DataLen LO
ldx #0
.3 ldy #S.NETBIOS+S.SMB.H+11 MaxCountOfBytesToReturn
sta (ZPReqPtr),y
iny
txa
sta (ZPReqPtr),y
jsr SetReqLen
jsr WriteSocket
@ -684,9 +751,9 @@ CIFS2.FRead jsr ReadSocket
iny
ora (ZPRespPtr),y
bne .10
jsr Exit.OK
lda #MLI.E.EOF
sec
bra .90
@ -717,7 +784,7 @@ CIFS2.FRead jsr ReadSocket
tax
jsr CIFS.CopyX
ldy #S.NETBIOS+S.SMB.H+11
jsr CIFS2.RWSetOfsY
@ -731,7 +798,7 @@ CIFS2.FRead jsr ReadSocket
lda (pStack),y
dec
sta (pStack),y
ldy #3 DataPtr HI
lda (pStack),y
inc
@ -740,9 +807,9 @@ CIFS2.FRead jsr ReadSocket
.2 dey DataLength LO
lda (ZPRespPtr),y
sta CIFS.Cnt
lda #0
sta (pStack) DataLen LO
@ -752,9 +819,9 @@ CIFS2.FRead jsr ReadSocket
lda (pStack),y
ora (pStack) DataLen LO
bne .8
>LDYA CIFS.Cnt
bra .90
.8 jmp Sleep2 Back to CIFS.FRead for next chunk
@ -785,7 +852,7 @@ CIFS.FWrite ldy #4 hNod
bne .1
jsr ReqSetupPtr2
jsr CIFS.RWGetFidOfs
ldy #3 DataPtr HI
@ -840,7 +907,7 @@ CIFS.FWrite ldy #4 hNod
plx
jsr CIFS.CopyX
jsr SetReqLen
jsr WriteSocket
@ -881,7 +948,7 @@ CIFS2.FWrite jsr ReadSocket
ldy #S.NETBIOS+S.SMB.H+5 Count LO
lda (ZPRespPtr),y
bne .1
inc CIFS.Cnt+1
bra .7
@ -889,7 +956,7 @@ CIFS2.FWrite jsr ReadSocket
lda #0
sta (pStack) DataLen LO
.7 jsr Exit.OK
ldy #1 DataLen HI
@ -897,12 +964,12 @@ CIFS2.FWrite jsr ReadSocket
ora (pStack) DataLen LO
bne .8
>LDYA CIFS.Cnt
clc
bra .90
.8 jmp Sleep2
.8 jmp Sleep2
.9 jsr Exit.NODATA
beq .99
@ -952,7 +1019,7 @@ CIFS.Remove >STYA pPath resolved path
inc +1 for \0
jsr Add2ByteCount
jsr SetReqLen
jsr WriteSocket
@ -981,7 +1048,7 @@ CIFS.Rename >STYA pPath resolved src path
* jsr ClearSocket
jsr GetCTX
ldx #S.SMB.H.CMD.RENAME
jsr RequestSetupX
@ -1005,19 +1072,19 @@ CIFS.Rename >STYA pPath resolved src path
inc +1 for BufferFormat
inc +1 for \0
jsr Add2ByteCount
lda (pStack)
sta pPath
ldy #1
lda (pStack),y
sta pPath+1
.2 inc pPath skip /mount
bne .3
inc pPath+1
.3 lda (pPath)
cmp #'/'
bne .2
@ -1026,11 +1093,11 @@ CIFS.Rename >STYA pPath resolved src path
jsr PutBytePtr2
jsr AppendPathPtr2
tya
inc +1 for BufferFormat
inc +1 for \0
jsr Add2ByteCount
jsr SetReqLen
@ -1115,18 +1182,18 @@ CIFS2.RWSetOfsY phy
ply
iny Count HI
lda (ZPRespPtr),y
ldy #S.FD.REG.REF+3
adc (pFD),y
sta (pFD),y
bcc .8
iny
lda (pFD),y
inc
sta (pFD),y
bne .8
iny
lda (pFD),y
inc
@ -1141,18 +1208,18 @@ CIFS.CopyX ldy #0
iny
dex
bne .1
rts
*--------------------------------------
CIFS.Seek0 ldx #4
ldy #S.FD.REG.REF+2
lda #0
.1 sta (pFD),y
iny
dex
bne .1
rts
*--------------------------------------
MAN

View File

@ -557,6 +557,69 @@ CIFS.CallBack bit CIFS.Status
*--------------------------------------
.INB usr/src/lib/libcifs.io.s
*--------------------------------------
TypeLess2ProDOS
*--------------------------------------
ProDOS2TypeLess tax
beq .8
ldx #0
.1 cmp PRODOS.FT.HEX,x
beq .4
inx
cpx #PRODOS.FT.TXT-PRODOS.FT.HEX
bne .1
pha
lsr
lsr
lsr
lsr
ora #$30
cmp #'9'+1
bcc .2
adc #6
.2 sta PRODOS.FT.DFLT+1
pla
and #$0F
ora #$30
cmp #'9'+1
bcc .3
adc #6
.3 sta PRODOS.FT.DFLT+2
.4 txa
asl
asl
tax
ldy #0
.5 iny
lda (pPath),y
bne .5
lda #'.'
sta (pPath),y
iny
.6 lda PRODOS.FT.TXT,x
sta (pPath),y
beq .8
inx
iny
bra .6
.8 rts
*--------------------------------------
GetPFD tax
phx
@ -913,8 +976,6 @@ FreeRespData.RTS
rts
*--------------------------------------
FileInfo2StatBuf
phx
ldx #S.STAT-1
.1 stz StatBuf,x
@ -953,9 +1014,7 @@ FileInfo2StatBuf
lda /S.STAT.MODE.DIR
sta StatBuf+S.STAT.MODE+1
.8 plx
rts
.8 rts
*--------------------------------------
* YYYYYYYM MMM DDDDD
* HHHHHmmm mmm SSSSS
@ -1069,6 +1128,19 @@ CIFS.BADCALL lda #MLI.E.BADCALL
rts
*--------------------------------------
CS.END
PRODOS.FT.HEX .HS 0406FAFCFDE2CBCCCFFF
PRODOS.FT.TXT .AZ "txt"
.AZ "bin"
.AZ "asm"
.AZ "bas"
.AZ "var"
.AZ "atk"
.AZ "pix"
.AZ "fon"
.AZ "pak"
.AZ "sys"
PRODOS.FT.END .EQ *-PRODOS.FT.TXT
PRODOS.FT.DFLT .AZ "$ "
*--------------------------------------
SMBERR01 .DA #2,#3,#32
MLIERR01 .DA #MLI.E.FNOTFND,#MLI.E.PNOTFND,#MLI.E.OPEN

View File

@ -5,7 +5,6 @@ NEW
ArgCount .BS 1
bPause .BS 1
hSrcFile .BS 1
hSrcFullPath .BS 1
Count .BS 2
RC .BS 1
@ -13,8 +12,11 @@ RC .BS 1
.DO X.COPY.TO.DEST=1
hDstFileName .BS 1
hDstFullPath .BS 1
hDstFile .BS 1
bCopy .BS 1
hSrcFile .BS 1
hDstFile .BS 1
hCopyBuf .BS 1
CopyRC .BS 1
.FIN
@ -25,3 +27,5 @@ hToDelete .BS 1
*--------------------------------------
MAN
SAVE usr/src/shared/x.cpmvrm.g
LOAD usr/src/bin/cp.s
ASM