c37026396bd7ad4f54fd1a81b0e2871dfa16c8e4
[uccvend-snackrom.git] / ROM2 / start.s
1 .sect .text
2 .globl _start
3
4 _start:
5         ;; enable the RTI
6         ldaa #0x40
7         staa 0x1024
8
9         ;; enable the ADC, and configure IRQ' for edge-sensitive operation
10         ldaa #0xa0
11         staa 0x1039
12
13         ;; set RTI intervals, and PA3/7 DDRs
14         ldaa #0x81
15         staa 0x1026
16
17         ;; clear ADC register
18         clra
19         staa 0x1030
20
21         ;; set the stack pointer
22         lds _stack
23
24         ;; blank initialised variables - should match memory.x's page0
25         ldx #0x0000
26 loop1:
27         cpx #0x0080
28         bcc out1
29         clr 00,x
30         inx
31         bra loop1
32 out1:
33
34         jsr main
35
36 infinity:
37         bra infinity

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