            TITLE   INITIALIZATION MODULE

            CODE

            SEI                 ;disable all interrupts during init sequence
            LDAA    #$0A
            STAA    HPRIO       ;TIC3 has the highest priority
	    LDAA    #$05	;Enable CSPROG
	    STAA    CSCTL	;for a 32k memory
            LDAA    #$80        ;PA7 output
            STAA    DDRA
	    LDAA    #$20
	    STAA    DDRD        ;PD5 output
	    LDS     #RAMEND     ;init stack pointer
            JSR     ITIMER      ;init TOC2 timer
            JSR     IADC        ;init ADC
            JSR     ITIC3       ;init TIC3 timer
	    JSR     ISPI	;init SPI used by display
	    JSR     INITVAR	;init variables
            CLI                 ;enable interrupts

            END
