6502 Pen plotter - Initialisation By Lee Davison.

Initialisation.

Initialisation is simple. All that needs to be done is to disable interrupts, disable the motors and lift the pen, clear the timers and set the LED port.


Initdraw
	SEI			; disable interrupts

	LDA	#$10		; set byte
	STA	Mport		; turn off motors, lift pen

	LDA	#$01		; turn on power LED, turn off alarm LED
	STA	Pport		; out to LED port
	STA	Timer2r		; set access to timer1 control register
	STA	Timer13r	; software reset timers

	LDA	#$00		; clear byte
	STA	Timer13r	; allow timers to run
	STA	Lastp		; set last pen setting
	STA	Drawf		; clear draw flag
	STA	BRindx		; clear read index
	STA	BWindx		; clear write index

	RTS


Last page update: 2nd May, 2002. e-mail me