A2osX/SBIN/TELNETD.S.txt

85 lines
1.7 KiB
Plaintext
Raw Normal View History

2015-03-14 21:48:35 +00:00
PR#3
2015-06-03 18:30:57 +00:00
PREFIX /A2OSX.SRC
2015-03-14 21:48:35 +00:00
NEW
INC 1
AUTO 6
.LIST OFF
.OP 65C02
.OR $2000
2015-10-19 20:35:00 +00:00
.TF /A2OSX.BOOT/SBIN/TELNETD
2015-03-14 21:48:35 +00:00
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
2015-10-19 20:35:00 +00:00
.INB INC/LIBTCPIP.I
2015-03-14 21:48:35 +00:00
*--------------------------------------
2015-10-19 20:35:00 +00:00
* File Header (16 Bytes)
2015-03-14 21:48:35 +00:00
*--------------------------------------
CS.START cld
jmp (.1,x)
2015-10-19 20:35:00 +00:00
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA 0
.DA CS.END-CS.START Code Length To Relocate
.DA 0
.DA 0
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
2015-03-14 21:48:35 +00:00
.1 .DA CS.INIT
.DA CS.RUN
2015-10-19 20:35:00 +00:00
.DA CS.DOEVENT
2015-03-14 21:48:35 +00:00
.DA CS.QUIT
2015-10-19 20:35:00 +00:00
L.LIBTCPIP .DA LIBTCPIP
.DA 0
2015-03-14 21:48:35 +00:00
*--------------------------------------
2015-10-19 20:35:00 +00:00
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL SYS.LoadLibYA
2015-10-19 20:35:00 +00:00
bcs .99
sta hLIBTCPIP
>PUSHWI S.IP.PROTOCOL.TCP
>PUSHWI TCP.PORT.TELNETS
>LIBCALL hLIBTCPIP,LIBTCPIP.CreateSocket
bcs .99
sta hSrvSocket
clc
.99 rts
2015-03-14 21:48:35 +00:00
*--------------------------------------
2015-10-19 20:35:00 +00:00
CS.RUN lda hSrvSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.ListenSocket
bcs .8
>LIBCALL hLIBTCPIP,LIBTCPIP.CreateDevice
bcs *
.8 clc
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
2015-10-19 20:35:00 +00:00
CS.DOEVENT clc
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
2015-10-19 20:35:00 +00:00
CS.QUIT >PUSHB hSrvSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.DestroySocket
lda hLIBTCPIP
>SYSCALL SYS.UnloadLibA
clc
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
CS.END
2015-10-19 20:35:00 +00:00
*--------------------------------------
LIBTCPIP >PSTRING "libtcpip.o"
hLIBTCPIP .BS 1
hSrvSocket .BS 1
*--------------------------------------
2015-03-14 21:48:35 +00:00
MAN
SAVE SBIN/TELNETD.S
ASM