add credit, add 013 debug timer message on keypress
[uccvend-snackrom.git] / ROM2 / start.s
1 .sect .text
2 .globl _start
3
4 _start:
5         ;; set port a to output
6         ldab #0xfc  ; 11111000
7         stab 0x1001
8
9         ;; start chiming
10         ldx #0x1000
11         bset 00,x #0x10
12
13         ;; enable the RTI
14         ldaa #0x40
15         staa 0x1024
16
17         ;; enable the ADC, and configure IRQ' for edge-sensitive operation
18         ldaa #0xa0
19         staa 0x1039
20
21         ;; set RTI intervals, and PA3/7 DDRs
22         ldaa #0x81
23         staa 0x1026  ;; RTI interval becomes E/2^14 = 6.6ms (or 150 Hz)
24
25         ;; clear ADC register
26         clra
27         staa 0x1030
28
29         ;; set the stack pointer
30         lds #_stack
31
32         ;; blank initialised variables - should match memory.x's page0
33         ldx #0x0000
34 loop1:
35         cpx #0x0100
36         bcc out1
37         clr 00,x
38         inx
39         bra loop1
40 out1:
41
42         ;; stop chiming
43         ldx #0x1000
44         bclr 00,x #0x10
45
46         jsr main
47
48 infinity:
49         bra infinity

UCC git Repository :: git.ucc.asn.au