A2osX/SBIN/CIFSD.S.CORE.txt

382 lines
5.3 KiB
Plaintext
Raw Permalink Normal View History

2023-01-17 06:31:23 +00:00
NEW
AUTO 3,1
*--------------------------------------
CORE.ReqT2SetupX
ldx #S.SMB.H.CMD.TRANS2
jsr CORE.ReqSetupX
ldx #0
.1 lda SMB.Trans2.H,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.Trans2.H.Len
bne .1
rts
*--------------------------------------
CORE.ReqSetupX phx
lda hReq
>SYSCALL2 GetMemPtr
>STYA ZPReqPtr
lda hSMBContext
>SYSCALL2 GetMemPtr
>STYA ZPCtxPtr
ldy #0
.1 lda (ZPCtxPtr),y
cpy #S.NETBIOS+S.SMB.H.CMD
bne .2
pla
.2 sta (ZPReqPtr),y
iny
cpy #S.NETBIOS+S.SMB.H
bne .1
rts
*--------------------------------------
CORE.ReqSetupPtr2
sty ByteCountOfs
lda #0
sta (ZPReqPtr),y Reset ByteCount
iny
sta (ZPReqPtr),y
iny +2 for ByteCount
CORE.ReqT2SetupPtr2
sty ZPReqLen
stz ZPReqLen+1
tya
clc
adc ZPReqPtr
sta ZPPtr2
lda ZPReqPtr+1
adc #0
sta ZPPtr2+1
rts
*--------------------------------------
CORE.PutBytePtr2
sta (ZPPtr2)
inc ZPPtr2
bne .1
inc ZPPtr2+1
.1 inc ZPReqLen
bne .8
inc ZPReqLen+1
.8 rts
*--------------------------------------
CORE.AppendPathPtr2BF4
lda #$04 BufferFormat
jsr CORE.PutBytePtr2
CORE.AppendPathPtr2
ldx #0
ldy #$ff
.1 iny
lda (pPath),y
beq .4
.2 cmp #'/'
bne .3
lda #'\'
.3 sta (ZPPtr2),y
tax
bra .1
.4 cpx #'\'
bne .5
dey
.5 sta (ZPPtr2),y A = 0
rts
*--------------------------------------
CORE.AppendTypePtr2
pha
lda #'.'
sta (ZPPtr2),y
iny
pla
2023-01-17 06:31:23 +00:00
ldx #0
.1 cmp PRODOS.FT.HEX,x
beq .4
inx
cpx #PRODOS.FT.TXT-PRODOS.FT.HEX
bne .1
pha
lda #'0'
sta (ZPPtr2),y
iny
pla
bra CORE.AppendHEXPtr2
.4 txa
asl
asl
tax
.6 lda PRODOS.FT.TXT,x
beq .8
sta (ZPPtr2),y
inx
iny
bra .6
.8 rts
*--------------------------------------
CORE.AppendAuxTPtr2
pha
lda #'_'
sta (ZPPtr2),y
iny
pla
jsr CORE.AppendHEXPtr2
txa
*--------------------------------------
CORE.AppendHEXPtr2
2023-01-17 06:31:23 +00:00
pha
lsr
lsr
lsr
lsr
ora #$30
cmp #'9'+1
bcc .2
adc #6
.2 sta (ZPPtr2),y
iny
2023-01-17 06:31:23 +00:00
pla
and #$0F
ora #$30
cmp #'9'+1
bcc .3
adc #6
.3 sta (ZPPtr2),y
2023-01-17 06:31:23 +00:00
iny
rts
2023-01-17 06:31:23 +00:00
*--------------------------------------
CORE.Add2ByteCount
ldy ByteCountOfs
clc
adc (ZPReqPtr),y
sta (ZPReqPtr),y
iny ByteCountOfs+1
lda #0
adc (ZPReqPtr),y
sta (ZPReqPtr),y
rts
*--------------------------------------
CORE.AddYReqLenPtr2
tya
sec +1 for \0
adc ZPPtr2
sta ZPPtr2
bcc CORE.AddYReqLen
inc ZPPtr2+1
*--------------------------------------
CORE.AddYReqLen tya
sec +1 for \0
adc ZPReqLen
sta ZPReqLen
bcc .8
inc ZPReqLen+1
.8 rts
*--------------------------------------
CORE.AppendPath ldx #0
.1 lda (pPath)
beq .4
inc pPath
bne .2
inc pPath+1
.2 cmp #'/'
bne .3
lda #'\'
.3 sta (ZPReqPtr),y
tax
iny
bra .1
.4 cpx #'\'
bne .5
dey
.5 rts
*--------------------------------------
CORE.SetT2ReqLenYA
sty ZPReqLen
sta ZPReqLen+1
CORE.SetT2ReqLen
lda ZPReqLen
sec
sbc #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+7
ldy #S.NETBIOS+S.SMB.H+1
sta (ZPReqPtr),y
ldy #S.NETBIOS+S.SMB.H+19
sta (ZPReqPtr),y
inc
inc
inc
ldy #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+2
sta (ZPReqPtr),y
*--------------------------------------
CORE.SetReqLen lda ZPReqLen
sec
sbc #S.NETBIOS
ldy #S.NETBIOS.LEN+2
sta (ZPReqPtr),y
lda ZPReqLen+1
sbc /S.NETBIOS
dey
sta (ZPReqPtr),y
rts
*--------------------------------------
CORE.GetRespData
sta hResp
>SYSCALL2 GetMemPtr
pha
tya
* clc
adc #S.TCP
sta ZPRespPtr
pla
adc /S.TCP
sta ZPRespPtr+1
rts
*--------------------------------------
CORE.GetRespDataPtr1
ldy #S.NETBIOS+S.SMB.H+15 Data Offset
lda (ZPRespPtr),y
clc
adc ZPRespPtr
tax
iny
lda (ZPRespPtr),y
adc ZPRespPtr+1
pha
txa
clc
adc #S.NETBIOS
sta ZPPtr1
pla
adc /S.NETBIOS
sta ZPPtr1+1
rts
*--------------------------------------
CORE.CheckSMBStatus
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
clc
beq CORE.FreeRespData.RTS
stz CIFS.Status
cmp #2 SRV
bcs .9
iny
iny
lda (ZPRespPtr),y ERR CODE
ldx #MLIERR01-SMBERR01
.1 cmp SMBERR01-1,x
beq .2 CS
dex
bne .1
.9 lda #MLI.E.IO
sec
bra CORE.FreeRespData
.2 lda MLIERR01-1,x
*--------------------------------------
CORE.FreeRespData
php
pha
lda hResp
beq .8
stz hResp
>SYSCALL2 FreeMem
.8 pla
plp
CORE.FreeRespData.RTS
rts
*--------------------------------------
MAN
SAVE usr/src/sbin/cifsd.s.core
LOAD usr/src/sbin/cifsd.s
ASM