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