emailler/ip65/tcp_c.s

94 lines
1.2 KiB
ArmAsm
Raw Normal View History

.include "../inc/common.inc"
2017-11-06 22:36:44 +00:00
.export _tcp_listen
.export _tcp_connect
.export _tcp_close
.export _tcp_send
.export _tcp_send_keep_alive
.import tcp_listen
.import tcp_connect
.import tcp_close
.import tcp_inbound_data_ptr
.import tcp_inbound_data_length
.import tcp_send
.import tcp_send_keep_alive
.import tcp_callback
.import tcp_remote_ip
2017-11-06 22:36:44 +00:00
.import tcp_connect_ip
.import tcp_send_data_len
2018-08-14 09:20:29 +00:00
.import pushax, popax, popeax, popptr1
2017-11-06 22:36:44 +00:00
.importzp ptr1, sreg
.data
callback:
ldax tcp_inbound_data_ptr
jsr pushax
ldax tcp_inbound_data_length
jmpvector:
2017-11-12 14:05:06 +00:00
jmp $ffff
.code
2017-11-06 22:36:44 +00:00
_tcp_listen:
stax jmpvector+1
ldax #callback
2017-11-06 22:36:44 +00:00
stax tcp_callback
jsr popax
jsr tcp_listen
bcs error
ldax tcp_remote_ip+2
stax sreg
ldax tcp_remote_ip
rts
error:
2017-11-06 22:36:44 +00:00
ldx #$00
txa
stax sreg
2017-11-06 22:36:44 +00:00
rts
_tcp_connect:
stax jmpvector+1
ldax #callback
2017-11-06 22:36:44 +00:00
stax tcp_callback
2018-08-14 09:20:29 +00:00
jsr popptr1
2017-11-06 22:36:44 +00:00
jsr popeax
stax tcp_connect_ip
ldax sreg
stax tcp_connect_ip+2
ldax ptr1
jsr tcp_connect
ldx #$00
txa
rol
rts
_tcp_close:
jsr tcp_close
ldx #$00
txa
rol
rts
_tcp_send:
stax tcp_send_data_len
jsr popax
jsr tcp_send
ldx #$00
txa
rol
rts
_tcp_send_keep_alive:
jsr tcp_send_keep_alive
ldx #$00
txa
rol
rts