Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/clock2_disto2.asm @ 2758:e4a0f58a5f9b
Found that people who do not have the envirornment variable NITROS9DIR set before building the project get a error missing file "/rules.mak". Found this is caused do to the fact that the code to set this envirornment variable is in the rules.mak which can't get loaded.
To fix this the code needed to set the envirornment variable that is in the rules.mak is now in the makefile(s) right before the include for the rules.mak file. This should fix the problem for those who do not have the NITROS9DIR envirornment variable preset.
author | drencor-xeen |
---|---|
date | Mon, 14 Jan 2013 14:37:46 -0600 |
parents | f389c6bca482 |
children |
rev | line source |
---|---|
1724
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
1 ******************************************************************** |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
2 * Clock2 - Disto 2-N-1 RTC Driver |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
3 * |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
4 * $Id$ |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
5 * |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
6 * Edt/Rev YYYY/MM/DD Modified by |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
7 * Comment |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
8 * ------------------------------------------------------------------ |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
9 * 1 2004/08/18 Boisy G. Pitre |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
10 * Separated clock2 modules for source clarity. |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
11 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
12 nam Clock2 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
13 ttl Disto 2-N-1 RTC Driver |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
14 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
15 ifp1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
16 use defsfile |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
17 endc |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
18 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
19 tylg set Sbrtn+Objct |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
20 atrv set ReEnt+rev |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
21 rev set $00 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
22 edition set 1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
23 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
24 RTC.Base equ $FF50 Base address of clock |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
25 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
26 mod eom,name,tylg,atrv,JmpTable,RTC.Base |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
27 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
28 name fcs "Clock2" |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
29 fcb edition |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
30 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
31 IFNE MPIFlag |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
32 SlotSlct fcb MPI.Slot-1 Slot constant for MPI select code |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
33 ENDC |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
34 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
35 JmpTable |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
36 rts RTC Init |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
37 nop |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
38 nop |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
39 bra GetTime RTC Get Time |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
40 nop |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
41 bra SetTime RTC Set Time |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
42 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
43 GetTime pshs a,cc Save old interrupt status and mask IRQs |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
44 bsr RTCPre |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
45 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
46 bsr GetVal Get Year |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
47 bsr GetVal Get Month |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
48 bsr GetVal Get Day |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
49 decb ldb #5 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
50 stb 2,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
51 decb |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
52 lda ,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
53 anda #3 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
54 bsr GetVal1 Get Hour |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
55 bsr GetVal Get Minute |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
56 bsr GetVal Get Second |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
57 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
58 RTCPost clr >$FFD9 2 MHz (Really should check $A0 first) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
59 puls cc,b |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
60 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
61 IFNE MPIFlag |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
62 stb >MPI.Slct Restore saved "currently" selected MPak slot |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
63 ENDC |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
64 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
65 clrb |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
66 rts |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
67 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
68 RTCPre orcc #IntMasks |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
69 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
70 IFNE MPIFlag |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
71 ldb >MPI.Slct Save currently selected MPak slot on stack |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
72 stb 3,s |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
73 andb #$F0 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
74 orb >SlotSlct,pcr Get slot to select |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
75 stb >MPI.Slct Select MPak slot for clock |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
76 ENDC |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
77 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
78 ldy #D.Time |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
79 ldx M$Mem,pcr |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
80 clr 1,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
81 ldb #12 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
82 clr >$FFD8 1 MHz |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
83 rts |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
84 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
85 GetVal stb 2,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
86 decb |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
87 lda ,x read tens digit from clock |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
88 anda #$0f |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
89 GetVal1 pshs b save b |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
90 ldb #10 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
91 mul multiply by 10 to get value |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
92 stb ,y save 10s value |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
93 puls b set up clock for ones digit |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
94 stb 2,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
95 decb |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
96 lda ,x read ones digit from clock |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
97 anda #$0f |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
98 adda ,y add ones + tens |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
99 sta ,y+ store clock value into time packet |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
100 rts |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
101 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
102 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
103 SetTime pshs a,cc |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
104 lbsr RTCPre Initialize |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
105 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
106 bsr SetVal Set Year |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
107 bsr SetVal Set Month |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
108 bsr SetVal Set Day |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
109 ldd #$0805 $08 in A, $05 in B |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
110 bsr SetVal1 Set Hour (OR value in A ($08) with hour) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
111 bsr SetVal Set Minute |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
112 bsr SetVal Set Second |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
113 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
114 lbra RTCPost Clean up + return |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
115 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
116 SetVal clra |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
117 SetVal1 stb 2,x Set Clock address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
118 decb |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
119 pshs b |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
120 ldb ,y+ Get current value |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
121 DvLoop subb #10 Get Tens digit in A, ones digit in B |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
122 bcs DvDone |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
123 inca |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
124 bra DvLoop |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
125 DvDone addb #10 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
126 sta ,x Store tens digit |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
127 tfr b,a |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
128 puls b Get back original clock address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
129 stb 2,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
130 decb |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
131 sta ,x Store ones digit |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
132 rts |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
133 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
134 emod |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
135 eom equ * |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
136 end |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
137 |