Up one Vic 20 network - software by Lee Davison Up to top

Initialisation

This is the code that sets up the Vic hardware, the system variables and the network card. It also has the Vic cartridge startup string and the entry point vectors so that when this ROM is connected it takes over the Vic completely.


; *********************************************************************		
; ROM to be used is $A000 and possibly $2000, $4000 and $6000 if needed

		*=	$A000

					; first up is the auto-boot header
	.dw	LAB_start		; entry point for code (power up)
	.dw	LAB_restart		; warm start entry point (restore key)

	.db	"A0",$C3,$C2,$CD	; 'A0CBM' boot string

LAB_restart
LAB_start
	JSR	vicinit			; initialise VIC 20 hardware
	JSR	setscr			; initialise the screen

	LDA	#$A9			; 169
	STA	ip_ours			; save my IP address first byte
	LDA	#$FE			; 254
	STA	ip_ours+$01		; save my IP address second byte
					; 3rd and 4th are from MAC address
	LDX	#$00			; clear X
	STX	IB			; clear interrupt flag byte
	STX	valid_pkt		; clear valid packet
	STX	cdtb_l			; clear countdown timer b low byte
	STX	cdtb_h			; clear countdown timer b high byte
	STX	cdtf_l			; clear countdown timer f low byte
	INX				; = $01
	STX	cdtf_h			; set countdown timer f high byte
	STX	tcp_state		; set TCP state to listen

	LDA	NMI_res			; reset NMI latch
	JSR	LAB_10500		; initialise network card

	JSR	print_ip		; print out IP address
	JSR	print_mac		; print out MAC address
	JSR	print_tcp		; print TCP state

; *********************************************************************


Last page update: 29th February, 2004. e-mail me e-mail