mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-06-01 00:41:30 +00:00
Replaced custom zeropage variables with cc65 default zeropage variables.
This commit is contained in:
parent
e06c02e4a3
commit
2ae35b34d9
|
@ -20,7 +20,6 @@ all: $(DRIVERS)
|
||||||
|
|
||||||
C64OBJS=\
|
C64OBJS=\
|
||||||
contiki.o \
|
contiki.o \
|
||||||
c64zeropage.o \
|
|
||||||
c64print.o \
|
c64print.o \
|
||||||
c64timer.o \
|
c64timer.o \
|
||||||
c64kernal.o \
|
c64kernal.o \
|
||||||
|
@ -29,7 +28,6 @@ C64OBJS=\
|
||||||
|
|
||||||
A2OBJS=\
|
A2OBJS=\
|
||||||
contiki.o \
|
contiki.o \
|
||||||
a2zeropage.o \
|
|
||||||
a2print.o \
|
a2print.o \
|
||||||
a2timer.o \
|
a2timer.o \
|
||||||
a2kernal.o \
|
a2kernal.o \
|
||||||
|
@ -38,7 +36,6 @@ A2OBJS=\
|
||||||
|
|
||||||
VIC20OBJS=\
|
VIC20OBJS=\
|
||||||
contiki.o \
|
contiki.o \
|
||||||
vic20zeropage.o \
|
|
||||||
vic20print.o \
|
vic20print.o \
|
||||||
vic20timer.o \
|
vic20timer.o \
|
||||||
vic20kernal.o \
|
vic20kernal.o \
|
||||||
|
|
|
@ -12,11 +12,10 @@
|
||||||
.import print_a
|
.import print_a
|
||||||
.import print_hex
|
.import print_hex
|
||||||
|
|
||||||
.importzp copy_src
|
.include "zeropage.inc"
|
||||||
|
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
allowed_ptr = copy_src ; reuse zero page
|
allowed_ptr = ptr1
|
||||||
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
; zero page definitions
|
|
||||||
|
|
||||||
.exportzp copy_src
|
|
||||||
.exportzp copy_dest
|
|
||||||
.exportzp dns_hostname
|
|
||||||
.exportzp tftp_filename
|
|
||||||
.exportzp buffer_ptr
|
|
||||||
.exportzp eth_packet
|
|
||||||
|
|
||||||
copy_src = $06 ; also $07 - source pointer
|
|
||||||
copy_dest = $08 ; also $09 - destination pointer
|
|
||||||
dns_hostname = $18 ; also $19
|
|
||||||
tftp_filename = $1D ; also $1E - name of file to d/l or filemask to get directory listing for
|
|
||||||
buffer_ptr = $EB ; also $EC - source pointer
|
|
||||||
eth_packet = $ED ; also $EE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; -- 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
|
|
||||||
; 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) 2013
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -8,17 +8,17 @@
|
||||||
.export check_for_abort_key
|
.export check_for_abort_key
|
||||||
.export get_key_if_available
|
.export get_key_if_available
|
||||||
.export get_key_ip65
|
.export get_key_ip65
|
||||||
.importzp copy_src
|
|
||||||
|
|
||||||
.import ip65_process
|
.import ip65_process
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
|
allowed_ptr = ptr1
|
||||||
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
allowed_ptr = copy_src ; reuse zero page
|
|
||||||
|
|
||||||
; use C64 Kernel ROM function to read a key
|
; use C64 Kernel ROM function to read a key
|
||||||
; inputs: none
|
; inputs: none
|
||||||
; outputs: A contains ASCII value of key just pressed
|
; outputs: A contains ASCII value of key just pressed
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
; zero page definitions
|
|
||||||
|
|
||||||
.exportzp copy_src
|
|
||||||
.exportzp copy_dest
|
|
||||||
.exportzp dns_hostname
|
|
||||||
.exportzp tftp_filename
|
|
||||||
.exportzp buffer_ptr
|
|
||||||
.exportzp eth_packet
|
|
||||||
|
|
||||||
copy_src = $5F ; also $60 - source pointer
|
|
||||||
copy_dest = $61 ; also $62 - destination pointer
|
|
||||||
dns_hostname = $63 ; also $64
|
|
||||||
tftp_filename = $65 ; also $66 - name of file to d/l or filemask to get directory listing for
|
|
||||||
buffer_ptr = $67 ; also $68 - source pointer
|
|
||||||
eth_packet = $69 ; also $6A
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; -- 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
|
|
||||||
; 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) 2013
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -8,17 +8,17 @@
|
||||||
.export check_for_abort_key
|
.export check_for_abort_key
|
||||||
.export get_key_if_available
|
.export get_key_if_available
|
||||||
.export get_key_ip65
|
.export get_key_ip65
|
||||||
.importzp copy_src
|
|
||||||
|
|
||||||
.import ip65_process
|
.import ip65_process
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
|
allowed_ptr = ptr1
|
||||||
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
allowed_ptr = copy_src ; reuse zero page
|
|
||||||
|
|
||||||
; use Vic 20 Kernel ROM function to read a key
|
; use Vic 20 Kernel ROM function to read a key
|
||||||
; inputs: none
|
; inputs: none
|
||||||
; outputs: A contains ASCII value of key just pressed
|
; outputs: A contains ASCII value of key just pressed
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
; zero page definitions
|
|
||||||
|
|
||||||
.exportzp copy_src
|
|
||||||
.exportzp copy_dest
|
|
||||||
.exportzp dns_hostname
|
|
||||||
.exportzp tftp_filename
|
|
||||||
.exportzp buffer_ptr
|
|
||||||
.exportzp eth_packet
|
|
||||||
|
|
||||||
copy_src = $5F ; also $60 - source pointer
|
|
||||||
copy_dest = $61 ; also $62 - destination pointer
|
|
||||||
dns_hostname = $63 ; also $64
|
|
||||||
tftp_filename = $65 ; also $66 - name of file to d/l or filemask to get directory listing for
|
|
||||||
buffer_ptr = $67 ; also $68 - source pointer
|
|
||||||
eth_packet = $69 ; also $6A
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; -- 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
|
|
||||||
; 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) 2013
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
.define EQU =
|
.define EQU =
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/kipper_constants.i"
|
.include "../inc/kipper_constants.i"
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
@ -34,8 +35,7 @@
|
||||||
.importzp copy_src
|
.importzp copy_src
|
||||||
.import cfg_tftp_server
|
.import cfg_tftp_server
|
||||||
|
|
||||||
; reuse the copy_src zero page var
|
pptr = ptr1
|
||||||
pptr = copy_src
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
|
@ -1,15 +1,8 @@
|
||||||
; helper routines for arithmetic on 32 bit numbers
|
; helper routines for arithmetic on 32 bit numbers
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
; 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)
|
|
||||||
acc16 = acc32 ; 16bit accumulater (value, NOT pointer)
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
||||||
|
@ -19,9 +12,9 @@ temp_ax: .res 2
|
||||||
.code
|
.code
|
||||||
|
|
||||||
; no 16bit operand as can just use AX
|
; no 16bit operand as can just use AX
|
||||||
.exportzp acc32
|
.exportzp acc32 = ptr1 ; 32bit accumulater (pointer)
|
||||||
.exportzp op32
|
.exportzp op32 = ptr2 ; 32 bit operand (pointer)
|
||||||
.exportzp acc16
|
.exportzp acc16 = acc32 ; 16bit accumulater (value, NOT pointer)
|
||||||
|
|
||||||
.export add_32_32
|
.export add_32_32
|
||||||
.export add_16_32
|
.export add_16_32
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
; ARP address resolution
|
; ARP address resolution
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.export arp_init
|
.export arp_init
|
||||||
|
@ -30,9 +31,7 @@
|
||||||
.import timer_read
|
.import timer_read
|
||||||
.import timer_timeout
|
.import timer_timeout
|
||||||
|
|
||||||
.importzp copy_src
|
ap = ptr1
|
||||||
|
|
||||||
ap = copy_src
|
|
||||||
|
|
||||||
ARP_TIMEOUT_MS = 100
|
ARP_TIMEOUT_MS = 100
|
||||||
|
|
||||||
|
|
75
ip65/cifs.s
75
ip65/cifs.s
|
@ -3,6 +3,7 @@
|
||||||
;
|
;
|
||||||
; refs: RFC1001, RFC1002, "Implementing CIFS" - http://ubiqx.org/cifs/
|
; refs: RFC1001, RFC1002, "Implementing CIFS" - http://ubiqx.org/cifs/
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
@ -69,7 +70,7 @@ nbns_registration_message_length = 68
|
||||||
; outputs:
|
; outputs:
|
||||||
; AX: pointer to decoded hostname
|
; AX: pointer to decoded hostname
|
||||||
cifs_l1_encode:
|
cifs_l1_encode:
|
||||||
stax copy_src
|
stax ptr1
|
||||||
lda #0
|
lda #0
|
||||||
tax
|
tax
|
||||||
sta hostname_buffer+32
|
sta hostname_buffer+32
|
||||||
|
@ -85,7 +86,7 @@ cifs_l1_encode:
|
||||||
ldy #0
|
ldy #0
|
||||||
ldx #0
|
ldx #0
|
||||||
@copy_loop:
|
@copy_loop:
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
beq @done
|
beq @done
|
||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
|
@ -95,7 +96,7 @@ cifs_l1_encode:
|
||||||
adc #$41
|
adc #$41
|
||||||
sta hostname_buffer,x
|
sta hostname_buffer,x
|
||||||
inx
|
inx
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
and #$0F
|
and #$0F
|
||||||
clc
|
clc
|
||||||
adc #$41
|
adc #$41
|
||||||
|
@ -115,11 +116,11 @@ cifs_l1_encode:
|
||||||
; outputs:
|
; outputs:
|
||||||
; AX: pointer to decoded hostname (will be 16 byte hostname, right padded with spaces, nul terminated)
|
; AX: pointer to decoded hostname (will be 16 byte hostname, right padded with spaces, nul terminated)
|
||||||
cifs_l1_decode:
|
cifs_l1_decode:
|
||||||
stax copy_src
|
stax ptr1
|
||||||
ldy #0
|
ldy #0
|
||||||
ldx #0
|
ldx #0
|
||||||
@decode_loop:
|
@decode_loop:
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
sec
|
sec
|
||||||
sbc #$41
|
sbc #$41
|
||||||
asl
|
asl
|
||||||
|
@ -128,7 +129,7 @@ cifs_l1_decode:
|
||||||
asl
|
asl
|
||||||
sta hi_nibble
|
sta hi_nibble
|
||||||
iny
|
iny
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
sec
|
sec
|
||||||
sbc #$41
|
sbc #$41
|
||||||
clc
|
clc
|
||||||
|
@ -306,10 +307,10 @@ nbns_callback:
|
||||||
@not_unicast:
|
@not_unicast:
|
||||||
; is it looking for our local hostname?
|
; is it looking for our local hostname?
|
||||||
ldax #udp_inp+udp_data+nbns_question_name+1
|
ldax #udp_inp+udp_data+nbns_question_name+1
|
||||||
stax copy_src
|
stax ptr1
|
||||||
ldy #0
|
ldy #0
|
||||||
@cmp_loop:
|
@cmp_loop:
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
cmp local_hostname,y
|
cmp local_hostname,y
|
||||||
bne @not_us
|
bne @not_us
|
||||||
iny
|
iny
|
||||||
|
@ -396,19 +397,19 @@ nb_session_callback:
|
||||||
|
|
||||||
; have we got a complete message?
|
; have we got a complete message?
|
||||||
ldax cifs_cmd_buffer
|
ldax cifs_cmd_buffer
|
||||||
stax copy_src
|
stax ptr1
|
||||||
ldy #3
|
ldy #3
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
cmp cifs_cmd_length
|
cmp cifs_cmd_length
|
||||||
bne @not_got_full_message
|
bne @not_got_full_message
|
||||||
dey
|
dey
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
cmp cifs_cmd_length+1
|
cmp cifs_cmd_length+1
|
||||||
bne @not_got_full_message
|
bne @not_got_full_message
|
||||||
|
|
||||||
; we have a complete message!
|
; we have a complete message!
|
||||||
ldy #0
|
ldy #0
|
||||||
lda (copy_src),y ; get the message type
|
lda (ptr1),y ; get the message type
|
||||||
cmp #$81 ; is it a session request?
|
cmp #$81 ; is it a session request?
|
||||||
bne @not_session_request
|
bne @not_session_request
|
||||||
ldax #positive_session_response_packet_length
|
ldax #positive_session_response_packet_length
|
||||||
|
@ -423,11 +424,11 @@ nb_session_callback:
|
||||||
|
|
||||||
; this SHOULD be a SMB - best check the header
|
; this SHOULD be a SMB - best check the header
|
||||||
ldy #4
|
ldy #4
|
||||||
lda (copy_src),y ; get the message data
|
lda (ptr1),y ; get the message data
|
||||||
cmp #$FF ; start of SMB header
|
cmp #$FF ; start of SMB header
|
||||||
bne @not_smb
|
bne @not_smb
|
||||||
iny
|
iny
|
||||||
lda (copy_src),y ; get the message data
|
lda (ptr1),y ; get the message data
|
||||||
cmp #'S' ; start of SMB header
|
cmp #'S' ; start of SMB header
|
||||||
bne @not_smb
|
bne @not_smb
|
||||||
|
|
||||||
|
@ -453,17 +454,17 @@ nb_session_callback:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
smb_handler:
|
smb_handler:
|
||||||
; at this point, copy_src points to an SMB block encapsulated in an NBT session header
|
; at this point, ptr1 points to an SMB block encapsulated in an NBT session header
|
||||||
clc
|
clc
|
||||||
lda copy_src
|
lda ptr1
|
||||||
adc #4
|
adc #4
|
||||||
sta smb_ptr ; skip past the NBT header
|
sta smb_ptr ; skip past the NBT header
|
||||||
lda copy_src+1
|
lda ptr1+1
|
||||||
adc #00
|
adc #00
|
||||||
sta smb_ptr+1
|
sta smb_ptr+1
|
||||||
|
|
||||||
ldy #8
|
ldy #8
|
||||||
lda (copy_src),y ; get the SMB type
|
lda (ptr1),y ; get the SMB type
|
||||||
cmp #$72
|
cmp #$72
|
||||||
bne @not_negotiate_protocol
|
bne @not_negotiate_protocol
|
||||||
jmp @negotiate_protocol
|
jmp @negotiate_protocol
|
||||||
|
@ -484,7 +485,7 @@ smb_handler:
|
||||||
|
|
||||||
@parse_andx_block:
|
@parse_andx_block:
|
||||||
ldax andx_ptr
|
ldax andx_ptr
|
||||||
stax copy_src
|
stax ptr1
|
||||||
lda andx_opcode
|
lda andx_opcode
|
||||||
|
|
||||||
cmp #$ff
|
cmp #$ff
|
||||||
|
@ -513,16 +514,16 @@ smb_handler:
|
||||||
|
|
||||||
@go_to_next_andx_block:
|
@go_to_next_andx_block:
|
||||||
ldy #3
|
ldy #3
|
||||||
lda (copy_src),y ; get the AndX offset low byte
|
lda (ptr1),y ; get the AndX offset low byte
|
||||||
clc
|
clc
|
||||||
adc smb_ptr
|
adc smb_ptr
|
||||||
sta andx_ptr
|
sta andx_ptr
|
||||||
iny
|
iny
|
||||||
lda (copy_src),y ; get the AndX offset high byte
|
lda (ptr1),y ; get the AndX offset high byte
|
||||||
adc smb_ptr+1
|
adc smb_ptr+1
|
||||||
sta andx_ptr+1
|
sta andx_ptr+1
|
||||||
ldy #1
|
ldy #1
|
||||||
lda (copy_src),y ; get the subsequent AndX opcode
|
lda (ptr1),y ; get the subsequent AndX opcode
|
||||||
sta andx_opcode
|
sta andx_opcode
|
||||||
|
|
||||||
jmp @parse_andx_block
|
jmp @parse_andx_block
|
||||||
|
@ -539,7 +540,7 @@ smb_handler:
|
||||||
; copy the request TID,PID,UID,MID into the response
|
; copy the request TID,PID,UID,MID into the response
|
||||||
ldy #28 ; offset of TID from start of message
|
ldy #28 ; offset of TID from start of message
|
||||||
ldx #0
|
ldx #0
|
||||||
: lda (copy_src),y
|
: lda (ptr1),y
|
||||||
sta negotiate_protocol_response_tid,x
|
sta negotiate_protocol_response_tid,x
|
||||||
inx
|
inx
|
||||||
iny
|
iny
|
||||||
|
@ -552,10 +553,10 @@ smb_handler:
|
||||||
clc
|
clc
|
||||||
lda cifs_cmd_buffer
|
lda cifs_cmd_buffer
|
||||||
adc #$26
|
adc #$26
|
||||||
sta copy_src
|
sta ptr1
|
||||||
lda cifs_cmd_buffer+1
|
lda cifs_cmd_buffer+1
|
||||||
adc #$00
|
adc #$00
|
||||||
sta copy_src+1
|
sta ptr1+1
|
||||||
|
|
||||||
ldy #$0
|
ldy #$0
|
||||||
@dialect_scan_loop:
|
@dialect_scan_loop:
|
||||||
|
@ -564,7 +565,7 @@ smb_handler:
|
||||||
lda dialect_index
|
lda dialect_index
|
||||||
cmp #$10 ; if we've scanned more than $10 dialects, something is wrong
|
cmp #$10 ; if we've scanned more than $10 dialects, something is wrong
|
||||||
beq @end_of_dialects
|
beq @end_of_dialects
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
cmp #$02
|
cmp #$02
|
||||||
bne @test_dialect
|
bne @test_dialect
|
||||||
inc dialect_index
|
inc dialect_index
|
||||||
|
@ -572,14 +573,14 @@ smb_handler:
|
||||||
@test_dialect:
|
@test_dialect:
|
||||||
tya
|
tya
|
||||||
clc
|
clc
|
||||||
adc copy_src
|
adc ptr1
|
||||||
sta copy_src
|
sta ptr1
|
||||||
bcc :+
|
bcc :+
|
||||||
inc copy_src+1
|
inc ptr1+1
|
||||||
: ldy #0
|
: ldy #0
|
||||||
|
|
||||||
@test_dialect_loop:
|
@test_dialect_loop:
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
cmp preferred_dialect_id,y
|
cmp preferred_dialect_id,y
|
||||||
bne @dialect_scan_loop
|
bne @dialect_scan_loop
|
||||||
iny
|
iny
|
||||||
|
@ -601,11 +602,11 @@ smb_handler:
|
||||||
|
|
||||||
start_smb_response:
|
start_smb_response:
|
||||||
ldax smb_response_buffer
|
ldax smb_response_buffer
|
||||||
stax copy_dest
|
stax ptr2
|
||||||
ldy #0
|
ldy #0
|
||||||
@copy_header_loop:
|
@copy_header_loop:
|
||||||
lda (copy_src),y ; copy_src should be the SMB request - cloning this will set PID / MID etc
|
lda (ptr1),y ; copy_src should be the SMB request - cloning this will set PID / MID etc
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
iny
|
iny
|
||||||
cpy #smb_response_header_length
|
cpy #smb_response_header_length
|
||||||
bne @copy_header_loop
|
bne @copy_header_loop
|
||||||
|
@ -614,18 +615,18 @@ start_smb_response:
|
||||||
lda #smb_response_header_length
|
lda #smb_response_header_length
|
||||||
sta smb_response_length
|
sta smb_response_length
|
||||||
ldy #3
|
ldy #3
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
|
|
||||||
; set the flags correctly
|
; set the flags correctly
|
||||||
ldy #smb_response_flags_offset
|
ldy #smb_response_flags_offset
|
||||||
lda #$82 ; FLAGS byte
|
lda #$82 ; FLAGS byte
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
iny
|
iny
|
||||||
lda #$01 ; FLAGS2 low byte
|
lda #$01 ; FLAGS2 low byte
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
iny
|
iny
|
||||||
lda #$00 ; FLAGS2 hi byte
|
lda #$00 ; FLAGS2 hi byte
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
rts
|
rts
|
||||||
|
|
||||||
add_andx_response:
|
add_andx_response:
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
; utility routine to copy memory
|
; utility routine to copy memory
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
.export copymem
|
.export copymem
|
||||||
.importzp copy_src
|
.exportzp copy_src = ptr1
|
||||||
.importzp copy_dest
|
.exportzp copy_dest = ptr2
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
; routines for dumping debug information
|
; routines for dumping debug information
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
.include "../inc/printf.i"
|
.include "../inc/printf.i"
|
||||||
|
|
||||||
|
@ -14,7 +15,6 @@
|
||||||
.import eth_outp, eth_outp_len
|
.import eth_outp, eth_outp_len
|
||||||
.import ip_outp
|
.import ip_outp
|
||||||
.import udp_outp
|
.import udp_outp
|
||||||
.importzp copy_src
|
|
||||||
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
@ -105,7 +105,7 @@ console_out = $ffd2
|
||||||
; inputs: AX = address of (null terminated) string to print
|
; inputs: AX = address of (null terminated) string to print
|
||||||
; outputs: none
|
; outputs: none
|
||||||
console_strout:
|
console_strout:
|
||||||
stax copy_src
|
stax ptr1
|
||||||
|
|
||||||
pha
|
pha
|
||||||
txa
|
txa
|
||||||
|
@ -113,7 +113,7 @@ console_strout:
|
||||||
tya
|
tya
|
||||||
pha
|
pha
|
||||||
ldy #0
|
ldy #0
|
||||||
: lda (copy_src),y
|
: lda (ptr1),y
|
||||||
beq @done
|
beq @done
|
||||||
jsr console_out
|
jsr console_out
|
||||||
iny
|
iny
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
; minimal dns implementation - requires a DNS server that supports recursion
|
; minimal dns implementation - requires a DNS server that supports recursion
|
||||||
|
|
||||||
MAX_DNS_MESSAGES_SENT = 8 ; timeout after sending 8 messages will be about 7 seconds (1+2+3+4+5+6+7+8)/4
|
MAX_DNS_MESSAGES_SENT = 8 ; timeout after sending 8 messages will be about 7 seconds (1+2+3+4+5+6+7+8)/4
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
.import check_for_abort_key
|
.import check_for_abort_key
|
||||||
.import timer_read
|
.import timer_read
|
||||||
|
|
||||||
.importzp dns_hostname
|
dns_hostname = ptr1
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
; NB - this routine uses the same buffer space and zero page locations as many other ip65 routines. so do not call
|
; NB - this routine uses the same buffer space and zero page locations as many other ip65 routines. so do not call
|
||||||
; other ip65 routines between the http_parse_request & http_get_value else odd things will happen.
|
; other ip65 routines between the http_parse_request & http_get_value else odd things will happen.
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
@ -13,14 +14,11 @@
|
||||||
.export http_parse_request
|
.export http_parse_request
|
||||||
.export http_get_value
|
.export http_get_value
|
||||||
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import output_buffer
|
.import output_buffer
|
||||||
.import parse_hex_digits
|
.import parse_hex_digits
|
||||||
|
|
||||||
; reuse the copy_src zero page var
|
string_ptr = ptr1
|
||||||
string_ptr = copy_src
|
table_ptr = ptr2
|
||||||
table_ptr = copy_dest
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
; a simple HTTP server
|
; a simple HTTP server
|
||||||
; to use - call httpd_start with AX pointing at routine to call for each inbound page
|
; to use - call httpd_start with AX pointing at routine to call for each inbound page
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
@ -33,7 +34,7 @@ HTTPD_TIMEOUT_SECONDS = 5 ; what's the maximum time we let 1 connection be
|
||||||
.import native_to_ascii
|
.import native_to_ascii
|
||||||
.import timer_seconds
|
.import timer_seconds
|
||||||
|
|
||||||
temp_ptr = copy_src
|
temp_ptr = ptr1
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
13
ip65/ip.s
13
ip65/ip.s
|
@ -1,3 +1,4 @@
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.export ip_init
|
.export ip_init
|
||||||
|
@ -56,11 +57,7 @@
|
||||||
.import tcp_process
|
.import tcp_process
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.importzp copy_src
|
.exportzp ip_cksum_ptr = ptr2
|
||||||
.importzp copy_dest
|
|
||||||
.exportzp ip_cksum_ptr
|
|
||||||
|
|
||||||
ip_cksum_ptr=copy_dest
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
@ -347,13 +344,13 @@ ip_send:
|
||||||
rol ; pad with 0
|
rol ; pad with 0
|
||||||
; clc
|
; clc
|
||||||
adc #<ip_outp
|
adc #<ip_outp
|
||||||
sta copy_src ; borrow copymem zp...
|
sta ptr1
|
||||||
lda ip_outp + ip_len
|
lda ip_outp + ip_len
|
||||||
adc #>ip_outp
|
adc #>ip_outp
|
||||||
sta copy_src + 1
|
sta ptr1 + 1
|
||||||
ldy #0
|
ldy #0
|
||||||
tya
|
tya
|
||||||
sta (copy_src),y
|
sta (ptr1),y
|
||||||
sec ; round up to even number
|
sec ; round up to even number
|
||||||
@dontpad:
|
@dontpad:
|
||||||
lda ip_outp + ip_len + 1
|
lda ip_outp + ip_len + 1
|
||||||
|
|
|
@ -4,12 +4,8 @@
|
||||||
|
|
||||||
.export parser_init
|
.export parser_init
|
||||||
.export parser_skip_next
|
.export parser_skip_next
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
|
|
||||||
target_string = copy_src
|
|
||||||
search_string = copy_dest
|
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
@ -17,6 +13,9 @@ search_string = copy_dest
|
||||||
.include "../inc/kipper_constants.i"
|
.include "../inc/kipper_constants.i"
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
target_string = ptr1
|
||||||
|
search_string = ptr2
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
||||||
|
|
|
@ -3,15 +3,14 @@
|
||||||
.export parse_integer
|
.export parse_integer
|
||||||
.export parse_hex_digits
|
.export parse_hex_digits
|
||||||
|
|
||||||
.importzp copy_dest
|
|
||||||
|
|
||||||
.import mul_8_16
|
.import mul_8_16
|
||||||
.importzp acc16
|
.importzp acc16
|
||||||
|
|
||||||
target_string = copy_dest
|
.include "zeropage.inc"
|
||||||
|
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
|
target_string = ptr2
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
MAX_TCP_PACKETS_SENT = 8 ; timeout after sending 8 messages will be about 7 seconds (1+2+3+4+5+6+7+8)/4
|
MAX_TCP_PACKETS_SENT = 8 ; timeout after sending 8 messages will be about 7 seconds (1+2+3+4+5+6+7+8)/4
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
@ -378,16 +379,16 @@ tcp_close:
|
||||||
; carry flag is set if an error occured, clear otherwise
|
; carry flag is set if an error occured, clear otherwise
|
||||||
tcp_send_string:
|
tcp_send_string:
|
||||||
stax tcp_send_data_ptr
|
stax tcp_send_data_ptr
|
||||||
stax copy_src
|
stax ptr1
|
||||||
lda #0
|
lda #0
|
||||||
tay
|
tay
|
||||||
sta tcp_send_data_len
|
sta tcp_send_data_len
|
||||||
sta tcp_send_data_len+1
|
sta tcp_send_data_len+1
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
bne @find_end_of_string
|
bne @find_end_of_string
|
||||||
rts ; if the string is empty, don't send anything!
|
rts ; if the string is empty, don't send anything!
|
||||||
@find_end_of_string:
|
@find_end_of_string:
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
beq @done
|
beq @done
|
||||||
inc tcp_send_data_len
|
inc tcp_send_data_len
|
||||||
iny
|
iny
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
; telnet_menu - called whenever the F1 key is pressed.
|
; telnet_menu - called whenever the F1 key is pressed.
|
||||||
; telnet_on_connection - called after succesful connection
|
; telnet_on_connection - called after succesful connection
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.import tcp_connect
|
.import tcp_connect
|
||||||
|
@ -45,7 +46,7 @@
|
||||||
.import telnet_menu
|
.import telnet_menu
|
||||||
.import telnet_on_connection
|
.import telnet_on_connection
|
||||||
|
|
||||||
.importzp buffer_ptr
|
buffer_ptr = ptr4
|
||||||
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
TFTP_MAX_RESENDS = 10
|
TFTP_MAX_RESENDS = 10
|
||||||
TFTP_TIMER_MASK = $F8 ; mask lower two bits, means we wait for 8 x1/4 seconds
|
TFTP_TIMER_MASK = $F8 ; mask lower two bits, means we wait for 8 x1/4 seconds
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
@ -48,7 +49,7 @@ TFTP_TIMER_MASK = $F8 ; mask lower two bits, means we wait for 8 x1/4
|
||||||
|
|
||||||
.import timer_read
|
.import timer_read
|
||||||
|
|
||||||
.importzp tftp_filename
|
.exportzp tftp_filename = ptr3
|
||||||
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
37
ip65/url.s
37
ip65/url.s
|
@ -1,5 +1,6 @@
|
||||||
; routines for parsing a URL, and downloading an URL
|
; routines for parsing a URL, and downloading an URL
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
.ifndef KPR_API_VERSION_NUMBER
|
||||||
|
@ -41,8 +42,8 @@ TIMEOUT_SECONDS = 15
|
||||||
.export url_download_buffer_length
|
.export url_download_buffer_length
|
||||||
.export resource_download
|
.export resource_download
|
||||||
|
|
||||||
target_string = copy_src
|
target_string = ptr1
|
||||||
search_string = copy_dest
|
search_string = ptr2
|
||||||
selector_buffer = output_buffer
|
selector_buffer = output_buffer
|
||||||
|
|
||||||
|
|
||||||
|
@ -155,9 +156,9 @@ lda #url_type_gopher
|
||||||
ldax #slash
|
ldax #slash
|
||||||
jsr parser_skip_next
|
jsr parser_skip_next
|
||||||
; AX now pointing at selector
|
; AX now pointing at selector
|
||||||
stax copy_src
|
stax ptr1
|
||||||
ldax #selector_buffer
|
ldax #selector_buffer
|
||||||
stax copy_dest
|
stax ptr2
|
||||||
lda #0
|
lda #0
|
||||||
sta src_ptr
|
sta src_ptr
|
||||||
sta dest_ptr
|
sta dest_ptr
|
||||||
|
@ -167,7 +168,7 @@ lda #url_type_gopher
|
||||||
bne @not_gopher
|
bne @not_gopher
|
||||||
; first byte after / in a gopher url is the resource type
|
; first byte after / in a gopher url is the resource type
|
||||||
ldy src_ptr
|
ldy src_ptr
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
beq @start_of_selector
|
beq @start_of_selector
|
||||||
sta url_resource_type
|
sta url_resource_type
|
||||||
inc src_ptr
|
inc src_ptr
|
||||||
|
@ -180,7 +181,7 @@ lda #url_type_gopher
|
||||||
ldy #get_length-1
|
ldy #get_length-1
|
||||||
sty dest_ptr
|
sty dest_ptr
|
||||||
: lda get,y
|
: lda get,y
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
dey
|
dey
|
||||||
bpl :-
|
bpl :-
|
||||||
|
|
||||||
|
@ -190,13 +191,13 @@ lda #url_type_gopher
|
||||||
jmp @save_first_byte_of_selector
|
jmp @save_first_byte_of_selector
|
||||||
@copy_one_byte:
|
@copy_one_byte:
|
||||||
ldy src_ptr
|
ldy src_ptr
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
cmp #$20
|
cmp #$20
|
||||||
bcc @end_of_selector ; any control char (including CR,LF, and $00) should be treated as end of URL
|
bcc @end_of_selector ; any control char (including CR,LF, and $00) should be treated as end of URL
|
||||||
inc src_ptr
|
inc src_ptr
|
||||||
@save_first_byte_of_selector:
|
@save_first_byte_of_selector:
|
||||||
ldy dest_ptr
|
ldy dest_ptr
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
inc dest_ptr
|
inc dest_ptr
|
||||||
bne @copy_one_byte
|
bne @copy_one_byte
|
||||||
@end_of_selector:
|
@end_of_selector:
|
||||||
|
@ -212,22 +213,22 @@ lda #url_type_gopher
|
||||||
beq :+
|
beq :+
|
||||||
ldy dest_ptr
|
ldy dest_ptr
|
||||||
inc dest_ptr
|
inc dest_ptr
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
inx
|
inx
|
||||||
bne :-
|
bne :-
|
||||||
: ; now copy the host field
|
: ; now copy the host field
|
||||||
jsr skip_to_hostname
|
jsr skip_to_hostname
|
||||||
; AX now pointing at hostname
|
; AX now pointing at hostname
|
||||||
stax copy_src
|
stax ptr1
|
||||||
ldax #selector_buffer
|
ldax #selector_buffer
|
||||||
stax copy_dest
|
stax ptr2
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta src_ptr
|
sta src_ptr
|
||||||
|
|
||||||
@copy_one_byte_of_hostname:
|
@copy_one_byte_of_hostname:
|
||||||
ldy src_ptr
|
ldy src_ptr
|
||||||
lda (copy_src),y
|
lda (ptr1),y
|
||||||
beq @end_of_hostname
|
beq @end_of_hostname
|
||||||
cmp #':'
|
cmp #':'
|
||||||
beq @end_of_hostname
|
beq @end_of_hostname
|
||||||
|
@ -235,7 +236,7 @@ lda #url_type_gopher
|
||||||
beq @end_of_hostname
|
beq @end_of_hostname
|
||||||
inc src_ptr
|
inc src_ptr
|
||||||
ldy dest_ptr
|
ldy dest_ptr
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
inc dest_ptr
|
inc dest_ptr
|
||||||
bne @copy_one_byte_of_hostname
|
bne @copy_one_byte_of_hostname
|
||||||
@end_of_hostname:
|
@end_of_hostname:
|
||||||
|
@ -244,10 +245,10 @@ lda #url_type_gopher
|
||||||
@final_crlf:
|
@final_crlf:
|
||||||
ldy dest_ptr
|
ldy dest_ptr
|
||||||
lda #$0d
|
lda #$0d
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
iny
|
iny
|
||||||
lda #$0a
|
lda #$0a
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
iny
|
iny
|
||||||
sty dest_ptr
|
sty dest_ptr
|
||||||
dex
|
dex
|
||||||
|
@ -255,7 +256,7 @@ lda #url_type_gopher
|
||||||
|
|
||||||
@done:
|
@done:
|
||||||
lda #$00
|
lda #$00
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
ldax #selector_buffer
|
ldax #selector_buffer
|
||||||
stax url_selector
|
stax url_selector
|
||||||
clc
|
clc
|
||||||
|
@ -351,10 +352,10 @@ resource_download:
|
||||||
put_zero_at_end_of_dl_buffer:
|
put_zero_at_end_of_dl_buffer:
|
||||||
; put a zero byte at the end of the file
|
; put a zero byte at the end of the file
|
||||||
ldax temp_buffer
|
ldax temp_buffer
|
||||||
stax copy_dest
|
stax ptr2
|
||||||
lda #0
|
lda #0
|
||||||
tay
|
tay
|
||||||
sta (copy_dest),y
|
sta (ptr2),y
|
||||||
rts
|
rts
|
||||||
|
|
||||||
not_end_of_file:
|
not_end_of_file:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user