Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/clock2_elim.asm @ 2152:74fb212cb659
Changelog comes from higher up
author | boisy |
---|---|
date | Wed, 14 May 2008 02:13:22 +0000 |
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 - Eliminator 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 Eliminator 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.Sped equ $20 32.768 KHz, rate=0 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
25 RTC.Strt equ $06 binary, 24 Hour, DST disabled |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
26 RTC.Stop equ $86 bit 7 set stops clock to allow setting time |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
27 RTC.Base equ $FF72 I don't know base for this chip. |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
28 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
29 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
|
30 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
31 name fcs "Clock2" |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
32 fcb edition |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
33 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
34 JmpTable |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
35 lbra Init |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
36 bra GetTime |
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 lbra SetTime |
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 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
41 GetTime ldx M$Mem,pcr get RTC base address from fake memory requirement |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
42 ldb #$0A UIP status register address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
43 stb ,x generate address strobe |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
44 lda 1,x get UIP status |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
45 bpl NoUIP Update In Progress, go shift next RTC read |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
46 lda #TkPerSec/2 set up next RTC read attempt in 1/2 second |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
47 sta <D.Tick save tick |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
48 bra UpdTExit and return |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
49 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
50 NoUIP decb year register address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
51 stb ,x generate address strobe |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
52 lda 1,x get year |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
53 sta <D.Year |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
54 decb month register address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
55 stb ,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
56 lda 1,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
57 sta <D.Month |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
58 decb day of month register address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
59 stb ,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
60 lda 1,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
61 sta <D.Day |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
62 ldb #4 hour register address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
63 stb ,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
64 lda 1,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
65 sta <D.Hour |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
66 ldb #2 minute register address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
67 stb ,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
68 lda 1,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
69 sta <D.Min |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
70 clrb second register address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
71 stb ,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
72 lda 1,x |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
73 SaveSec sta <D.Sec |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
74 UpdTExit rts |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
75 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
76 |
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 SetTime pshs cc save interrupt status |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
79 orcc #IntMasks disable IRQs |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
80 ldx M$Mem,pcr get RTC base address from fake memory requirement |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
81 ldy #D.Time point [Y] to time variables in DP |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
82 ldd #$0B*256+RTC.Stop |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
83 bsr UpdatCk0 stop clock before setting it |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
84 ldb #RTC.Sped |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
85 bsr UpdatCk0 set crystal speed, output rate |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
86 bsr UpdatClk go set year |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
87 bsr UpdatClk go set month |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
88 bsr UpdatClk go set day of month |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
89 bsr UpdatCk0 go set day of week (value doesn't matter) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
90 bsr UpdatCk0 go set hours alarm (value doesn't matter) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
91 bsr UpdatClk go set hour |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
92 bsr UpdatCk0 go set minutes alarm (value doesn't matter) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
93 bsr UpdatClk go set minute |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
94 bsr UpdatCk0 go set seconds alarm (value doesn't matter) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
95 bsr UpdatClk go set second |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
96 ldd #$0B*256+RTC.Strt |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
97 bsr UpdatCk0 go start clock |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
98 puls cc Recover IRQ status |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
99 clrb |
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 UpdatClk ldb ,y+ get data from D.Time variables in DP |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
103 UpdatCk0 std ,x generate address strobe, save data |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
104 deca set [A] to next register down |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
105 rts |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
106 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
107 IFGT Level-1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
108 * OS-9 Level Two code only (for now) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
109 NewSvc fcb F$NVRAM Eliminator adds one new service call |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
110 fdb F.NVRAM-*-2 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
111 fcb $80 end of service call installation table |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
112 |
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 * read/write RTC Non Volatile RAM (NVRAM) |
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 * INPUT: [U] = pointer to caller's register stack |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
117 * R$A = access mode (1 = read, 2 = write, other = error) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
118 * R$B = byte count (1 through 50 here, but in other implementations |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
119 * may be 1 through 256 where 0 implies 256) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
120 * R$X = address of buffer in user map |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
121 * R$Y = start address in NVRAM |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
122 * |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
123 * OUTPUT: RTC NVRAM read/written |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
124 * |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
125 * ERROR OUTPUT: [CC] = Carry set |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
126 * [B] = error code |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
127 F.NVRAM tfr u,y copy caller's register stack pointer |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
128 ldd #$0100 ask for one page |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
129 os9 F$SRqMem |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
130 bcs NVR.Exit go report error... |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
131 pshs y,u save caller's stack and data buffer pointers |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
132 ldx R$Y,y get NVRAM start address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
133 cmpx #50 too high? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
134 bhs Arg.Err yes, go return error... |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
135 ldb R$B,y get NVRAM byte count |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
136 beq Arg.Err |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
137 abx check end address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
138 cmpx #50 too high? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
139 bhi Arg.Err yes, go return error... |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
140 lda R$A,y get direction flag |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
141 cmpa #WRITE. put caller's data into NVRAM? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
142 bne ChkRead no, go check if read... |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
143 clra [D]=byte count |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
144 pshs d save it... |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
145 ldx <D.Proc get caller's process descriptor address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
146 lda P$Task,x caller is source task |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
147 ldb <D.SysTsk system is destination task |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
148 ldx R$X,y get caller's source pointer |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
149 puls y recover byte count |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
150 os9 F$Move go MOVE data |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
151 bcs NVR.Err |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
152 ldy ,s get caller's register stack pointer from stack |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
153 lda R$Y+1,y get NVRAM start address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
154 adda #$0E add offset to first RTC NVRAM address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
155 ldb R$B,y get byte count |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
156 ldx M$Mem,pcr get clock base address from fake memory requirement |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
157 pshs cc,b save IRQ enable status and byte counter |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
158 orcc #IntMasks disable IRQs |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
159 WrNVR.Lp ldb ,u+ get caller's data |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
160 std ,x generate RTC address strobe and save data to NVRAM |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
161 inca next NVRAM address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
162 dec 1,s done yet? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
163 bne WrNVR.Lp no, go save another byte |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
164 puls cc,b recover IRQ enable status and clean up stack |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
165 NVR.RtM puls y,u recover register stack & data buffer pointers |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
166 ldd #$0100 return one page |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
167 os9 F$SRtMem |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
168 NVR.Exit rts |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
169 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
170 Arg.Err ldb #E$IllArg Illegal Argument error |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
171 bra NVR.Err |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
172 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
173 ChkRead cmpa #READ. return NVRAM data to caller? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
174 bne Arg.Err illegal access mode, go return error... |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
175 lda R$Y+1,y get NVRAM start address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
176 adda #$0E add offset to first RTC NVRAM address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
177 ldx M$Mem,pcr get clock base address from fake memory requirement |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
178 pshs cc,b save IRQ enable status and byte counter |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
179 orcc #IntMasks disable IRQs |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
180 RdNVR.Lp sta ,x generate RTC address strobe |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
181 ldb 1,x get NVRAM data |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
182 stb ,u+ save it to buffer |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
183 inca next NVRAM address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
184 dec 1,s done yet? |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
185 bne RdNVR.Lp no, go get another byte |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
186 puls cc,a recover IRQ enable status, clean up stack ([A]=0) |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
187 ldb R$B,y [D]=byte count |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
188 pshs d save it... |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
189 ldx <D.Proc get caller's process descriptor address |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
190 ldb P$Task,x caller is source task |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
191 lda <D.SysTsk system is destination task |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
192 ldu R$X,y get caller's source pointer |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
193 puls y recover byte count |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
194 ldx 2,s get data buffer (source) pointer |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
195 os9 F$Move go MOVE data |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
196 bcc NVR.RtM |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
197 NVR.Err puls y,u recover caller's stack and data pointers |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
198 pshs b save error code |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
199 ldd #$0100 return one page |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
200 os9 F$SRtMem |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
201 comb set Carry for error |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
202 puls b,pc recover error code, return... |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
203 ENDC |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
204 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
205 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
206 Init equ * |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
207 IFGT Level-1 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
208 * Eliminator will install specific system calls |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
209 leay NewSvc,pcr insert syscalls |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
210 os9 F$SSvc |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
211 ENDC |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
212 rts |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
213 |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
214 emod |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
215 eom equ * |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
216 end |
f389c6bca482
New clock2_*.asm files split from single clock2.asm for more source clarity
boisy
parents:
diff
changeset
|
217 |