mirror of
https://github.com/bobbimanners/emailler.git
synced 2025-02-08 21:30:46 +00:00
git-svn-id: http://svn.code.sf.net/p/netboot65/code@141 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
parent
ce183ea301
commit
d6f835d597
@ -28,6 +28,7 @@ ETHOBJS= \
|
|||||||
output_buffer.o\
|
output_buffer.o\
|
||||||
tftp.o \
|
tftp.o \
|
||||||
tcp.o \
|
tcp.o \
|
||||||
|
arithmetic.o\
|
||||||
function_dispatcher.o \
|
function_dispatcher.o \
|
||||||
|
|
||||||
|
|
||||||
|
59
client/ip65/arithmetic.s
Normal file
59
client/ip65/arithmetic.s
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
;helper routines for arithmetic on 32 bit numbers
|
||||||
|
|
||||||
|
;reuse the copy_* zero page locations as pointers for 32bit addition
|
||||||
|
.importzp copy_src
|
||||||
|
.importzp copy_dest
|
||||||
|
|
||||||
|
acc32 =copy_src ;32bit accumulater (pointer)
|
||||||
|
op32 =copy_dest ;32 bit operand (pointer)
|
||||||
|
|
||||||
|
.exportzp acc32
|
||||||
|
.exportzp op32
|
||||||
|
.export add_32_32
|
||||||
|
.export add_16_32
|
||||||
|
|
||||||
|
;add a 32bit operand to the 32 bit accumulater
|
||||||
|
;acc32=acc32+op32
|
||||||
|
add_32_32:
|
||||||
|
clc
|
||||||
|
ldy #0
|
||||||
|
lda (op32),y
|
||||||
|
adc (acc32),y
|
||||||
|
sta (acc32),y
|
||||||
|
iny
|
||||||
|
lda (op32),y
|
||||||
|
adc (acc32),y
|
||||||
|
sta (acc32),y
|
||||||
|
iny
|
||||||
|
lda (op32),y
|
||||||
|
adc (acc32),y
|
||||||
|
sta (acc32),y
|
||||||
|
iny
|
||||||
|
lda (op32),y
|
||||||
|
adc (acc32),y
|
||||||
|
sta (acc32),y
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;add a 16bit operand to the 32 bit accumulater
|
||||||
|
;acc32=acc32+AX
|
||||||
|
add_16_32:
|
||||||
|
clc
|
||||||
|
ldy #0
|
||||||
|
adc (acc32),y
|
||||||
|
sta (acc32),y
|
||||||
|
iny
|
||||||
|
txa
|
||||||
|
adc (acc32),y
|
||||||
|
sta (acc32),y
|
||||||
|
iny
|
||||||
|
lda #0
|
||||||
|
adc (acc32),y
|
||||||
|
sta (acc32),y
|
||||||
|
iny
|
||||||
|
lda #0
|
||||||
|
adc (acc32),y
|
||||||
|
sta (acc32),y
|
||||||
|
rts
|
||||||
|
|
@ -7,6 +7,8 @@ AFLAGS=
|
|||||||
|
|
||||||
IP65LIB=../ip65/ip65.lib
|
IP65LIB=../ip65/ip65.lib
|
||||||
|
|
||||||
|
IP65TCPLIB=../ip65/ip65_tcp.lib
|
||||||
|
|
||||||
C64PROGLIB=../drivers/c64prog.lib
|
C64PROGLIB=../drivers/c64prog.lib
|
||||||
C64PNB65LIB=../drivers/c64nb65.lib
|
C64PNB65LIB=../drivers/c64nb65.lib
|
||||||
APPLE2PROGLIB=../drivers/apple2prog.lib
|
APPLE2PROGLIB=../drivers/apple2prog.lib
|
||||||
@ -25,6 +27,7 @@ all: \
|
|||||||
test_cart_api.prg\
|
test_cart_api.prg\
|
||||||
testdottedquad.pg2\
|
testdottedquad.pg2\
|
||||||
testdottedquad.prg\
|
testdottedquad.prg\
|
||||||
|
test_tcp.prg \
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -c $(CFLAGS) $<
|
$(CC) -c $(CFLAGS) $<
|
||||||
@ -35,6 +38,9 @@ all: \
|
|||||||
%.prg: %.o $(IP65LIB) $(C64PROGLIB) $(INCFILES) ../cfg/c64prg.cfg
|
%.prg: %.o $(IP65LIB) $(C64PROGLIB) $(INCFILES) ../cfg/c64prg.cfg
|
||||||
$(LD) -m $*.map -vm -C ../cfg/c64prg.cfg -o $*.prg $(AFLAGS) $< $(IP65LIB) $(C64PROGLIB)
|
$(LD) -m $*.map -vm -C ../cfg/c64prg.cfg -o $*.prg $(AFLAGS) $< $(IP65LIB) $(C64PROGLIB)
|
||||||
|
|
||||||
|
test_tcp.prg: test_tcp.o $(IP65TCPLIB) $(C64PROGLIB) $(INCFILES) ../cfg/c64prg.cfg
|
||||||
|
$(LD) -m $*.map -vm -C ../cfg/c64prg.cfg -o test_tcp.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64PROGLIB)
|
||||||
|
|
||||||
%.pg2: %.o $(IP65LIB) $(APPLE2PROGLIB) $(INCFILES) ../cfg/a2bin.cfg
|
%.pg2: %.o $(IP65LIB) $(APPLE2PROGLIB) $(INCFILES) ../cfg/a2bin.cfg
|
||||||
$(LD) -C ../cfg/a2bin.cfg -o $*.pg2 $(AFLAGS) $< $(IP65LIB) $(APPLE2PROGLIB)
|
$(LD) -C ../cfg/a2bin.cfg -o $*.pg2 $(AFLAGS) $< $(IP65LIB) $(APPLE2PROGLIB)
|
||||||
|
|
||||||
|
228
client/test/test_tcp.s
Normal file
228
client/test/test_tcp.s
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
.include "../inc/common.i"
|
||||||
|
.include "../inc/commonprint.i"
|
||||||
|
.include "../inc/net.i"
|
||||||
|
|
||||||
|
.import exit_to_basic
|
||||||
|
|
||||||
|
.import parse_dotted_quad
|
||||||
|
.import dotted_quad_value
|
||||||
|
|
||||||
|
.import __CODE_LOAD__
|
||||||
|
.import __CODE_SIZE__
|
||||||
|
.import __RODATA_SIZE__
|
||||||
|
.import __DATA_SIZE__
|
||||||
|
|
||||||
|
|
||||||
|
.importzp acc32
|
||||||
|
.importzp op32
|
||||||
|
|
||||||
|
.import add_32_32
|
||||||
|
.import add_16_32
|
||||||
|
|
||||||
|
.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:
|
||||||
|
|
||||||
|
jsr print_cr
|
||||||
|
|
||||||
|
ldax #number1
|
||||||
|
stax acc32
|
||||||
|
ldax #number2
|
||||||
|
stax op32
|
||||||
|
jsr test_add_32_32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ldax #number3
|
||||||
|
stax acc32
|
||||||
|
ldax #number4
|
||||||
|
stax op32
|
||||||
|
jsr test_add_32_32
|
||||||
|
|
||||||
|
ldax #number5
|
||||||
|
stax acc32
|
||||||
|
ldax #number6
|
||||||
|
stax op32
|
||||||
|
jsr test_add_32_32
|
||||||
|
|
||||||
|
ldax #number7
|
||||||
|
stax acc32
|
||||||
|
ldax #number8
|
||||||
|
stax op32
|
||||||
|
jsr test_add_32_32
|
||||||
|
|
||||||
|
ldax #number9
|
||||||
|
stax acc32
|
||||||
|
ldax #number10
|
||||||
|
stax op32
|
||||||
|
jsr test_add_32_32
|
||||||
|
|
||||||
|
ldax #number11
|
||||||
|
stax acc32
|
||||||
|
ldax #number12
|
||||||
|
stax op32
|
||||||
|
jsr test_add_32_32
|
||||||
|
|
||||||
|
|
||||||
|
ldax #number13
|
||||||
|
stax acc32
|
||||||
|
ldax #$1234
|
||||||
|
jsr test_add_16_32
|
||||||
|
|
||||||
|
ldax #number14
|
||||||
|
stax acc32
|
||||||
|
ldax #$1234
|
||||||
|
jsr test_add_16_32
|
||||||
|
|
||||||
|
ldax #number15
|
||||||
|
stax acc32
|
||||||
|
ldax #$1234
|
||||||
|
jsr test_add_16_32
|
||||||
|
|
||||||
|
ldax #number16
|
||||||
|
stax acc32
|
||||||
|
ldax #$1234
|
||||||
|
jsr test_add_16_32
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;assumes acc32 & op32 already set
|
||||||
|
test_add_32_32:
|
||||||
|
ldy #3
|
||||||
|
:
|
||||||
|
lda (acc32),y
|
||||||
|
jsr print_hex
|
||||||
|
dey
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
lda #'+'
|
||||||
|
jsr print_a
|
||||||
|
ldy #3
|
||||||
|
:
|
||||||
|
lda (op32),y
|
||||||
|
jsr print_hex
|
||||||
|
dey
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
lda #'='
|
||||||
|
jsr print_a
|
||||||
|
jsr add_32_32
|
||||||
|
|
||||||
|
ldy #3
|
||||||
|
:
|
||||||
|
lda (acc32),y
|
||||||
|
jsr print_hex
|
||||||
|
dey
|
||||||
|
bpl :-
|
||||||
|
jsr print_cr
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;assumes acc32 & AX already set
|
||||||
|
test_add_16_32:
|
||||||
|
stax temp_ax
|
||||||
|
ldy #3
|
||||||
|
:
|
||||||
|
lda (acc32),y
|
||||||
|
jsr print_hex
|
||||||
|
dey
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
lda #'+'
|
||||||
|
jsr print_a
|
||||||
|
|
||||||
|
lda temp_ax+1
|
||||||
|
jsr print_hex
|
||||||
|
lda temp_ax
|
||||||
|
jsr print_hex
|
||||||
|
|
||||||
|
lda #'='
|
||||||
|
jsr print_a
|
||||||
|
ldax temp_ax
|
||||||
|
jsr add_16_32
|
||||||
|
|
||||||
|
ldy #3
|
||||||
|
:
|
||||||
|
lda (acc32),y
|
||||||
|
jsr print_hex
|
||||||
|
dey
|
||||||
|
bpl :-
|
||||||
|
jsr print_cr
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
@error:
|
||||||
|
ldax #failed_msg
|
||||||
|
jsr print
|
||||||
|
jsr print_cr
|
||||||
|
rts
|
||||||
|
|
||||||
|
.bss
|
||||||
|
temp_ax: .res 2
|
||||||
|
|
||||||
|
.rodata
|
||||||
|
|
||||||
|
|
||||||
|
.data
|
||||||
|
number1:
|
||||||
|
.byte $1,$2,$3,$f
|
||||||
|
number2:
|
||||||
|
.byte $10,$20,$30,$f0
|
||||||
|
number3:
|
||||||
|
.byte $ff,$ff,$ff,$ff
|
||||||
|
number4:
|
||||||
|
.byte $1,$0,$0,$0
|
||||||
|
|
||||||
|
number5:
|
||||||
|
.byte $ff,$ff,$ff,$ff
|
||||||
|
number6:
|
||||||
|
.byte $0,$0,$0,$0
|
||||||
|
number7:
|
||||||
|
.byte $ff,$ff,$ff,$fe
|
||||||
|
number8:
|
||||||
|
.byte $1,$0,$0,$0
|
||||||
|
number9:
|
||||||
|
.byte $ff,$ff,$ff,$fe
|
||||||
|
number10:
|
||||||
|
.byte $5,$0,$0,$0
|
||||||
|
number11:
|
||||||
|
.byte $ff,$0,$0,$e
|
||||||
|
number12:
|
||||||
|
.byte $5,$0,$0,$0
|
||||||
|
|
||||||
|
number13:
|
||||||
|
.byte $1,$2,$3,$4
|
||||||
|
|
||||||
|
number14:
|
||||||
|
.byte $ff,$ff,$ff,$ff
|
||||||
|
|
||||||
|
number15:
|
||||||
|
.byte $ff,$ff,$00,$00
|
||||||
|
|
||||||
|
number16:
|
||||||
|
.byte $00,$00,$00,$00
|
Loading…
x
Reference in New Issue
Block a user