annotate 3rdparty/utils/smartwatch/getclk.asm @ 3226:9749d0dfc4a2

Changed a puls PC to rts to save cycles
author David Ladd <drencor-xeen@users.sourceforge.net>
date Sat, 20 Jan 2018 19:32:22 -0600
parents b8c7b7fbf3c9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 nam getclk
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 ttl program module
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * Disassembled 98/06/01 09:08:21 by Disasm v1.5 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 ifp1
2624
b8c7b7fbf3c9 Major changes:
Boisy Pitre <boisy.pitre@nuance.com>
parents: 0
diff changeset
7 use defsfile
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 * MPI slot selection code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 * $33 = Slot 4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 * $22 = Slot 3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 * $11 = Slot 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 * $00 = Slot 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 MPISlot equ $33
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 rev set $02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 SWSubr rmb 202
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 ROMAddr rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 Blk0Addr rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 u00CE rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 TmpSecs rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 NumSecs rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 TimePckt rmb 6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 rmb 200
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 name fcs /getclk/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 fcb $02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 start equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 clr <u00CE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 cmpd #$0002
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 bcs L003F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 com <u00CE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 ldd ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 cmpb #$0D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 beq ProcParm
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 subd #$2F30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 L0027 suba #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 beq L0037
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 addb #$0A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 bra L0027
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 * process parameter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 ProcParm suba #$30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 cmpa #$09
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 bcc L0093
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 L0037 cmpb #$3C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 bcc L0093
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 stb <TmpSecs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 stb <NumSecs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 L003F leax ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 leay >L0098,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 ldb #$88
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 L0047 lda ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 sta ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 bne L0047
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 L004E pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 ldx #$003E X holds ROM block
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 incb set B to 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 os9 F$MapBlk map into our addr space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 leax ,u set X to address of ROM block
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 stx <ROMAddr save X
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 ldx #$0000 get block zero (OS-9 globs, etc)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 os9 F$MapBlk map into our address space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 leax ,u point X to U
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 stx <Blk0Addr save X
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 jsr <SWSubr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 ldb #1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 ldu <ROMAddr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 os9 F$ClrBlk clear this block from our space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 ldu <Blk0Addr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 os9 F$ClrBlk clear this block from our space
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 os9 F$STime
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 bcs L0095
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 tst <u00CE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 beq L0095
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 L0083 ldx #$0DD0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 os9 F$Sleep
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 dec <TmpSecs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 bne L0083
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 lda <NumSecs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 sta <TmpSecs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 bra L004E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 L0093 ldb #E$IllArg
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 L0095 os9 F$Exit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 * X = address of time packet with time from SW
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 L0098 pshs cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 orcc #FIRQMask+IRQMask
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 lda $FF7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 ldb >D.HINIT,x get GIME INT0 value in OS-9 globs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 ldx <ROMAddr point X to rom block address
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 pshs b,a save GIME INT0 value/MPI slot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 lda #MPISlot get slot where SW is
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 sta $FF7F select it
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 andb #$FC 16x16 ROM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 stb >$FF90 save it in HW
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 leay >L0117,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 sta >$FFDE put CC3 in ROM mode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 lda $04,x read ROM block (trigger SW?)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 L00BA ldb #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 lda ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 beq L00CD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 L00C0 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 bcs L00C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 tst ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 fcb $8C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 L00C6 fdb $6D01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 beq L00BA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 bra L00C0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 L00CD lda #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 L00CF ldb #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 L00D3 ldb 4,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 lsrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 rora
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 dec 1,s dec count (B) on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 bne L00D3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 bsr L0107
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 stb 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 puls a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 bne L00CF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 sta >$FFDF put in ALL RAM Mode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 leax >TimePckt,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 ldd ,s get year/Month
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 std ,x save year/month
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 lda 2,s get day
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 sta 2,x save day
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 ldd 4,s get hour/min
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 std 3,x save hour/min
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 lda 6,s get seconds
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 sta 5,x save seconds
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 leas 8,s clean stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 puls b,a get GIME INT0, org MPI slot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 sta >$FF7F restore org MPI slot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 stb >$FF90 restore org GIME INT0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 puls pc,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 L0107 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 L0108 cmpa #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 bcs L0112
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 suba #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 addb #$0A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 bra L0108
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 L0112 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 addb ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 L0117 fcb $C5,$3A,$A3,$5C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 fcb $C5,$3A,$A3,$5C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 fcb $00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 end