Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/clock2_dw3.asm @ 2422:61778d4bb634
Updated source to use labels from os9defs
author | boisy |
---|---|
date | Tue, 26 Jan 2010 19:39:19 +0000 |
parents | 9e3038c39b01 |
children | a34c08cdfcb2 |
rev | line source |
---|---|
2180 | 1 ******************************************************************** |
2 * Clock2 - DriveWire 3 RTC Driver | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Edt/Rev YYYY/MM/DD Modified by | |
7 * Comment | |
8 * ------------------------------------------------------------------ | |
9 * 1 2004/08/18 Boisy G. Pitre | |
10 * Separated clock2 modules for source clarity. | |
2308 | 11 * |
12 * 2 2010/01/02 Boisy G. Pitre | |
13 * Saved some bytes by optimizing | |
2180 | 14 |
15 nam Clock2 | |
16 ttl DriveWire 3 RTC Driver | |
17 | |
18 ifp1 | |
19 use defsfile | |
20 endc | |
21 | |
22 tylg set Sbrtn+Objct | |
23 atrv set ReEnt+rev | |
24 rev set $00 | |
2308 | 25 edition set 2 |
2180 | 26 |
27 | |
28 RTC.Base equ $0000 | |
29 | |
30 mod eom,name,tylg,atrv,JmpTable,RTC.Base | |
31 | |
32 name fcs "Clock2" | |
33 fcb edition | |
34 | |
35 subname fcs "dw3" | |
36 | |
37 * Three Entry Points: | |
38 * - Init | |
39 * - GetTime | |
40 * - SetTIme | |
41 JmpTable | |
42 bra Init | |
43 nop | |
44 bra GetTime RTC Get Time | |
45 nop | |
46 ex rts RTC Set Time | |
47 | |
2308 | 48 GetTime pshs u,y,x,b |
2180 | 49 lda #'# Time packet |
2308 | 50 sta ,s |
2180 | 51 leax ,s |
52 ldy #$0001 | |
2308 | 53 IFGT Level-1 |
54 ldu <D.DWSubAddr | |
55 ELSE | |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2231
diff
changeset
|
56 ldu >D.DWSubAddr |
2308 | 57 ENDC |
58 beq UpdLeave in case we failed to link it, just exit | |
2180 | 59 jsr 6,u |
60 * Consider the following optimization | |
2231
27f07aa0bca0
Updated modules to use Darren Atkinson's latest changes to low level read/write routines
boisy
parents:
2213
diff
changeset
|
61 ldx #D.Year |
2313 | 62 ldy #$0006 |
2180 | 63 jsr 3,u |
2308 | 64 UpdLeave puls b,x,y,u,pc |
2180 | 65 |
66 | |
2212 | 67 Init |
2309 | 68 * Check if subroutine already linked |
69 IFGT Level-1 | |
70 ldx <D.DWSubAddr | |
71 ELSE | |
72 ldx >D.DWSubAddr | |
73 ENDC | |
74 bne leave | |
2212 | 75 IFGT Level-1 |
76 ldx <D.Proc | |
77 pshs x | |
78 ldx <D.SysPrc | |
79 stx <D.Proc | |
80 ENDC | |
81 leax subname,pcr | |
2180 | 82 clra |
83 os9 F$Link | |
2212 | 84 IFGT Level-1 |
85 puls x | |
86 stx <D.Proc | |
2308 | 87 bcs ex |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2231
diff
changeset
|
88 sty <D.DWSubAddr |
2212 | 89 ELSE |
2180 | 90 bcs ex |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2231
diff
changeset
|
91 sty >D.DWSubAddr |
2212 | 92 ENDC |
2308 | 93 jmp ,y call initialization routine |
2309 | 94 leave rts |
2180 | 95 |
2213 | 96 emod |
2180 | 97 eom equ * |
98 end | |
99 |