mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-08-02 05:28:59 +00:00
Simplified test program sources by using exe headers from cc65 libs.
This commit is contained in:
parent
7b5522ba27
commit
adfd056abd
@ -1,25 +1,26 @@
|
|||||||
|
SYMBOLS {
|
||||||
|
__EXEHDR__: type = import;
|
||||||
|
__LOADADDR__: type = weak, value = __STARTUP_RUN__;
|
||||||
|
__LOADSIZE__: type = weak, value = __BSS_RUN__ - __STARTUP_RUN__;
|
||||||
|
}
|
||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: start = $00, size = $08, type = rw, define = yes; #zero size as we hand allocate all ZP locations
|
ZP: start = $00, size = $08;
|
||||||
IP65ZP: start = $E0, size = $0, type = rw, define = yes; #zero size as we hand allocate all ZP locations
|
IP65ZP: start = $E0, size = $00; #zero size as we hand allocate all ZP locations
|
||||||
HEADER: start = $0000, size = $10, file = %O;
|
HEADER: start = $0800, size = $04, file = %O;
|
||||||
RAM: start = $803, size = $8000, file = %O, define=yes;
|
RAM: start = $0803, size = $77FC, file = %O;
|
||||||
PAGE3: start = $2C0, size = 272;
|
|
||||||
}
|
}
|
||||||
SEGMENTS {
|
SEGMENTS {
|
||||||
EXEHDR: load = HEADER, type = ro;
|
ZEROPAGE: load = ZP, type = zp;
|
||||||
STARTUP: load = RAM,run=RAM, type = ro, define = yes, optional=yes;
|
IP65ZP: load = IP65ZP, type = zp, optional = yes;
|
||||||
CODE: load = RAM, run=RAM, type = ro, define = yes;
|
EXEHDR: load = HEADER, type = ro;
|
||||||
RODATA: load = RAM, run=RAM, type = ro , define = yes;
|
STARTUP: load = RAM, type = ro, define = yes;
|
||||||
IP65_DEFAULTS: load = RAM, run=RAM, type = ro , define = yes;
|
CODE: load = RAM, type = ro;
|
||||||
DATA: load = RAM, run=RAM, type = rw , define = yes;
|
RODATA: load = RAM, type = ro;
|
||||||
PAGE3: load = RAM,run=PAGE3, type = rw, define = yes, optional=yes;
|
DATA: load = RAM, type = rw;
|
||||||
HTTP_VARS: load = RAM, run=RAM, type = rw, optional=yes;
|
SELF_MODIFIED_CODE: load = RAM, type = rw, optional = yes;
|
||||||
TCP_VARS: load = RAM, type = bss, optional=yes;
|
IP65_DEFAULTS: load = RAM, type = rw;
|
||||||
APP_SCRATCH: load = RAM, type = bss , optional=yes;
|
BSS: load = RAM, type = bss, define = yes;
|
||||||
BSS: load=RAM, type = bss, define = yes;
|
APP_SCRATCH: load = RAM, type = bss, optional = yes;
|
||||||
ZEROPAGE: load = ZP, type = zp , optional=yes;
|
TCP_VARS: load = RAM, type = bss, optional = yes;
|
||||||
IP65ZP: load = IP65ZP, type = zp,optional=yes;
|
HTTP_VARS: load = RAM, type = bss, optional = yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,29 +1,27 @@
|
|||||||
|
SYMBOLS {
|
||||||
|
__LOADADDR__: type = import;
|
||||||
|
__EXEHDR__: type = import;
|
||||||
|
}
|
||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: start = $02, size = $1A, type = rw ;
|
ZP: start = $02, size = $1A;
|
||||||
IP65ZP: start = $5f, size = $10, type = rw;
|
IP65ZP: start = $5F, size = $10;
|
||||||
RAM: start = $07FF, size = $77ab, file = %O;
|
LOADADDR: start = $07FF, size = $02, file = %O;
|
||||||
RAM3000: start = $3000, size = $4800, type=rw;
|
HEADER: start = $0801, size = $0C, file = %O;
|
||||||
RAM4000: start = $4000, size = $3800, type=rw;
|
RAM: start = $080D, size = $77F3, file = %O;
|
||||||
RAM6000: start = $6000, size = $1800, type=rw;
|
|
||||||
DISCARD: start = $77FF, size = $10;
|
|
||||||
}
|
}
|
||||||
SEGMENTS {
|
SEGMENTS {
|
||||||
STARTUP: load = RAM, type = ro ,define = yes, optional=yes;
|
ZEROPAGE: load = ZP, type = zp;
|
||||||
CODE: load = RAM, type = ro,define = yes;
|
IP65ZP: load = IP65ZP, type = zp, optional = yes;
|
||||||
DATA: load = RAM, type = rw,define = yes;
|
LOADADDR: load = LOADADDR, type = ro;
|
||||||
SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes;
|
EXEHDR: load = HEADER, type = ro;
|
||||||
VIC_DATA: load = RAM, type = rw,align = $800, optional=yes;
|
STARTUP: load = RAM, type = ro, define = yes;
|
||||||
RODATA: load = RAM, type = ro,define = yes, optional=yes;
|
CODE: load = RAM, type = ro;
|
||||||
IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes;
|
RODATA: load = RAM, type = ro, optional = yes;
|
||||||
BSS: load = RAM, type = bss, optional=yes;
|
DATA: load = RAM, type = rw;
|
||||||
SAFE_BSS: load = RAM3000, type = bss, optional=yes;
|
SELF_MODIFIED_CODE: load = RAM, type = rw, optional = yes;
|
||||||
BSS4K: load = RAM4000, type = bss, optional=yes;
|
IP65_DEFAULTS: load = RAM, type = rw, optional = yes;
|
||||||
DATA6K: load = RAM, run = RAM6000, type = rw, define = yes, optional=yes;
|
BSS: load = RAM, type = bss;
|
||||||
APP_SCRATCH: load = RAM, type = bss, optional=yes;
|
APP_SCRATCH: load = RAM, type = bss, optional = yes;
|
||||||
ZEROPAGE: load = ZP, type = zp, optional=yes;
|
TCP_VARS: load = RAM, type = bss, optional = yes;
|
||||||
IP65ZP: load = IP65ZP, type = zp, optional=yes;
|
HTTP_VARS: load = RAM, type = bss, optional = yes;
|
||||||
EXEHDR: load = DISCARD, type = ro, optional=yes;
|
|
||||||
TCP_VARS: load = RAM, type = bss, optional=yes;
|
|
||||||
HTTP_VARS: load = RAM, type = bss, optional=yes;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,26 +26,30 @@ prg: \
|
|||||||
cifs_tcp.prg \
|
cifs_tcp.prg \
|
||||||
dns.prg \
|
dns.prg \
|
||||||
dottedquad.prg \
|
dottedquad.prg \
|
||||||
getc.prg \
|
|
||||||
geturl_tcp.prg \
|
geturl_tcp.prg \
|
||||||
httpd.prg \
|
|
||||||
parsequerystring.prg \
|
parsequerystring.prg \
|
||||||
parser_tcp.prg \
|
parser_tcp.prg \
|
||||||
ping_tcp.prg \
|
ping_tcp.prg \
|
||||||
sntp.prg \
|
sntp.prg \
|
||||||
tcp_tcp.prg \
|
tcp_tcp.prg \
|
||||||
tftp.prg \
|
tftp.prg \
|
||||||
vic20.prg \
|
# vic20.prg \
|
||||||
wiznet.prg
|
wiznet.prg
|
||||||
|
|
||||||
bin: \
|
bin: \
|
||||||
ip65 \
|
ip65 \
|
||||||
drivers \
|
drivers \
|
||||||
|
cifs_tcp.bin \
|
||||||
dns.bin \
|
dns.bin \
|
||||||
dottedquad.bin \
|
dottedquad.bin \
|
||||||
lancegs.bin \
|
geturl_tcp.bin \
|
||||||
|
parsequerystring.bin \
|
||||||
|
parser_tcp.bin \
|
||||||
|
ping_tcp.bin \
|
||||||
|
sntp.bin \
|
||||||
tcp_tcp.bin \
|
tcp_tcp.bin \
|
||||||
tftp.bin
|
tftp.bin \
|
||||||
|
# lancegs.bin
|
||||||
|
|
||||||
ip65:
|
ip65:
|
||||||
make -C ../ip65 all
|
make -C ../ip65 all
|
||||||
@ -61,16 +65,16 @@ dsk: ip65.dsk
|
|||||||
$(AS) $(AFLAGS) $<
|
$(AS) $(AFLAGS) $<
|
||||||
|
|
||||||
%.prg: %.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
%.prg: %.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
||||||
$(LD) -o $*.prg -C ../cfg/c64prg.cfg -m $*.c64.map -vm $< $(IP65LIB) $(C64RRNETLIB)
|
$(LD) -o $*.prg -C ../cfg/c64prg.cfg -m $*.c64.map -vm $< $(IP65LIB) $(C64RRNETLIB) c64.lib
|
||||||
|
|
||||||
%_tcp.prg: %.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
%_tcp.prg: %.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
||||||
$(LD) -o $(subst _tcp,,$*).prg -C ../cfg/c64prg.cfg -m $(subst _tcp,,$*).c64.map -vm $< $(IP65TCPLIB) $(C64RRNETLIB)
|
$(LD) -o $(subst _tcp,,$*).prg -C ../cfg/c64prg.cfg -m $(subst _tcp,,$*).c64.map -vm $< $(IP65TCPLIB) $(C64RRNETLIB) c64.lib
|
||||||
|
|
||||||
%.bin: %.o $(IP65LIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg
|
%.bin: %.o $(IP65LIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg
|
||||||
$(LD) -o $*.bin -C ../cfg/a2bin.cfg -m $*.a2.map -vm $< $(IP65LIB) $(A2UTHERLIB)
|
$(LD) -o $*.bin -C ../cfg/a2bin.cfg -m $*.a2.map -vm $< $(IP65LIB) $(A2UTHERLIB) apple2.lib
|
||||||
|
|
||||||
%_tcp.bin: %.o $(IP65TCPLIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg
|
%_tcp.bin: %.o $(IP65TCPLIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg
|
||||||
$(LD) -o $(subst _tcp,,$*).bin -C ../cfg/a2bin.cfg -m $(subst _tcp,,$*).a2.map -vm $< $(IP65TCPLIB) $(A2UTHERLIB)
|
$(LD) -o $(subst _tcp,,$*).bin -C ../cfg/a2bin.cfg -m $(subst _tcp,,$*).a2.map -vm $< $(IP65TCPLIB) $(A2UTHERLIB) apple2.lib
|
||||||
|
|
||||||
wiznet.prg: wiznet.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
wiznet.prg: wiznet.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
||||||
$(LD) -o wiznet.prg -C ../cfg/c64prg.cfg -m wiznet.map -vm $< $(IP65WIZNETLIB) $(C64WIZNETLIB)
|
$(LD) -o wiznet.prg -C ../cfg/c64prg.cfg -m wiznet.map -vm $< $(IP65WIZNETLIB) $(C64WIZNETLIB)
|
||||||
@ -96,6 +100,10 @@ ip65.dsk: bin
|
|||||||
cp prodos.dsk $@
|
cp prodos.dsk $@
|
||||||
java -jar $(AC) -cc65 $@ dns bin 0 < dns.bin
|
java -jar $(AC) -cc65 $@ dns bin 0 < dns.bin
|
||||||
java -jar $(AC) -cc65 $@ dottedquad bin 0 < dottedquad.bin
|
java -jar $(AC) -cc65 $@ dottedquad bin 0 < dottedquad.bin
|
||||||
|
java -jar $(AC) -cc65 $@ geturl bin 0 < geturl.bin
|
||||||
|
java -jar $(AC) -cc65 $@ parser bin 0 < parser.bin
|
||||||
|
java -jar $(AC) -cc65 $@ ping bin 0 < ping.bin
|
||||||
|
java -jar $(AC) -cc65 $@ sntp bin 0 < sntp.bin
|
||||||
java -jar $(AC) -cc65 $@ tcp bin 0 < tcp.bin
|
java -jar $(AC) -cc65 $@ tcp bin 0 < tcp.bin
|
||||||
java -jar $(AC) -cc65 $@ tftp bin 0 < tftp.bin
|
java -jar $(AC) -cc65 $@ tftp bin 0 < tftp.bin
|
||||||
|
|
||||||
|
45
test/cifs.s
45
test/cifs.s
@ -1,66 +1,39 @@
|
|||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
.include "../inc/commonprint.i"
|
.include "../inc/commonprint.i"
|
||||||
.include "../inc/net.i"
|
.include "../inc/net.i"
|
||||||
|
|
||||||
.import exit_to_basic
|
.import exit_to_basic
|
||||||
|
|
||||||
.import cfg_get_configuration_ptr
|
.import cfg_get_configuration_ptr
|
||||||
.import cifs_l1_encode
|
.import cifs_l1_encode
|
||||||
.import cifs_l1_decode
|
.import cifs_l1_decode
|
||||||
.import cifs_start
|
.import cifs_start
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
.import __IP65_DEFAULTS_SIZE__
|
|
||||||
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
|
|
||||||
.addr __CODE_LOAD__-$11 ; Start address
|
|
||||||
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+__IP65_DEFAULTS_SIZE__+4 ; Size
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
lda #$0E ;change to lower case
|
lda #$0E ;change to lower case
|
||||||
jsr print_a
|
jsr print_a
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
init_ip_via_dhcp
|
init_ip_via_dhcp
|
||||||
|
|
||||||
; jsr ip65_init
|
; jsr ip65_init
|
||||||
|
|
||||||
ldx #3
|
ldx #3
|
||||||
:
|
:
|
||||||
lda static_ip,x
|
lda static_ip,x
|
||||||
sta cfg_ip,x
|
sta cfg_ip,x
|
||||||
dex
|
dex
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
jsr print_ip_config
|
jsr print_ip_config
|
||||||
|
|
||||||
ldax #hostname_1
|
ldax #hostname_1
|
||||||
jsr do_encoding_test
|
jsr do_encoding_test
|
||||||
|
|
||||||
ldax #hostname_2
|
ldax #hostname_2
|
||||||
jsr do_encoding_test
|
jsr do_encoding_test
|
||||||
|
|
||||||
ldax #hostname_3
|
ldax #hostname_3
|
||||||
jsr do_encoding_test
|
jsr do_encoding_test
|
||||||
@ -69,7 +42,6 @@ init:
|
|||||||
jsr cifs_start
|
jsr cifs_start
|
||||||
jmp exit_to_basic
|
jmp exit_to_basic
|
||||||
|
|
||||||
|
|
||||||
do_encoding_test:
|
do_encoding_test:
|
||||||
stax hostname_ptr
|
stax hostname_ptr
|
||||||
jsr print
|
jsr print
|
||||||
@ -91,8 +63,7 @@ do_encoding_test:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
.rodata
|
||||||
.rodata
|
|
||||||
|
|
||||||
|
|
||||||
hostname_ptr: .res 2
|
hostname_ptr: .res 2
|
||||||
|
38
test/dns.s
38
test/dns.s
@ -9,38 +9,10 @@
|
|||||||
.import dns_ip
|
.import dns_ip
|
||||||
.import dns_status
|
.import dns_status
|
||||||
.import cfg_get_configuration_ptr
|
.import cfg_get_configuration_ptr
|
||||||
|
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
|
|
||||||
.addr __CODE_LOAD__-$11 ; Start address
|
|
||||||
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; Size
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -51,7 +23,7 @@ init:
|
|||||||
init_ip_via_dhcp
|
init_ip_via_dhcp
|
||||||
; jsr overwrite_with_hardcoded_dns_server
|
; jsr overwrite_with_hardcoded_dns_server
|
||||||
jsr print_ip_config
|
jsr print_ip_config
|
||||||
|
|
||||||
ldax #hostname_1
|
ldax #hostname_1
|
||||||
jsr do_dns_query
|
jsr do_dns_query
|
||||||
|
|
||||||
@ -72,7 +44,6 @@ init:
|
|||||||
|
|
||||||
jmp exit_to_basic
|
jmp exit_to_basic
|
||||||
|
|
||||||
|
|
||||||
do_dns_query:
|
do_dns_query:
|
||||||
pha
|
pha
|
||||||
jsr print
|
jsr print
|
||||||
@ -89,7 +60,7 @@ do_dns_query:
|
|||||||
ldax #dns_lookup_failed_msg
|
ldax #dns_lookup_failed_msg
|
||||||
jsr print
|
jsr print
|
||||||
jmp @print_dns_status
|
jmp @print_dns_status
|
||||||
:
|
:
|
||||||
ldax #dns_ip
|
ldax #dns_ip
|
||||||
jsr print_dotted_quad
|
jsr print_dotted_quad
|
||||||
@print_dns_status:
|
@print_dns_status:
|
||||||
@ -111,8 +82,7 @@ overwrite_with_hardcoded_dns_server:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
.rodata
|
||||||
.rodata
|
|
||||||
|
|
||||||
|
|
||||||
hostname_1:
|
hostname_1:
|
||||||
|
@ -1,42 +1,15 @@
|
|||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
.include "../inc/commonprint.i"
|
.include "../inc/commonprint.i"
|
||||||
.include "../inc/net.i"
|
.include "../inc/net.i"
|
||||||
|
|
||||||
.import exit_to_basic
|
.import exit_to_basic
|
||||||
|
|
||||||
.import parse_dotted_quad
|
.import parse_dotted_quad
|
||||||
.import dotted_quad_value
|
.import dotted_quad_value
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
|
|
||||||
.addr __CODE_LOAD__-$11 ; Start address
|
|
||||||
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; Size
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -45,25 +18,25 @@ init:
|
|||||||
jsr print_cr
|
jsr print_cr
|
||||||
|
|
||||||
ldax #dotted_quad_1
|
ldax #dotted_quad_1
|
||||||
jsr test_dotted_quad_string
|
jsr test_dotted_quad_string
|
||||||
|
|
||||||
ldax #dotted_quad_2
|
ldax #dotted_quad_2
|
||||||
jsr test_dotted_quad_string
|
jsr test_dotted_quad_string
|
||||||
|
|
||||||
ldax #dotted_quad_3
|
ldax #dotted_quad_3
|
||||||
jsr test_dotted_quad_string
|
jsr test_dotted_quad_string
|
||||||
|
|
||||||
ldax #dotted_quad_4
|
ldax #dotted_quad_4
|
||||||
jsr test_dotted_quad_string
|
jsr test_dotted_quad_string
|
||||||
|
|
||||||
ldax #dotted_quad_5
|
ldax #dotted_quad_5
|
||||||
jsr test_dotted_quad_string
|
jsr test_dotted_quad_string
|
||||||
|
|
||||||
ldax #dotted_quad_6
|
ldax #dotted_quad_6
|
||||||
jsr test_dotted_quad_string
|
jsr test_dotted_quad_string
|
||||||
|
|
||||||
ldax #dotted_quad_7
|
ldax #dotted_quad_7
|
||||||
jsr test_dotted_quad_string
|
jsr test_dotted_quad_string
|
||||||
|
|
||||||
jmp exit_to_basic
|
jmp exit_to_basic
|
||||||
|
|
||||||
@ -87,11 +60,15 @@ test_dotted_quad_string:
|
|||||||
jsr print
|
jsr print
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
||||||
|
|
||||||
temp_ax: .res 2
|
temp_ax: .res 2
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
dotted_quad_1:
|
dotted_quad_1:
|
||||||
@ -117,7 +94,6 @@ dotted_quad_7:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR testdottedquad.s --
|
;-- LICENSE FOR testdottedquad.s --
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
; The contents of this file are subject to the Mozilla Public License
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
; Version 1.1 (the "License"); you may not use this file except in
|
||||||
|
196
test/getc.s
196
test/getc.s
@ -1,196 +0,0 @@
|
|||||||
|
|
||||||
.ifndef KIPPER_API_VERSION_NUMBER
|
|
||||||
.define EQU =
|
|
||||||
.include "../inc/kipper_constants.i"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
.import print_a
|
|
||||||
.import cfg_get_configuration_ptr
|
|
||||||
.import io_device_no
|
|
||||||
.import io_sector_no
|
|
||||||
.import io_track_no
|
|
||||||
.import io_read_sector
|
|
||||||
.import io_write_sector
|
|
||||||
|
|
||||||
.import io_read_file_with_callback
|
|
||||||
.import io_read_file
|
|
||||||
.import io_filename
|
|
||||||
.import io_filesize
|
|
||||||
.import io_load_address
|
|
||||||
.import io_callback
|
|
||||||
.import get_key
|
|
||||||
.import ip65_error
|
|
||||||
.import ip65_process
|
|
||||||
.import io_read_catalogue_ex
|
|
||||||
|
|
||||||
.macro cout arg
|
|
||||||
lda arg
|
|
||||||
jsr print_a
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
|
||||||
sector_buffer: .res 256
|
|
||||||
output_buffer: .res 520
|
|
||||||
.export output_buffer
|
|
||||||
current_byte_in_row: .res 1
|
|
||||||
current_byte_in_sector: .res 1
|
|
||||||
start_of_current_row: .res 1
|
|
||||||
|
|
||||||
directory_buffer: .res 4096
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
lda #14
|
|
||||||
jsr print_a ;switch to lower case
|
|
||||||
lda $dc08 ;read deci-seconds - start clock ticking
|
|
||||||
sta $dc08
|
|
||||||
jsr load_buffer
|
|
||||||
@loop:
|
|
||||||
lda #5 ;timeout period
|
|
||||||
jsr getc
|
|
||||||
bcs @done
|
|
||||||
jsr print_a
|
|
||||||
jmp @loop
|
|
||||||
@done:
|
|
||||||
rts
|
|
||||||
|
|
||||||
load_buffer:
|
|
||||||
ldax #buffer
|
|
||||||
stax next_char_ptr
|
|
||||||
ldax #buffer_length
|
|
||||||
stax buff_length
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
getc:
|
|
||||||
sta getc_timeout_seconds
|
|
||||||
|
|
||||||
clc
|
|
||||||
lda $dc09 ;time of day clock: seconds (in BCD)
|
|
||||||
sed
|
|
||||||
adc getc_timeout_seconds
|
|
||||||
cmp #$60
|
|
||||||
bcc @timeout_set
|
|
||||||
sec
|
|
||||||
sbc #$60
|
|
||||||
@timeout_set:
|
|
||||||
cld
|
|
||||||
sta getc_timeout_end
|
|
||||||
|
|
||||||
@poll_loop:
|
|
||||||
jsr ip65_process
|
|
||||||
jsr next_char
|
|
||||||
bcs @no_char
|
|
||||||
rts ;done!
|
|
||||||
@no_char:
|
|
||||||
lda $dc09 ;time of day clock: seconds
|
|
||||||
cmp getc_timeout_end
|
|
||||||
bne @poll_loop
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
next_char:
|
|
||||||
lda buff_length
|
|
||||||
bne @not_eof
|
|
||||||
lda buff_length+1
|
|
||||||
bne @not_eof
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
@not_eof:
|
|
||||||
next_char_ptr=*+1
|
|
||||||
lda $ffff
|
|
||||||
pha
|
|
||||||
inc next_char_ptr
|
|
||||||
bne :+
|
|
||||||
inc next_char_ptr+1
|
|
||||||
:
|
|
||||||
sec
|
|
||||||
lda buff_length
|
|
||||||
sbc #1
|
|
||||||
sta buff_length
|
|
||||||
lda buff_length+1
|
|
||||||
sbc #0
|
|
||||||
sta buff_length+1
|
|
||||||
pla
|
|
||||||
clc
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
buffer:
|
|
||||||
.byte "this is a test1!",13
|
|
||||||
.byte "this is a test2!",13
|
|
||||||
.byte "this is a test3!",13
|
|
||||||
.byte "this is a test4!",13
|
|
||||||
.byte "this is a test5!",13
|
|
||||||
.byte "this is a test6!",13
|
|
||||||
.byte "this is a test7!",13
|
|
||||||
.byte "this is a test8!",13
|
|
||||||
.byte "this is a test9!",13
|
|
||||||
.byte "this is a test10!",13
|
|
||||||
.byte "this is a test1@",13
|
|
||||||
.byte "this is a test2@",13
|
|
||||||
.byte "this is a test3@",13
|
|
||||||
.byte "this is a test4@",13
|
|
||||||
.byte "this is a test5@",13
|
|
||||||
.byte "this is a test6@",13
|
|
||||||
.byte "this is a test7@",13
|
|
||||||
.byte "this is a test8@",13
|
|
||||||
.byte "this is a test9@",13
|
|
||||||
.byte "this is a test10@",13
|
|
||||||
.byte "this is a test1*",13
|
|
||||||
.byte "this is a test2*",13
|
|
||||||
.byte "this is a test3*",13
|
|
||||||
.byte "this is a test4*",13
|
|
||||||
.byte "this is a test5*",13
|
|
||||||
.byte "this is a test6*",13
|
|
||||||
.byte "this is a test7*",13
|
|
||||||
.byte "this is a test8*",13
|
|
||||||
.byte "this is a test9*",13
|
|
||||||
.byte "this is a test10*",13
|
|
||||||
|
|
||||||
buffer_length=*-buffer
|
|
||||||
|
|
||||||
.bss
|
|
||||||
getc_timeout_end: .res 1
|
|
||||||
getc_timeout_seconds: .res 1
|
|
||||||
buff_length: .res 2
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR test_getc.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
@ -10,38 +10,20 @@
|
|||||||
.import parser_skip_next
|
.import parser_skip_next
|
||||||
.importzp copy_src
|
.importzp copy_src
|
||||||
.importzp copy_dest
|
.importzp copy_dest
|
||||||
.import url_ip
|
.import url_ip
|
||||||
.import url_port
|
.import url_port
|
||||||
.import url_selector
|
.import url_selector
|
||||||
.import url_resource_type
|
.import url_resource_type
|
||||||
.import url_parse
|
.import url_parse
|
||||||
.import url_download
|
.import url_download
|
||||||
.import url_download_buffer
|
.import url_download_buffer
|
||||||
.import url_download_buffer_length
|
.import url_download_buffer_length
|
||||||
|
|
||||||
temp_buff=copy_dest
|
temp_buff=copy_dest
|
||||||
|
|
||||||
.bss
|
|
||||||
|
|
||||||
string_offset: .res 1
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
selector_ptr: .res 2
|
|
||||||
temp_url_ptr: .res 2
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -55,7 +37,7 @@ init:
|
|||||||
|
|
||||||
ldax #url_2
|
ldax #url_2
|
||||||
; jsr test_url_download
|
; jsr test_url_download
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
test_url_download:
|
test_url_download:
|
||||||
@ -89,13 +71,12 @@ test_url_download:
|
|||||||
@done:
|
@done:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
wait_key:
|
wait_key:
|
||||||
ldax #press_a_key
|
ldax #press_a_key
|
||||||
jsr print
|
jsr print
|
||||||
jmp get_key
|
jmp get_key
|
||||||
|
|
||||||
|
|
||||||
print_tag_contents:
|
print_tag_contents:
|
||||||
stax temp_buff
|
stax temp_buff
|
||||||
lda #0
|
lda #0
|
||||||
@ -114,7 +95,10 @@ print_tag_contents:
|
|||||||
@done:
|
@done:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.data
|
|
||||||
|
.data
|
||||||
|
|
||||||
|
|
||||||
title:
|
title:
|
||||||
.byte "<title>",0
|
.byte "<title>",0
|
||||||
|
|
||||||
@ -126,7 +110,13 @@ url_2:
|
|||||||
downloading: .asciiz "DOWNLOADING "
|
downloading: .asciiz "DOWNLOADING "
|
||||||
press_a_key: .byte "PRESS ANY KEY TO CONTINUE",13,0
|
press_a_key: .byte "PRESS ANY KEY TO CONTINUE",13,0
|
||||||
|
|
||||||
.bss
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
string_offset: .res 1
|
||||||
|
selector_ptr: .res 2
|
||||||
|
temp_url_ptr: .res 2
|
||||||
|
|
||||||
dl_buffer_length=8092
|
dl_buffer_length=8092
|
||||||
dl_buffer: .res dl_buffer_length
|
dl_buffer: .res dl_buffer_length
|
||||||
|
|
||||||
|
74
test/httpd.s
74
test/httpd.s
@ -21,25 +21,31 @@
|
|||||||
.macro stax arg
|
.macro stax arg
|
||||||
sta arg
|
sta arg
|
||||||
stx 1+(arg)
|
stx 1+(arg)
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
print_a = $ffd2
|
print_a = $ffd2
|
||||||
|
|
||||||
.macro cout arg
|
.macro cout arg
|
||||||
lda arg
|
lda arg
|
||||||
jsr print_a
|
jsr print_a
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
|
||||||
.zeropage
|
.zeropage
|
||||||
|
|
||||||
|
|
||||||
temp_ptr: .res 2
|
temp_ptr: .res 2
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
kipper_param_buffer: .res $20
|
|
||||||
|
|
||||||
|
kipper_param_buffer: .res $20
|
||||||
block_number: .res $0
|
block_number: .res $0
|
||||||
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
.macro print arg
|
.macro print arg
|
||||||
ldax arg
|
ldax arg
|
||||||
@ -57,37 +63,23 @@ print_a = $ffd2
|
|||||||
jsr KPR_DISPATCH_VECTOR
|
jsr KPR_DISPATCH_VECTOR
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
|
|
||||||
;look for KIPPER signature at location pointed at by AX
|
;look for KIPPER signature at location pointed at by AX
|
||||||
look_for_signature:
|
look_for_signature:
|
||||||
stax temp_ptr
|
stax temp_ptr
|
||||||
ldy #5
|
ldy #5
|
||||||
@check_one_byte:
|
@check_one_byte:
|
||||||
lda (temp_ptr),y
|
lda (temp_ptr),y
|
||||||
cmp kipper_signature,y
|
cmp kipper_signature,y
|
||||||
bne @bad_match
|
bne @bad_match
|
||||||
dey
|
dey
|
||||||
bpl@check_one_byte
|
bpl@check_one_byte
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
@bad_match:
|
@bad_match:
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
init:
|
init:
|
||||||
|
|
||||||
|
|
||||||
ldax #KPR_CART_SIGNATURE ;where signature should be in cartridge
|
ldax #KPR_CART_SIGNATURE ;where signature should be in cartridge
|
||||||
jsr look_for_signature
|
jsr look_for_signature
|
||||||
@ -105,19 +97,18 @@ init:
|
|||||||
sta $4000
|
sta $4000
|
||||||
ldax #print_vars
|
ldax #print_vars
|
||||||
stax $4001
|
stax $4001
|
||||||
|
|
||||||
|
|
||||||
ldy #KPR_INITIALIZE
|
ldy #KPR_INITIALIZE
|
||||||
jsr KPR_DISPATCH_VECTOR
|
jsr KPR_DISPATCH_VECTOR
|
||||||
bcc :+
|
bcc :+
|
||||||
print #failed
|
print #failed
|
||||||
jsr print_errorcode
|
jsr print_errorcode
|
||||||
jmp bad_boot
|
jmp bad_boot
|
||||||
:
|
:
|
||||||
|
|
||||||
print #ok
|
print #ok
|
||||||
print_cr
|
print_cr
|
||||||
|
|
||||||
call #KPR_PRINT_IP_CONFIG
|
call #KPR_PRINT_IP_CONFIG
|
||||||
print #listening
|
print #listening
|
||||||
ldax #httpd_callback
|
ldax #httpd_callback
|
||||||
@ -125,10 +116,9 @@ init:
|
|||||||
call #KPR_HTTPD_START
|
call #KPR_HTTPD_START
|
||||||
jsr print_errorcode
|
jsr print_errorcode
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
print_vars:
|
print_vars:
|
||||||
|
|
||||||
lda #'h'
|
lda #'h'
|
||||||
call #KPR_HTTPD_GET_VAR_VALUE
|
call #KPR_HTTPD_GET_VAR_VALUE
|
||||||
bcs :+
|
bcs :+
|
||||||
@ -139,7 +129,7 @@ print_vars:
|
|||||||
bcs :+
|
bcs :+
|
||||||
call #KPR_PRINT_ASCIIZ
|
call #KPR_PRINT_ASCIIZ
|
||||||
print_cr
|
print_cr
|
||||||
:
|
:
|
||||||
rts
|
rts
|
||||||
bad_boot:
|
bad_boot:
|
||||||
print #press_a_key_to_continue
|
print #press_a_key_to_continue
|
||||||
@ -147,7 +137,6 @@ restart:
|
|||||||
jsr get_key
|
jsr get_key
|
||||||
jmp $fce2 ;do a cold start
|
jmp $fce2 ;do a cold start
|
||||||
|
|
||||||
|
|
||||||
print_errorcode:
|
print_errorcode:
|
||||||
print #error_code
|
print #error_code
|
||||||
call #KPR_GET_LAST_ERROR
|
call #KPR_GET_LAST_ERROR
|
||||||
@ -163,7 +152,7 @@ get_key:
|
|||||||
cmp #0
|
cmp #0
|
||||||
beq get_key
|
beq get_key
|
||||||
rts
|
rts
|
||||||
|
|
||||||
kipper_signature_not_found:
|
kipper_signature_not_found:
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
@ -180,9 +169,10 @@ httpd_callback:
|
|||||||
ldy #2 ;text/html
|
ldy #2 ;text/html
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
kipper_signature:
|
kipper_signature:
|
||||||
.byte "KIPPER" ; API signature
|
.byte "KIPPER" ; API signature
|
||||||
@ -207,6 +197,8 @@ said:
|
|||||||
html:
|
html:
|
||||||
.byte "<h1>hello world</h1>%?mMessage recorded as '%$h:%$m'%.<form>Your Handle:<input name=h type=text length=20 value='%$h'><br>Your Message: <input type=text lengh=60 name='m'><br><input type=submit></form><br>",0
|
.byte "<h1>hello world</h1>%?mMessage recorded as '%$h:%$m'%.<form>Your Handle:<input name=h type=text length=20 value='%$h'><br>Your Message: <input type=text lengh=60 name='m'><br><input type=submit></form><br>",0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR test_httpd.s --
|
;-- LICENSE FOR test_httpd.s --
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
; The contents of this file are subject to the Mozilla Public License
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
; Version 1.1 (the "License"); you may not use this file except in
|
||||||
|
@ -11,25 +11,8 @@
|
|||||||
.import http_get_value
|
.import http_get_value
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
temp_ax: .res 2
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -39,16 +22,16 @@ init:
|
|||||||
ldax #query_1
|
ldax #query_1
|
||||||
jsr test_querystring
|
jsr test_querystring
|
||||||
ldax #query_2
|
ldax #query_2
|
||||||
jsr test_querystring
|
jsr test_querystring
|
||||||
ldax #query_3
|
ldax #query_3
|
||||||
jsr test_querystring
|
jsr test_querystring
|
||||||
jsr get_key
|
jsr get_key
|
||||||
ldax #query_4
|
ldax #query_4
|
||||||
jsr test_querystring
|
jsr test_querystring
|
||||||
ldax #query_5
|
ldax #query_5
|
||||||
jsr test_querystring
|
jsr test_querystring
|
||||||
ldax #query_6
|
ldax #query_6
|
||||||
jsr test_querystring
|
jsr test_querystring
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -58,7 +41,7 @@ test_querystring:
|
|||||||
jsr print_cr
|
jsr print_cr
|
||||||
ldax temp_ax
|
ldax temp_ax
|
||||||
jsr http_parse_request
|
jsr http_parse_request
|
||||||
|
|
||||||
lda #1
|
lda #1
|
||||||
jsr print_var
|
jsr print_var
|
||||||
lda #2
|
lda #2
|
||||||
@ -92,7 +75,7 @@ print_var:
|
|||||||
@found_var_value:
|
@found_var_value:
|
||||||
jsr print_ascii_as_native
|
jsr print_ascii_as_native
|
||||||
jmp print_cr
|
jmp print_cr
|
||||||
|
|
||||||
@print_path:
|
@print_path:
|
||||||
ldax #path
|
ldax #path
|
||||||
jmp @print_caption
|
jmp @print_caption
|
||||||
@ -102,7 +85,16 @@ print_var:
|
|||||||
jsr print_ascii_as_native
|
jsr print_ascii_as_native
|
||||||
jmp @print_equals
|
jmp @print_equals
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
|
||||||
|
temp_ax: .res 2
|
||||||
|
|
||||||
|
|
||||||
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
path: .byte "path",0
|
path: .byte "path",0
|
||||||
method: .byte "method",0
|
method: .byte "method",0
|
||||||
|
|
||||||
@ -121,7 +113,6 @@ query_6:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR test_parse_querystring.s --
|
;-- LICENSE FOR test_parse_querystring.s --
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
; The contents of this file are subject to the Mozilla Public License
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
; Version 1.1 (the "License"); you may not use this file except in
|
||||||
|
@ -10,35 +10,17 @@
|
|||||||
.import parser_skip_next
|
.import parser_skip_next
|
||||||
.importzp copy_src
|
.importzp copy_src
|
||||||
.importzp copy_dest
|
.importzp copy_dest
|
||||||
.import url_ip
|
.import url_ip
|
||||||
.import url_port
|
.import url_port
|
||||||
.import url_selector
|
.import url_selector
|
||||||
.import url_resource_type
|
.import url_resource_type
|
||||||
.import url_parse
|
.import url_parse
|
||||||
|
|
||||||
temp_buff=copy_dest
|
temp_buff=copy_dest
|
||||||
|
|
||||||
.bss
|
|
||||||
|
|
||||||
string_offset: .res 1
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
selector_ptr: .res 2
|
|
||||||
temp_url_ptr: .res 2
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -50,7 +32,6 @@ init:
|
|||||||
ldax #url_1
|
ldax #url_1
|
||||||
jsr test_url_parse
|
jsr test_url_parse
|
||||||
jsr wait_key
|
jsr wait_key
|
||||||
|
|
||||||
|
|
||||||
ldax #url_2
|
ldax #url_2
|
||||||
jsr test_url_parse
|
jsr test_url_parse
|
||||||
@ -59,7 +40,7 @@ init:
|
|||||||
ldax #url_4
|
ldax #url_4
|
||||||
jsr test_url_parse
|
jsr test_url_parse
|
||||||
jsr wait_key
|
jsr wait_key
|
||||||
|
|
||||||
ldax #url_5
|
ldax #url_5
|
||||||
jsr test_url_parse
|
jsr test_url_parse
|
||||||
ldax #url_6
|
ldax #url_6
|
||||||
@ -69,7 +50,7 @@ init:
|
|||||||
ldax #url_8
|
ldax #url_8
|
||||||
jsr test_url_parse
|
jsr test_url_parse
|
||||||
jsr wait_key
|
jsr wait_key
|
||||||
|
|
||||||
ldax #url_9
|
ldax #url_9
|
||||||
jsr test_url_parse
|
jsr test_url_parse
|
||||||
ldax #url_a
|
ldax #url_a
|
||||||
@ -78,9 +59,8 @@ init:
|
|||||||
jsr test_url_parse
|
jsr test_url_parse
|
||||||
ldax #url_c
|
ldax #url_c
|
||||||
jsr test_url_parse
|
jsr test_url_parse
|
||||||
|
|
||||||
jsr wait_key
|
jsr wait_key
|
||||||
|
|
||||||
|
|
||||||
ldax #atom_file
|
ldax #atom_file
|
||||||
jsr parser_init
|
jsr parser_init
|
||||||
@ -89,14 +69,14 @@ init:
|
|||||||
; jsr parser_skip_next
|
; jsr parser_skip_next
|
||||||
; bcs @done
|
; bcs @done
|
||||||
|
|
||||||
@next_title:
|
@next_title:
|
||||||
ldax #title
|
ldax #title
|
||||||
jsr parser_skip_next
|
jsr parser_skip_next
|
||||||
bcs @done
|
bcs @done
|
||||||
|
|
||||||
jsr print_tag_contents
|
jsr print_tag_contents
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
|
|
||||||
jmp @next_title
|
jmp @next_title
|
||||||
@done:
|
@done:
|
||||||
rts
|
rts
|
||||||
@ -157,9 +137,19 @@ wait_key:
|
|||||||
ldax #press_a_key
|
ldax #press_a_key
|
||||||
jsr print
|
jsr print
|
||||||
jmp get_key
|
jmp get_key
|
||||||
|
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
|
||||||
|
string_offset: .res 1
|
||||||
|
selector_ptr: .res 2
|
||||||
|
temp_url_ptr: .res 2
|
||||||
|
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
|
|
||||||
entry:
|
entry:
|
||||||
.byte "<entry>",0
|
.byte "<entry>",0
|
||||||
title:
|
title:
|
||||||
@ -212,10 +202,10 @@ press_a_key: .byte "PRESS ANY KEY TO CONTINUE",13,0
|
|||||||
atom_file:
|
atom_file:
|
||||||
;.incbin "atom_test.xml"
|
;.incbin "atom_test.xml"
|
||||||
|
|
||||||
|
|
||||||
.byte 0
|
.byte 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR test_parser.s --
|
;-- LICENSE FOR test_parser.s --
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
; The contents of this file are subject to the Mozilla Public License
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
; Version 1.1 (the "License"); you may not use this file except in
|
||||||
|
56
test/ping.s
56
test/ping.s
@ -1,42 +1,20 @@
|
|||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
.include "../inc/commonprint.i"
|
.include "../inc/commonprint.i"
|
||||||
.include "../inc/net.i"
|
.include "../inc/net.i"
|
||||||
|
|
||||||
.import exit_to_basic
|
.import exit_to_basic
|
||||||
|
|
||||||
.import cfg_get_configuration_ptr
|
.import cfg_get_configuration_ptr
|
||||||
.import copymem
|
.import copymem
|
||||||
.importzp copy_src
|
.importzp copy_src
|
||||||
.importzp copy_dest
|
.importzp copy_dest
|
||||||
|
|
||||||
.import icmp_echo_ip
|
.import icmp_echo_ip
|
||||||
.import icmp_ping
|
.import icmp_ping
|
||||||
|
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -46,17 +24,17 @@ init:
|
|||||||
init_ip_via_dhcp
|
init_ip_via_dhcp
|
||||||
jsr print_ip_config
|
jsr print_ip_config
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
|
|
||||||
;our default gateway is probably a safe thing to ping
|
;our default gateway is probably a safe thing to ping
|
||||||
ldx #$3
|
ldx #$3
|
||||||
:
|
:
|
||||||
lda cfg_gateway,x
|
lda cfg_gateway,x
|
||||||
sta icmp_echo_ip,x
|
sta icmp_echo_ip,x
|
||||||
dex
|
dex
|
||||||
bpl :-
|
bpl :-
|
||||||
ldax #pinging
|
ldax #pinging
|
||||||
jsr print
|
jsr print
|
||||||
|
|
||||||
ldax #icmp_echo_ip
|
ldax #icmp_echo_ip
|
||||||
jsr print_dotted_quad
|
jsr print_dotted_quad
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
@ -68,17 +46,25 @@ init:
|
|||||||
rts
|
rts
|
||||||
@error:
|
@error:
|
||||||
jmp print_errorcode
|
jmp print_errorcode
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
ms: .byte " MS",13,0
|
ms: .byte " MS",13,0
|
||||||
pinging: .byte "PINGING ",0
|
pinging: .byte "PINGING ",0
|
||||||
.bss
|
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
|
||||||
block_number: .res 1
|
block_number: .res 1
|
||||||
block_length: .res 2
|
block_length: .res 2
|
||||||
buffer1: .res 256
|
buffer1: .res 256
|
||||||
buffer2: .res 256
|
buffer2: .res 256
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR test_ping.s --
|
;-- LICENSE FOR test_ping.s --
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
; The contents of this file are subject to the Mozilla Public License
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
; Version 1.1 (the "License"); you may not use this file except in
|
||||||
|
51
test/sntp.s
51
test/sntp.s
@ -1,7 +1,7 @@
|
|||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
.include "../inc/commonprint.i"
|
.include "../inc/commonprint.i"
|
||||||
.include "../inc/net.i"
|
.include "../inc/net.i"
|
||||||
|
|
||||||
.import exit_to_basic
|
.import exit_to_basic
|
||||||
.import cfg_get_configuration_ptr
|
.import cfg_get_configuration_ptr
|
||||||
.import dns_set_hostname
|
.import dns_set_hostname
|
||||||
@ -11,36 +11,17 @@
|
|||||||
.import sntp_ip
|
.import sntp_ip
|
||||||
.import sntp_utc_timestamp
|
.import sntp_utc_timestamp
|
||||||
.import sntp_get_time
|
.import sntp_get_time
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
lda #14
|
lda #14
|
||||||
jsr print_a ;switch to lower case
|
jsr print_a ;switch to lower case
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
init_ip_via_dhcp
|
init_ip_via_dhcp
|
||||||
jsr print_ip_config
|
jsr print_ip_config
|
||||||
|
|
||||||
ldax #time_server_msg
|
ldax #time_server_msg
|
||||||
jsr print
|
jsr print
|
||||||
ldax #time_server_host
|
ldax #time_server_host
|
||||||
@ -53,11 +34,10 @@ init:
|
|||||||
bcs @dns_error
|
bcs @dns_error
|
||||||
ldx #3 ; set destination address
|
ldx #3 ; set destination address
|
||||||
: lda dns_ip,x
|
: lda dns_ip,x
|
||||||
sta sntp_ip,x
|
sta sntp_ip,x
|
||||||
dex
|
dex
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
|
|
||||||
ldax #sending_query
|
ldax #sending_query
|
||||||
jsr print
|
jsr print
|
||||||
ldax #sntp_ip
|
ldax #sntp_ip
|
||||||
@ -69,23 +49,22 @@ init:
|
|||||||
jmp @print_error
|
jmp @print_error
|
||||||
@ok:
|
@ok:
|
||||||
ldy #3
|
ldy #3
|
||||||
:
|
:
|
||||||
lda sntp_utc_timestamp,y
|
lda sntp_utc_timestamp,y
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
dey
|
dey
|
||||||
bpl :-
|
bpl :-
|
||||||
jmp exit_to_basic
|
jmp exit_to_basic
|
||||||
|
|
||||||
@dns_error:
|
@dns_error:
|
||||||
ldax #dns_error
|
ldax #dns_error
|
||||||
@print_error:
|
@print_error:
|
||||||
jsr print
|
jsr print
|
||||||
jsr print_errorcode
|
jsr print_errorcode
|
||||||
jmp exit_to_basic
|
jmp exit_to_basic
|
||||||
|
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
time_server_msg:
|
time_server_msg:
|
||||||
@ -95,20 +74,18 @@ time_server_host:
|
|||||||
.byte "jamtronix.com",0
|
.byte "jamtronix.com",0
|
||||||
; .byte "150.101.112.134",0
|
; .byte "150.101.112.134",0
|
||||||
.byte "0.POOL.SNTP.ORG",0
|
.byte "0.POOL.SNTP.ORG",0
|
||||||
|
|
||||||
sending_query:
|
sending_query:
|
||||||
.byte "SENDING SNTP QUERY TO ",0
|
.byte "SENDING SNTP QUERY TO ",0
|
||||||
sntp_error:
|
sntp_error:
|
||||||
.byte "ERROR DURING SNTP QUERY",13,0
|
.byte "ERROR DURING SNTP QUERY",13,0
|
||||||
|
|
||||||
dns_error:
|
dns_error:
|
||||||
.byte "ERROR RESOLVING HOSTNAME",13,0
|
.byte "ERROR RESOLVING HOSTNAME",13,0
|
||||||
|
|
||||||
divs:
|
divs:
|
||||||
.byte $02,$30,$00,$00
|
.byte $02,$30,$00,$00
|
||||||
.byte $05,$00,$00,$00
|
.byte $05,$00,$00,$00
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR test_sntp.s --
|
;-- LICENSE FOR test_sntp.s --
|
||||||
|
164
test/tcp.s
164
test/tcp.s
@ -1,12 +1,12 @@
|
|||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
.include "../inc/commonprint.i"
|
.include "../inc/commonprint.i"
|
||||||
.include "../inc/net.i"
|
.include "../inc/net.i"
|
||||||
|
|
||||||
.import exit_to_basic
|
.import exit_to_basic
|
||||||
.import ascii_to_native
|
.import ascii_to_native
|
||||||
.import parse_dotted_quad
|
.import parse_dotted_quad
|
||||||
.import dotted_quad_value
|
.import dotted_quad_value
|
||||||
|
|
||||||
.import tcp_listen
|
.import tcp_listen
|
||||||
.import tcp_callback
|
.import tcp_callback
|
||||||
.import ip65_random_word
|
.import ip65_random_word
|
||||||
@ -20,12 +20,6 @@
|
|||||||
|
|
||||||
.import tcp_send
|
.import tcp_send
|
||||||
.import tcp_send_data_len
|
.import tcp_send_data_len
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
|
|
||||||
|
|
||||||
.importzp acc32
|
.importzp acc32
|
||||||
.importzp op32
|
.importzp op32
|
||||||
@ -39,39 +33,9 @@
|
|||||||
|
|
||||||
.import sub_16_16
|
.import sub_16_16
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
|
|
||||||
.addr __CODE_LOAD__-$11 ; Start address
|
|
||||||
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; Size
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
.bss
|
|
||||||
cxn_closed: .res 1
|
|
||||||
byte_counter: .res 1
|
|
||||||
|
|
||||||
.data
|
|
||||||
get_next_byte:
|
|
||||||
lda $ffff
|
|
||||||
rts
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -101,8 +65,7 @@ init:
|
|||||||
stax acc16
|
stax acc16
|
||||||
ldax #$100
|
ldax #$100
|
||||||
jsr test_sub_16_16
|
jsr test_sub_16_16
|
||||||
|
|
||||||
|
|
||||||
ldax #number1
|
ldax #number1
|
||||||
stax acc32
|
stax acc32
|
||||||
stax op32
|
stax op32
|
||||||
@ -133,12 +96,10 @@ init:
|
|||||||
ldax #$1235
|
ldax #$1235
|
||||||
jsr test_cmp_16_16
|
jsr test_cmp_16_16
|
||||||
|
|
||||||
|
|
||||||
ldax #$1234
|
ldax #$1234
|
||||||
stax acc16
|
stax acc16
|
||||||
ldax #$2234
|
ldax #$2234
|
||||||
jsr test_cmp_16_16
|
jsr test_cmp_16_16
|
||||||
|
|
||||||
|
|
||||||
ldax #$0000
|
ldax #$0000
|
||||||
stax acc16
|
stax acc16
|
||||||
@ -148,16 +109,12 @@ init:
|
|||||||
stax acc16
|
stax acc16
|
||||||
jsr test_cmp_16_16
|
jsr test_cmp_16_16
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ldax #number1
|
ldax #number1
|
||||||
stax acc32
|
stax acc32
|
||||||
ldax #number2
|
ldax #number2
|
||||||
stax op32
|
stax op32
|
||||||
jsr test_add_32_32
|
jsr test_add_32_32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ldax #number3
|
ldax #number3
|
||||||
stax acc32
|
stax acc32
|
||||||
ldax #number4
|
ldax #number4
|
||||||
@ -188,7 +145,6 @@ init:
|
|||||||
stax op32
|
stax op32
|
||||||
jsr test_add_32_32
|
jsr test_add_32_32
|
||||||
|
|
||||||
|
|
||||||
ldax #number13
|
ldax #number13
|
||||||
stax acc32
|
stax acc32
|
||||||
ldax #$1234
|
ldax #$1234
|
||||||
@ -214,16 +170,14 @@ init:
|
|||||||
ldax #$158
|
ldax #$158
|
||||||
jsr test_add_16_32
|
jsr test_add_16_32
|
||||||
|
|
||||||
|
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
init_ip_via_dhcp
|
init_ip_via_dhcp
|
||||||
jsr print_ip_config
|
jsr print_ip_config
|
||||||
|
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
|
|
||||||
|
jsr print_random_number
|
||||||
jsr print_random_number
|
|
||||||
|
|
||||||
;connect to port 81 - should be rejected
|
;connect to port 81 - should be rejected
|
||||||
|
|
||||||
ldax #tcp_callback_routine
|
ldax #tcp_callback_routine
|
||||||
@ -232,7 +186,7 @@ init:
|
|||||||
stax tcp_connect_ip
|
stax tcp_connect_ip
|
||||||
ldax tcp_dest_ip+2
|
ldax tcp_dest_ip+2
|
||||||
stax tcp_connect_ip+2
|
stax tcp_connect_ip+2
|
||||||
|
|
||||||
ldax #81
|
ldax #81
|
||||||
jsr tcp_connect
|
jsr tcp_connect
|
||||||
jsr check_for_error
|
jsr check_for_error
|
||||||
@ -242,7 +196,7 @@ init:
|
|||||||
ldax #http_get_msg
|
ldax #http_get_msg
|
||||||
jsr tcp_send
|
jsr tcp_send
|
||||||
jsr check_for_error
|
jsr check_for_error
|
||||||
|
|
||||||
;now try to connect to port 80 - should be accepted
|
;now try to connect to port 80 - should be accepted
|
||||||
|
|
||||||
ldax #tcp_callback_routine
|
ldax #tcp_callback_routine
|
||||||
@ -251,8 +205,7 @@ init:
|
|||||||
stax tcp_connect_ip
|
stax tcp_connect_ip
|
||||||
ldax tcp_dest_ip+2
|
ldax tcp_dest_ip+2
|
||||||
stax tcp_connect_ip+2
|
stax tcp_connect_ip+2
|
||||||
|
|
||||||
|
|
||||||
ldax #80
|
ldax #80
|
||||||
jsr tcp_connect
|
jsr tcp_connect
|
||||||
jsr check_for_error
|
jsr check_for_error
|
||||||
@ -272,9 +225,8 @@ init:
|
|||||||
cmp cxn_closed
|
cmp cxn_closed
|
||||||
|
|
||||||
beq @loop_till_end
|
beq @loop_till_end
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
ldax #tcp_callback_routine
|
ldax #tcp_callback_routine
|
||||||
stax tcp_callback
|
stax tcp_callback
|
||||||
@ -282,13 +234,11 @@ init:
|
|||||||
stax tcp_connect_ip
|
stax tcp_connect_ip
|
||||||
ldax tcp_dest_ip+2
|
ldax tcp_dest_ip+2
|
||||||
stax tcp_connect_ip+2
|
stax tcp_connect_ip+2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ldax #80
|
ldax #80
|
||||||
jsr tcp_connect
|
jsr tcp_connect
|
||||||
jsr check_for_error
|
jsr check_for_error
|
||||||
|
|
||||||
ldax #4
|
ldax #4
|
||||||
stax tcp_send_data_len
|
stax tcp_send_data_len
|
||||||
ldax #http_get_msg
|
ldax #http_get_msg
|
||||||
@ -300,41 +250,36 @@ init:
|
|||||||
jsr tcp_send
|
jsr tcp_send
|
||||||
jsr check_for_error
|
jsr check_for_error
|
||||||
|
|
||||||
|
|
||||||
ldax #looping
|
ldax #looping
|
||||||
jsr print
|
jsr print
|
||||||
@loop_forever:
|
@loop_forever:
|
||||||
jsr ip65_process
|
jsr ip65_process
|
||||||
jmp @loop_forever
|
jmp @loop_forever
|
||||||
rts
|
rts
|
||||||
|
|
||||||
tcp_callback_routine:
|
tcp_callback_routine:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lda tcp_inbound_data_length
|
lda tcp_inbound_data_length
|
||||||
cmp #$ff
|
cmp #$ff
|
||||||
bne @not_end_of_file
|
bne @not_end_of_file
|
||||||
lda #1
|
lda #1
|
||||||
sta cxn_closed
|
sta cxn_closed
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@not_end_of_file:
|
@not_end_of_file:
|
||||||
lda #14
|
lda #14
|
||||||
jsr print_a ;switch to lower case
|
jsr print_a ;switch to lower case
|
||||||
|
|
||||||
|
|
||||||
ldax tcp_inbound_data_ptr
|
ldax tcp_inbound_data_ptr
|
||||||
stax get_next_byte+1
|
stax get_next_byte+1
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta byte_counter
|
sta byte_counter
|
||||||
sta byte_counter+1
|
sta byte_counter+1
|
||||||
|
|
||||||
@print_one_byte:
|
@print_one_byte:
|
||||||
jsr get_next_byte
|
jsr get_next_byte
|
||||||
jsr ascii_to_native
|
jsr ascii_to_native
|
||||||
|
|
||||||
jsr print_a
|
jsr print_a
|
||||||
inc get_next_byte+1
|
inc get_next_byte+1
|
||||||
bne :+
|
bne :+
|
||||||
@ -350,10 +295,8 @@ tcp_callback_routine:
|
|||||||
ldax tcp_inbound_data_length
|
ldax tcp_inbound_data_length
|
||||||
jsr cmp_16_16
|
jsr cmp_16_16
|
||||||
bne @print_one_byte
|
bne @print_one_byte
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
check_for_error:
|
check_for_error:
|
||||||
lda ip65_error
|
lda ip65_error
|
||||||
@ -365,7 +308,7 @@ check_for_error:
|
|||||||
jsr print_cr
|
jsr print_cr
|
||||||
lda #0
|
lda #0
|
||||||
sta ip65_error
|
sta ip65_error
|
||||||
@exit:
|
@exit:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
print_random_number:
|
print_random_number:
|
||||||
@ -385,7 +328,7 @@ test_add_32_32:
|
|||||||
jsr print_hex
|
jsr print_hex
|
||||||
dey
|
dey
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
lda #'+'
|
lda #'+'
|
||||||
jsr print_a
|
jsr print_a
|
||||||
ldy #3
|
ldy #3
|
||||||
@ -394,12 +337,12 @@ test_add_32_32:
|
|||||||
jsr print_hex
|
jsr print_hex
|
||||||
dey
|
dey
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
lda #'='
|
lda #'='
|
||||||
jsr print_a
|
jsr print_a
|
||||||
jsr add_32_32
|
jsr add_32_32
|
||||||
|
|
||||||
ldy #3
|
ldy #3
|
||||||
:
|
:
|
||||||
lda (acc32),y
|
lda (acc32),y
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
@ -408,8 +351,6 @@ test_add_32_32:
|
|||||||
jsr print_cr
|
jsr print_cr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;assumes acc32 & op32 already set
|
;assumes acc32 & op32 already set
|
||||||
test_cmp_32_32:
|
test_cmp_32_32:
|
||||||
ldy #3
|
ldy #3
|
||||||
@ -448,14 +389,14 @@ test_cmp_16_16:
|
|||||||
jsr print_hex
|
jsr print_hex
|
||||||
lda acc16
|
lda acc16
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
|
|
||||||
lda #'='
|
lda #'='
|
||||||
jsr print_a
|
jsr print_a
|
||||||
lda temp_ax+1
|
lda temp_ax+1
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
lda temp_ax
|
lda temp_ax
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
|
|
||||||
lda #':'
|
lda #':'
|
||||||
jsr print_a
|
jsr print_a
|
||||||
ldax temp_ax
|
ldax temp_ax
|
||||||
@ -470,17 +411,16 @@ test_cmp_16_16:
|
|||||||
jsr print_cr
|
jsr print_cr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
;assumes acc32 & AX already set
|
;assumes acc32 & AX already set
|
||||||
test_add_16_32:
|
test_add_16_32:
|
||||||
stax temp_ax
|
stax temp_ax
|
||||||
ldy #3
|
ldy #3
|
||||||
:
|
:
|
||||||
lda (acc32),y
|
lda (acc32),y
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
dey
|
dey
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
lda #'+'
|
lda #'+'
|
||||||
jsr print_a
|
jsr print_a
|
||||||
|
|
||||||
@ -494,7 +434,7 @@ test_add_16_32:
|
|||||||
ldax temp_ax
|
ldax temp_ax
|
||||||
jsr add_16_32
|
jsr add_16_32
|
||||||
|
|
||||||
ldy #3
|
ldy #3
|
||||||
:
|
:
|
||||||
lda (acc32),y
|
lda (acc32),y
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
@ -510,12 +450,12 @@ test_mul_8_16:
|
|||||||
jsr print_hex
|
jsr print_hex
|
||||||
lda acc16
|
lda acc16
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
|
|
||||||
lda #'*'
|
lda #'*'
|
||||||
jsr print_a
|
jsr print_a
|
||||||
lda temp_ax
|
lda temp_ax
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
|
|
||||||
lda #'='
|
lda #'='
|
||||||
jsr print_a
|
jsr print_a
|
||||||
lda temp_ax
|
lda temp_ax
|
||||||
@ -527,7 +467,6 @@ test_mul_8_16:
|
|||||||
jsr print_cr
|
jsr print_cr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
;assumes acc16 & AX already set
|
;assumes acc16 & AX already set
|
||||||
test_sub_16_16:
|
test_sub_16_16:
|
||||||
stax temp_ax
|
stax temp_ax
|
||||||
@ -544,12 +483,12 @@ test_sub_16_16:
|
|||||||
jsr print_hex
|
jsr print_hex
|
||||||
lda temp_ax
|
lda temp_ax
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
|
|
||||||
lda #'='
|
lda #'='
|
||||||
jsr print_a
|
jsr print_a
|
||||||
ldax temp_ax
|
ldax temp_ax
|
||||||
jsr sub_16_16
|
jsr sub_16_16
|
||||||
|
|
||||||
lda acc16+1
|
lda acc16+1
|
||||||
jsr print_hex
|
jsr print_hex
|
||||||
lda acc16
|
lda acc16
|
||||||
@ -558,58 +497,56 @@ test_sub_16_16:
|
|||||||
jsr print_cr
|
jsr print_cr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
@error:
|
@error:
|
||||||
ldax #failed_msg
|
ldax #failed_msg
|
||||||
jsr print
|
jsr print
|
||||||
jsr print_cr
|
jsr print_cr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
temp_ax: .res 2
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
|
|
||||||
.data
|
temp_ax: .res 2
|
||||||
|
cxn_closed: .res 1
|
||||||
|
byte_counter: .res 1
|
||||||
|
|
||||||
|
|
||||||
|
.data
|
||||||
|
|
||||||
|
|
||||||
number1:
|
number1:
|
||||||
.byte $1,$2,$3,$f
|
.byte $1,$2,$3,$f
|
||||||
number2:
|
number2:
|
||||||
.byte $10,$20,$30,$f0
|
.byte $10,$20,$30,$f0
|
||||||
number3:
|
number3:
|
||||||
.byte $ff,$ff,$ff,$ff
|
.byte $ff,$ff,$ff,$ff
|
||||||
number4:
|
number4:
|
||||||
.byte $1,$0,$0,$0
|
.byte $1,$0,$0,$0
|
||||||
|
|
||||||
number5:
|
number5:
|
||||||
.byte $ff,$ff,$ff,$ff
|
.byte $ff,$ff,$ff,$ff
|
||||||
number6:
|
number6:
|
||||||
.byte $0,$0,$0,$0
|
.byte $0,$0,$0,$0
|
||||||
number7:
|
number7:
|
||||||
.byte $ff,$ff,$ff,$fe
|
.byte $ff,$ff,$ff,$fe
|
||||||
number8:
|
number8:
|
||||||
.byte $1,$0,$0,$0
|
.byte $1,$0,$0,$0
|
||||||
number9:
|
number9:
|
||||||
.byte $ff,$ff,$ff,$fe
|
.byte $ff,$ff,$ff,$fe
|
||||||
number10:
|
number10:
|
||||||
.byte $5,$0,$0,$0
|
.byte $5,$0,$0,$0
|
||||||
number11:
|
number11:
|
||||||
.byte $ff,$0,$0,$e
|
.byte $ff,$0,$0,$e
|
||||||
number12:
|
number12:
|
||||||
.byte $5,$0,$0,$0
|
.byte $5,$0,$0,$0
|
||||||
|
|
||||||
number13:
|
number13:
|
||||||
.byte $1,$2,$3,$4
|
.byte $1,$2,$3,$4
|
||||||
|
|
||||||
number14:
|
number14:
|
||||||
.byte $ff,$ff,$ff,$ff
|
.byte $ff,$ff,$ff,$ff
|
||||||
|
|
||||||
number15:
|
number15:
|
||||||
.byte $ff,$ff,$00,$00
|
.byte $ff,$ff,$00,$00
|
||||||
|
|
||||||
number16:
|
number16:
|
||||||
.byte $00,$00,$00,$00
|
.byte $00,$00,$00,$00
|
||||||
|
|
||||||
number17:
|
number17:
|
||||||
.byte $5b,$bc,$08,$a9
|
.byte $5b,$bc,$08,$a9
|
||||||
|
|
||||||
@ -618,13 +555,16 @@ tcp_dest_ip:
|
|||||||
.byte 74,207,242,229
|
.byte 74,207,242,229
|
||||||
looping:
|
looping:
|
||||||
.asciiz "LOOPING..."
|
.asciiz "LOOPING..."
|
||||||
|
|
||||||
http_get_msg:
|
http_get_msg:
|
||||||
.byte "GET /blogx/ HTTP/1.0",13,10,13,10
|
.byte "GET /blogx/ HTTP/1.0",13,10,13,10
|
||||||
http_get_msg_end:
|
http_get_msg_end:
|
||||||
http_get_length=http_get_msg_end-http_get_msg
|
http_get_length=http_get_msg_end-http_get_msg
|
||||||
|
|
||||||
|
get_next_byte:
|
||||||
|
lda $ffff
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR test_tcp.s --
|
;-- LICENSE FOR test_tcp.s --
|
||||||
|
64
test/tftp.s
64
test/tftp.s
@ -1,15 +1,14 @@
|
|||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
.include "../inc/commonprint.i"
|
.include "../inc/commonprint.i"
|
||||||
.include "../inc/net.i"
|
.include "../inc/net.i"
|
||||||
|
|
||||||
.import exit_to_basic
|
.import exit_to_basic
|
||||||
|
|
||||||
.import cfg_get_configuration_ptr
|
.import cfg_get_configuration_ptr
|
||||||
.import copymem
|
.import copymem
|
||||||
.importzp copy_src
|
.importzp copy_src
|
||||||
.importzp copy_dest
|
.importzp copy_dest
|
||||||
|
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
.import __CODE_LOAD__
|
||||||
.import __CODE_SIZE__
|
.import __CODE_SIZE__
|
||||||
.import __RODATA_SIZE__
|
.import __RODATA_SIZE__
|
||||||
@ -20,31 +19,10 @@
|
|||||||
.import tftp_ip
|
.import tftp_ip
|
||||||
.import tftp_filesize
|
.import tftp_filesize
|
||||||
.importzp tftp_filename
|
.importzp tftp_filename
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
|
|
||||||
.addr __CODE_LOAD__-$11 ; Start address
|
|
||||||
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; Size
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -65,17 +43,17 @@ init:
|
|||||||
:
|
:
|
||||||
sta tftp_ip,x
|
sta tftp_ip,x
|
||||||
dex
|
dex
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
ldax #sending_via_callback
|
ldax #sending_via_callback
|
||||||
jsr print
|
jsr print
|
||||||
jsr tftp_upload
|
jsr tftp_upload
|
||||||
bcs @error
|
bcs @error
|
||||||
print_ok
|
print_ok
|
||||||
|
|
||||||
ldax #basic_file
|
ldax #basic_file
|
||||||
stax tftp_filename
|
stax tftp_filename
|
||||||
|
|
||||||
ldax #$2000
|
ldax #$2000
|
||||||
stax tftp_filesize
|
stax tftp_filesize
|
||||||
ldax #sending_ram
|
ldax #sending_ram
|
||||||
@ -85,7 +63,7 @@ init:
|
|||||||
print_ok
|
print_ok
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@error:
|
@error:
|
||||||
print_failed
|
print_failed
|
||||||
rts
|
rts
|
||||||
@ -103,28 +81,36 @@ upload_callback:
|
|||||||
bne @next_byte
|
bne @next_byte
|
||||||
cmp #7
|
cmp #7
|
||||||
beq @last_block
|
beq @last_block
|
||||||
ldax #512
|
ldax #512
|
||||||
jmp :+
|
jmp :+
|
||||||
@last_block:
|
@last_block:
|
||||||
ldax #129
|
ldax #129
|
||||||
:
|
:
|
||||||
stax block_length
|
stax block_length
|
||||||
jsr copymem
|
jsr copymem
|
||||||
ldax block_length
|
ldax block_length
|
||||||
rts
|
rts
|
||||||
.rodata
|
|
||||||
|
|
||||||
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
test_file: .byte "TESTFILE.BIN",0
|
test_file: .byte "TESTFILE.BIN",0
|
||||||
basic_file: .byte "CBMBASIC.BIN",0
|
basic_file: .byte "CBMBASIC.BIN",0
|
||||||
sending_via_callback: .byte "SENDING VIA CALLBACK...",0
|
sending_via_callback: .byte "SENDING VIA CALLBACK...",0
|
||||||
sending_ram: .byte "SENDING RAM...",0
|
sending_ram: .byte "SENDING RAM...",0
|
||||||
.bss
|
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
|
||||||
block_number: .res 1
|
block_number: .res 1
|
||||||
block_length: .res 2
|
block_length: .res 2
|
||||||
buffer1: .res 256
|
buffer1: .res 256
|
||||||
buffer2: .res 256
|
buffer2: .res 256
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR testtftp.s --
|
;-- LICENSE FOR testtftp.s --
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
; The contents of this file are subject to the Mozilla Public License
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
; Version 1.1 (the "License"); you may not use this file except in
|
||||||
|
Loading…
Reference in New Issue
Block a user