Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/clock2_soft.asm @ 3130:e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Tidy up white-space and indentation.
Expand documentation to show C flag is important on return
from HWRead.
Expand documentation to show how/why/when filler is needed at
end of file.
Delete dead code in some places. No functional changes.
author | Neal Crook <foofoobedoo@gmail.com> |
---|---|
date | Sun, 04 Dec 2016 21:01:42 +0000 |
parents | 3244c2e1b6ed |
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 - Software Clock 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 2003/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 |
3089
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
12 nam Clock2 |
1724
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
13 ttl Software Clock Driver |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
14 |
3089
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
15 ifp1 |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
16 use defsfile |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
17 endc |
1724
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 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
25 RTC.Base equ 0 Have to have one defined. |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
26 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
27 mod len,name,Sbrtn+Objct,ReEnt+0,JmpTable,RTC.Base |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
28 |
3089
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
29 name fcs "Clock2" |
1724
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
30 fcb edition |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
31 |
3089
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
32 JmpTable |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
33 rts Init |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
34 nop |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
35 nop |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
36 bra GetTime Read |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
37 nop |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
38 rts Write |
1724
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
39 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
40 GetTime lda <D.Min grab current minute |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
41 inca minute+1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
42 cmpa #60 End of hour? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
43 blo UpdMin no, Set start of minute |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
44 ldd <D.Day get day, hour |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
45 incb hour+1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
46 cmpb #24 End of Day? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
47 blo UpdHour ..no |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
48 inca day+1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
49 leax <months-1,pcr point to months table with offset-1: Jan = +1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
50 ldb <D.Month this month |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
51 cmpa b,x end of month? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
52 bls UpdDay ..no, update the day |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
53 cmpb #2 yes, is it Feb? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
54 bne NoLeap ..no, ok |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
55 ldb <D.Year else get year |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
56 andb #$03 check for leap year: good until 2099 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
57 cmpd #$1D00 29th on leap year? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
58 beq UpdDay ..yes, skip it |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
59 NoLeap ldd <D.Year else month+1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
60 incb month+1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
61 cmpb #13 end of year? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
62 blo UpdMonth ..no |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
63 inca year+1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
64 ldb #$01 set month to jan |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
65 UpdMonth std <D.Year save year, month |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
66 lda #$01 day=1st |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
67 UpdDay clrb hour=midnite |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
68 UpdHour std <D.Day save day,hour |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
69 clra minute=00 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
70 UpdMin clrb seconds=00 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
71 std <D.Min save min,secs |
3089
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
72 UpdTExit rts |
1724
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
73 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
74 months fcb 31,28,31,30,31,30,31,31,30,31,30,31 Days in each month |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
75 |
3089
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
76 emod |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
77 len equ * |
3244c2e1b6ed
Add comments to jump table. Delete trailing whitespace.
Neal Crook <foofoobedoo@gmail.com>
parents:
1724
diff
changeset
|
78 end |
1724
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
79 |