Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-09-02 08:27:25 +02:00
parent d43a064a59
commit 16a7463e7d
4 changed files with 57 additions and 51 deletions

Binary file not shown.

Binary file not shown.

View File

@ -21,32 +21,28 @@ ZS.START
ZPIPCfgPtr .BS 2
ZPHostPtr .BS 2
ZPPtr .BS 2
ArgIndex .BS 1
hSocket .BS 1
hReqBuf .BS 1
ZPReqBufPtr .BS 2
ZPReqBufLen .BS 2
bResponse .BS 1
TimeOut .BS 1
bURI .BS 1
hEncodedBuf .BS 1
ZPEncodedBufPtr .BS 2
ZPEncodedBufLen .BS 2
ZPRespBufPtr .BS 2
ZPRespBufLen .BS 2
ArgIndex .BS 1
hSocket .BS 1
hSendBuf .BS 1
ZPSendBufPtr .BS 2
hRespBuf .BS 1
ZPRespBufPtr .BS 2
ZPRespBufLen .BS 2
hFile .BS 1
ZPFileName .BS 2
hRespBuf .BS 1
bResponse .BS 1
TimeOut .BS 1
bURI .BS 1
ZS.END .ED
*--------------------------------------
* File Header (16 Bytes)
@ -109,9 +105,7 @@ CS.RUN.IPOK ldy #S.IPCFG.IP+3
dex
bpl .1
inc ArgIndex
lda ArgIndex
>SYSCALL ArgV
jsr CS.RUN.GETNEXTARG
bcs .9
>STYA ZPHostPtr
@ -140,15 +134,14 @@ CS.RUN.ESYN lda #E.SYN
sec
CS.RUN.RTS rts
*--------------------------------------
CS.RUN.HOSTOK inc ArgIndex
lda ArgIndex
>SYSCALL ArgV
CS.RUN.HOSTOK jsr CS.RUN.GETNEXTARG
bcc .10
.8 jmp CS.RUN.ARGSOK
.10 >STYA ZPPtr
lda (ZPPtr)
cmp #'-'
beq .1
@ -158,9 +151,7 @@ CS.RUN.HOSTOK inc ArgIndex
>STYA SA.REMOTE+S.SOCKADDR.PORT
inc ArgIndex
lda ArgIndex
>SYSCALL ArgV
jsr CS.RUN.GETNEXTARG
bcs .8
>STYA ZPPtr
@ -183,9 +174,7 @@ CS.RUN.HOSTOK inc ArgIndex
bit bURI
bmi CS.RUN.ESYN
inc ArgIndex
lda ArgIndex
>SYSCALL ArgV
jsr CS.RUN.GETNEXTARG
.9 bcs CS.RUN.ESYN
@ -202,9 +191,7 @@ CS.RUN.HOSTOK inc ArgIndex
bit bURI
bmi CS.RUN.ESYN
inc ArgIndex
lda ArgIndex
>SYSCALL ArgV
jsr CS.RUN.GETNEXTARG
bcs .9
>PUSHYA
@ -224,7 +211,7 @@ CS.RUN.HOSTOK inc ArgIndex
jmp CS.RUN.HOSTOK
.3 cmp #'O'
bcs .9
bne .9
inc ArgIndex
lda ArgIndex
@ -234,6 +221,12 @@ CS.RUN.HOSTOK inc ArgIndex
>STYA ZPFileName
jmp CS.RUN.HOSTOK
*--------------------------------------
CS.RUN.GETNEXTARG
inc ArgIndex
lda ArgIndex
>SYSCALL ArgV
rts
*--------------------------------------
CS.RUN.ARGSOK >PUSHW L.MSG.CONNECT
ldx #0
@ -484,28 +477,10 @@ CS.RUN.RESPONSE jsr Init.TimeOut
bra .80
.2 >SYSCALL GetMemPtr
>STYA ZPRespBufPtr
.2 jsr CS.RUN.GETRESPONSE
ldy #S.IP.TOTAL.LENGTH+1
lda (ZPRespBufPtr),y
sec
sbc #S.TCP-S.IP
sta ZPRespBufLen
dey
lda (ZPRespBufPtr),y
sbc /S.TCP-S.IP
sta ZPRespBufLen+1
lda ZPRespBufPtr
clc
adc #S.TCP
sta ZPRespBufPtr
bcc .3
inc ZPRespBufPtr+1
lda #"!"
>SYSCALL putchar
.3 bit bResponse
bmi .6
@ -550,6 +525,10 @@ CS.RUN.RESPONSE jsr Init.TimeOut
.7 >SYSCALL FWrite
bcs .9
lda hRespBuf
stz hRespBuf
>SYSCALL FreeMem
jmp CS.RUN.RESPONSE
@ -566,6 +545,33 @@ CS.RUN.RESPONSE jsr Init.TimeOut
sec
.9 rts
*--------------------------------------
CS.RUN.GETRESPONSE
sta hRespBuf
>SYSCALL GetMemPtr
>STYA ZPRespBufPtr
ldy #S.IP.TOTAL.LENGTH+1
lda (ZPRespBufPtr),y
sec
sbc #S.TCP-S.IP
sta ZPRespBufLen
dey
lda (ZPRespBufPtr),y
sbc /S.TCP-S.IP
sta ZPRespBufLen+1
lda ZPRespBufPtr
clc
adc #S.TCP
sta ZPRespBufPtr
bcc .8
inc ZPRespBufPtr+1
.8 rts
*--------------------------------------
CS.DOEVENT lda (pEvent)
bpl .9 is it a TIMER event?

View File

@ -322,7 +322,7 @@ CheckDHCPAck jsr CheckDHCPXID
sec
rts
*--------------------------------------
CS.RUN.DISCARD sta hFrame
CS.RUN.DISCARD lda hFrame
>SYSCALL FreeMem
rts
*--------------------------------------