git-svn-id: http://svn.code.sf.net/p/netboot65/code@145 93682198-c243-4bdb-bd91-e943c89aac3b

This commit is contained in:
jonnosan 2009-06-28 08:46:00 +00:00
parent 0778ad8761
commit 525117fb0a
2 changed files with 19 additions and 3 deletions

View File

@ -38,6 +38,7 @@ MAX_TCP_PACKETS_SENT=8 ;timeout after sending 8 messages will be about 7 sec
.import add_16_32
.import cmp_32_32
.import cmp_16_16
.import sub_16_16
@ -593,13 +594,28 @@ tcp_process:
sta acc16
lda ip_inp+ip_len ;payload length (hi byte)
sta acc16+1
lda
lda tcp_inp+tcp_header_length ;high 4 bites is header length in 32 bit words
lsr ; A=A/2
lsr ; A=A/2
clc ; A now equal to tcp header length in bytes
adc #20 ;add 20 bytes for IP header. this gives length of IP +TCP headers
ldx #0
jsr sub_16_16
;acc16 now contains the length of data in this TCP packet
lda acc16
bne @not_empty_packet
lda acc16+1
beq @empty_packet
@not_empty_packet:
.byte $92
jmp @send_ack
@empty_packet:
rts
;FIXME
; - move ack ptr along
; - send ack
; - do a callback
.byte $92
@not_expected_seq_number:
@not_current_connection_on_ack:

View File

@ -81,7 +81,7 @@ init:
ldax #$100
jsr test_sub_16_16
rts
ldax #number1
stax acc32
stax op32