Bunch of silly errors & debugging stuff.
[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         ;; turn display on
10         ldx #0x1000
11         bset 00,x #0x80
12
13         ;; start chiming
14         ldx #0x1000
15         bset 00,x #0x10
16
17         ;; enable the RTI
18         ldaa #0x40
19         staa 0x1024
20
21         ;; enable the ADC, and configure IRQ' for edge-sensitive operation
22         ldaa #0xa0
23         staa 0x1039
24
25         ;; set RTI intervals, and PA3/7 DDRs
26         ldaa #0x81
27         staa 0x1026  ;; RTI interval becomes E/2^14 = 6.6ms (or 150 Hz)
28
29         ;; stop chiming
30         ldx #0x1000
31         bclr 00,x #0x10
32
33         ;; clear ADC register
34         clra
35         staa 0x1030
36
37         ;; set the stack pointer
38         lds #_stack
39
40         ;; start chiming
41         ldx #0x1000
42         bset 00,x #0x10
43
44         ;; blank initialised variables - should match memory.x's page0
45         ldx #0x0000
46 loop1:
47         cpx #0x0080
48         bcc out1
49         clr 00,x
50         inx
51         bra loop1
52 out1:
53
54         ;; wait a while
55         ldx #0x0000
56 loop2:
57         cpx #0x00ff
58         bcc out2
59         clr 00,x
60         inx
61         bra loop2
62 out2:
63
64         ;; stop chiming
65         ldx #0x1000
66         bclr 00,x #0x10
67
68         jsr main
69
70 infinity:
71         bra infinity

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