mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-08-20 02:29:32 +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 {
|
||||||
|
ZEROPAGE: load = ZP, type = zp;
|
||||||
|
IP65ZP: load = IP65ZP, type = zp, optional = yes;
|
||||||
EXEHDR: load = HEADER, type = ro;
|
EXEHDR: load = HEADER, type = ro;
|
||||||
STARTUP: load = RAM,run=RAM, type = ro, define = yes, optional=yes;
|
STARTUP: load = RAM, type = ro, define = yes;
|
||||||
CODE: load = RAM, run=RAM, type = ro, define = yes;
|
CODE: load = RAM, type = ro;
|
||||||
RODATA: load = RAM, run=RAM, type = ro , define = yes;
|
RODATA: load = RAM, type = ro;
|
||||||
IP65_DEFAULTS: load = RAM, run=RAM, type = ro , define = yes;
|
DATA: load = RAM, type = rw;
|
||||||
DATA: load = RAM, run=RAM, type = rw , define = yes;
|
SELF_MODIFIED_CODE: load = RAM, type = rw, optional = yes;
|
||||||
PAGE3: load = RAM,run=PAGE3, type = rw, define = yes, optional=yes;
|
IP65_DEFAULTS: load = RAM, type = rw;
|
||||||
HTTP_VARS: load = RAM, run=RAM, type = rw, optional=yes;
|
BSS: load = RAM, type = bss, define = yes;
|
||||||
TCP_VARS: load = RAM, type = bss, optional=yes;
|
APP_SCRATCH: load = RAM, type = bss, optional = yes;
|
||||||
APP_SCRATCH: load = RAM, type = bss , optional=yes;
|
TCP_VARS: load = RAM, type = bss, optional = yes;
|
||||||
BSS: load=RAM, type = bss, define = yes;
|
HTTP_VARS: load = RAM, type = bss, optional = yes;
|
||||||
ZEROPAGE: load = ZP, type = zp , optional=yes;
|
|
||||||
IP65ZP: load = IP65ZP, type = zp,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
|
||||||
|
|
||||||
|
29
test/cifs.s
29
test/cifs.s
@ -9,37 +9,10 @@
|
|||||||
.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
|
.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
|
|
||||||
|
|
||||||
.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
|
||||||
@ -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,7 +63,6 @@ do_encoding_test:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.rodata
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
|
30
test/dns.s
30
test/dns.s
@ -11,36 +11,8 @@
|
|||||||
.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
|
.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
|
|
||||||
|
|
||||||
.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
|
||||||
@ -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
|
||||||
@ -111,7 +82,6 @@ overwrite_with_hardcoded_dns_server:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.rodata
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,36 +7,9 @@
|
|||||||
.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
|
.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
|
|
||||||
|
|
||||||
.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
|
||||||
@ -88,9 +61,13 @@ test_dotted_quad_string:
|
|||||||
jsr print_cr
|
jsr print_cr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
||||||
|
|
||||||
temp_ax: .res 2
|
temp_ax: .res 2
|
||||||
|
|
||||||
|
|
||||||
.rodata
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
@ -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 --
|
|
@ -18,30 +18,12 @@
|
|||||||
.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
|
||||||
@ -95,7 +77,6 @@ wait_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
|
||||||
|
|
||||||
|
30
test/httpd.s
30
test/httpd.s
@ -30,16 +30,22 @@ print_a = $ffd2
|
|||||||
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,19 +63,6 @@ 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
|
||||||
@ -88,7 +81,6 @@ look_for_signature:
|
|||||||
|
|
||||||
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
|
||||||
bcc @found_kipper_signature
|
bcc @found_kipper_signature
|
||||||
@ -106,7 +98,6 @@ init:
|
|||||||
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 :+
|
||||||
@ -126,7 +117,6 @@ init:
|
|||||||
jsr print_errorcode
|
jsr print_errorcode
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
print_vars:
|
print_vars:
|
||||||
|
|
||||||
lda #'h'
|
lda #'h'
|
||||||
@ -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
|
||||||
@ -182,7 +171,8 @@ httpd_callback:
|
|||||||
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
|
||||||
@ -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
|
||||||
|
@ -15,30 +15,12 @@
|
|||||||
.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
|
||||||
@ -51,7 +33,6 @@ init:
|
|||||||
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
|
||||||
ldax #url_3
|
ldax #url_3
|
||||||
@ -81,7 +62,6 @@ init:
|
|||||||
|
|
||||||
jsr wait_key
|
jsr wait_key
|
||||||
|
|
||||||
|
|
||||||
ldax #atom_file
|
ldax #atom_file
|
||||||
jsr parser_init
|
jsr parser_init
|
||||||
|
|
||||||
@ -158,8 +138,18 @@ wait_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
|
||||||
|
34
test/ping.s
34
test/ping.s
@ -13,30 +13,8 @@
|
|||||||
.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
|
.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
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
;switch to lower case charset
|
||||||
lda #23
|
lda #23
|
||||||
@ -69,16 +47,24 @@ init:
|
|||||||
@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
|
||||||
|
27
test/sntp.s
27
test/sntp.s
@ -12,29 +12,10 @@
|
|||||||
.import sntp_utc_timestamp
|
.import sntp_utc_timestamp
|
||||||
.import sntp_get_time
|
.import sntp_get_time
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
||||||
.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:
|
|
||||||
.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
|
||||||
@ -57,7 +38,6 @@ init:
|
|||||||
dex
|
dex
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
|
|
||||||
ldax #sending_query
|
ldax #sending_query
|
||||||
jsr print
|
jsr print
|
||||||
ldax #sntp_ip
|
ldax #sntp_ip
|
||||||
@ -87,7 +67,6 @@ init:
|
|||||||
.data
|
.data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
time_server_msg:
|
time_server_msg:
|
||||||
.byte "TIME SERVER : ",0
|
.byte "TIME SERVER : ",0
|
||||||
|
|
||||||
@ -100,7 +79,6 @@ 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
|
||||||
|
|
||||||
@ -110,7 +88,6 @@ dns_error:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR test_sntp.s --
|
;-- LICENSE FOR test_sntp.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
|
||||||
|
86
test/tcp.s
86
test/tcp.s
@ -21,12 +21,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
|
||||||
.importzp acc16
|
.importzp acc16
|
||||||
@ -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
|
.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
|
|
||||||
|
|
||||||
.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
|
||||||
@ -102,7 +66,6 @@ init:
|
|||||||
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,13 +96,11 @@ 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
|
||||||
jsr test_cmp_16_16
|
jsr test_cmp_16_16
|
||||||
@ -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,14 +170,12 @@ 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
|
||||||
@ -252,7 +206,6 @@ init:
|
|||||||
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
|
||||||
@ -275,7 +228,6 @@ init:
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
ldax #tcp_callback_routine
|
ldax #tcp_callback_routine
|
||||||
stax tcp_callback
|
stax tcp_callback
|
||||||
ldax tcp_dest_ip
|
ldax tcp_dest_ip
|
||||||
@ -283,8 +235,6 @@ init:
|
|||||||
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
|
||||||
@ -300,7 +250,6 @@ 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:
|
||||||
@ -309,9 +258,6 @@ init:
|
|||||||
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
|
||||||
@ -323,7 +269,6 @@ tcp_callback_routine:
|
|||||||
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
|
||||||
|
|
||||||
@ -353,8 +298,6 @@ tcp_callback_routine:
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
check_for_error:
|
check_for_error:
|
||||||
lda ip65_error
|
lda ip65_error
|
||||||
beq @exit
|
beq @exit
|
||||||
@ -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
|
||||||
@ -470,7 +411,6 @@ 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
|
||||||
@ -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
|
||||||
@ -558,20 +497,24 @@ 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:
|
||||||
@ -580,7 +523,6 @@ 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:
|
||||||
@ -597,19 +539,14 @@ 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
|
||||||
|
|
||||||
@ -624,6 +561,9 @@ http_get_msg:
|
|||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
36
test/tftp.s
36
test/tftp.s
@ -9,7 +9,6 @@
|
|||||||
.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__
|
||||||
@ -21,30 +20,9 @@
|
|||||||
.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
|
.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
|
|
||||||
|
|
||||||
.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
|
||||||
@ -112,19 +90,27 @@ upload_callback:
|
|||||||
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