Fleskó Gábor, Perlaki Attila
1 ; 2 ; ------------- 3 ; | Totem v2.0 | 4 ; | | 5 ; | (c) '90 PRL | 6 ; ------------- 7 ; 8 ; 9 ;Megrendelo: Miskolci Kozlekedesi Vallalat 10 ; 3502 MISKOLC Szondi Gy. u. 1. 11 ; 12 ; 13 14 0081 initcd: equ 81h 15 16 0003 com: equ 03h 17 0001 dig: equ 01h 18 0002 key: equ 02h 19 0002 detect: equ 02h 20 0002 light: equ 02h 21 22 0065 m.by: equ 101d 23 003D m.yp: equ 61d 24 003C m.pg: equ 60d 25 0033 m.gb: equ 51d 26 003C m.s: equ 60d 27 28 0040 ycode: equ 40h 29 00C0 bcode: equ c0h 30 0080 gcode: equ 80h 31 0000 dcode: equ 00h 32 33 0078 st1.bs: equ 120d 34 003C st2.bs: equ 60d 35 0078 w.bs: equ 120d 36 37 0600 timebs: equ 0600h 38 39 40 0000 org 0000h 41 0000 ED 56 reset: im 1 42 0002 3E 81 ld a,initcd 43 0004 D3 03 out (com),a 44 0006 ED 4F ld r,a 45 0008 21 00 06 exit: ld hl,timebs 46 000B FB ei 47 000C 76 halt 48 000D 49 000F org 000fh 50 000F D9 watch: exx 51 0010 7B we: ld a,e 52 0011 FE 3B cp 59d 53 0013 D2 33 00 jp nc,wei 54 0016 1E FF ld e,-1 55 0018 7A wd: ld a,d 56 0019 FE 3B cp 59d 57 001B D2 32 00 jp nc,wdi 58 001E 16 FF ld d,-1 59 0020 79 wc: ld a,c 60 0021 FE 17 cp 23d 61 0023 D2 31 00 jp nc,wci 62 0026 0E FF ld c,-1 63 0028 78 wb: ld a,b 64 0029 FE 09 cp 9d 65 002B D2 30 00 jp nc,wbi 66 002E 06 02 ld b,2d 67 0030 04 wbi: inc b 68 0031 0C wci: inc c 69 0032 14 wdi: inc d 70 0033 1C wei: inc e 71 0034 D9 exx 72 0035 C3 42 00 jp mode 73 0038 74 0038 org 0038h 75 0038 F3 int: di 76 0039 2B dec hl 77 003A AF xor a 78 003B B4 or h 79 003C B5 or l 80 003D CA 0F 00 jp z,watch 81 0040 FB ei 82 0041 76 halt 83 0042 84 0042 org 0042h 85 0042 ED 5F mode: ld a,r 86 0044 FA 40 01 jp m,setup 87 0047 AF xor a 88 0048 BB cp e 89 0049 C2 A5 00 jp nz,start 90 004C BA cp d 91 004D C2 D1 00 jp nz,wait 92 0050 DB 02 net: in a,(key) 93 0052 CB 4F bit 1,a 94 0054 CA A0 00 jp z,sinit 95 0057 CB 57 bit 2,a 96 0059 CA F0 00 jp z,black 97 005C C3 80 00 jp calc 98 005F 99 0062 org 0062h 100 0062 23 alarm: inc hl 101 0063 7C ld a,h 102 0064 D3 02 out (light),a 103 0066 18 FA nmi: jr alarm 104 0068 105 0080 org 0080h 106 0080 D9 calc: exx 107 0081 79 ld a,c 108 0082 0F rrca 109 0083 0F rrca 110 0084 67 ld h,a 111 0085 E6 C0 and c0h 112 0087 82 add a,d 113 0088 6F ld l,a 114 0089 7C ld a,h 115 008A E6 0F and 0fh 116 008C C6 02 add a,02h 117 008E 67 ld h,a 118 008F 23 inc hl 119 0090 ED 57 ld a,i 120 0092 A6 and (hl) 121 0093 CB 60 bit 4,b 122 0095 D9 exx 123 0096 20 04 jr nz,fday 124 0098 E6 0F wday: and 0fh 125 009A 18 02 jr conta 126 009C E6 F0 fday: and f0h 127 009E 20 02 conta: jr nz,contb 128 00A0 1E 78 sinit: ld e,st1.bs 129 00A2 C3 F0 00 contb: jp black 130 00A5 131 00A5 org 00a5h 132 00A5 DB 02 start: in a,(detect) 133 00A7 47 ld b,a 134 00A8 1D dec e 135 00A9 7B ld a,e 136 00AA FE 65 cp m.by 137 00AC D2 F0 00 jp nc,black 138 00AF FE 3D cp m.yp 139 00B1 D2 E4 00 jp nc,yellow 140 00B4 CB 60 bit 4,b 141 00B6 C2 C6 00 jp nz,winit 142 00B9 FE 3C cp m.pg 143 00BB D2 E8 00 jp nc,beep 144 00BE FE 33 cp m.gb 145 00C0 D2 EC 00 jp nc,green 146 00C3 C3 F0 00 jp black 147 00C6 FE 3C winit: cp m.s 148 00C8 20 02 jr nz,gone 149 00CA 16 78 ld d,w.bs 150 00CC 1E 00 gone: ld e,0 151 00CE C3 F0 00 jp black 152 00D1 DB 02 wait: in a,(detect) 153 00D3 CB 67 bit 4,a 154 00D5 C2 DF 00 jp nz,contw 155 00D8 16 00 ld d,0 156 00DA 1E 3C ld e,st2.bs 157 00DC C3 F0 00 jp black 158 00DF 15 contw: dec d 159 00E0 EE 40 flash: xor ycode 160 00E2 18 0E jr disp 161 00E4 3E 40 yellow: ld a,ycode 162 00E6 18 0A jr disp 163 00E8 3E C0 beep: ld a,bcode 164 00EA 18 06 jr disp 165 00EC 3E 80 green: ld a,gcode 166 00EE 18 02 jr disp 167 00F0 3E 00 black: ld a,dcode 168 00F2 D3 02 disp: out (light),a 169 00F4 CF rst 8 170 00F5 171 0140 org 0140h 172 0140 D9 setup: exx 173 0141 1C inc e 174 0142 1D dec e 175 0143 D9 exx 176 0144 C2 64 01 jp nz,conf 177 0147 DB 02 get: in a,(key) 178 0149 CB 4F bit 1,a 179 014B 28 09 jr z,step 180 014D CB 57 bit 2,a 181 014F 28 07 jr z,page 182 0151 CB 5F bit 3,a 183 0153 28 05 jr z,run 184 0155 CF rst 8 185 0156 186 0156 org 0156h 187 0156 DD E9 step: jp (ix) 188 0158 FD E9 page: jp (iy) 189 015A 11 00 00 run: ld de,0 190 015D AF xor a 191 015E D3 02 out (light),a 192 0160 ED 4F ld r,a 193 0162 CF rst 8 194 0163 195 0164 org 0164h 196 0164 D9 conf: exx 197 0165 01 09 17 ld bc,1709h 198 0168 11 00 3B ld de,3b00h 199 016B 21 00 01 ld hl,hbct 200 016E 3E 11 ld a,11h 201 0170 ED 47 ld i,a 202 0172 DD 21 62 00 ld ix,alarm 203 0176 FD 21 B0 01 ld iy,page0 204 017A D9 exx 205 017B C3 F0 00 jp black 206 017E 207 0180 org 0180h 208 0180 DD 21 C0 01 page3: ld ix,step3 209 0184 FD 21 B0 01 ld iy,page0 210 0188 D9 exx 211 0189 6A ld l,d 212 018A 7E ld a,(hl) 213 018B 00 nop 214 018C D9 exx 215 018D D3 01 out (dig),a 216 018F CF rst 8 217 0190 218 0190 org 0190h 219 0190 DD 21 D0 01 page2: ld ix,step2 220 0194 FD 21 80 01 ld iy,page3 221 0198 D9 exx 222 0199 69 ld l,c 223 019A 7E ld a,(hl) 224 019B 00 nop 225 019C D9 exx 226 019D D3 01 out (dig),a 227 019F CF rst 8 228 01A0 229 01A0 org 01a0h 230 01A0 DD 21 E0 01 page1: ld ix,step1 231 01A4 FD 21 90 01 ld iy,page2 232 01A8 D9 exx 233 01A9 78 ld a,b 234 01AA F6 D0 or d0h 235 01AC D9 exx 236 01AD D3 01 out (dig),a 237 01AF CF rst 8 238 01B0 239 01B0 org 01b0h 240 01B0 DD 21 F0 01 page0: ld ix,step0 241 01B4 FD 21 A0 01 ld iy,page1 242 01B8 00 nop 243 01B9 00 nop 244 01BA ED 57 ld a,i 245 01BC 00 nop 246 01BD D3 01 out (dig),a 247 01BF CF rst 8 248 01C0 249 01C0 org 01c0h 250 01C0 D9 step3: exx 251 01C1 7A ld a,d 252 01C2 FE 3B cp 59d 253 01C4 20 02 jr nz,cont3 254 01C6 16 FF ld d,-1 255 01C8 14 cont3: inc d 256 01C9 D9 exx 257 01CA C3 80 01 jp page3 258 01CD 259 01D0 org 01d0h 260 01D0 D9 step2: exx 261 01D1 79 ld a,c 262 01D2 FE 17 cp 23d 263 01D4 20 02 jr nz,cont2 264 01D6 0E FF ld c,-1 265 01D8 0C cont2: inc c 266 01D9 D9 exx 267 01DA C3 90 01 jp page2 268 01DD 269 01E0 org 01e0h 270 01E0 D9 step1: exx 271 01E1 78 ld a,b 272 01E2 FE 09 cp 9d 273 01E4 20 02 jr nz,cont1 274 01E6 06 02 ld b,2d 275 01E8 04 cont1: inc b 276 01E9 D9 exx 277 01EA C3 A0 01 jp page1 278 01ED 279 01F0 org 01f0h 280 01F0 ED 57 step0: ld a,i 281 01F2 0F rrca 282 01F3 ED 47 ld i,a 283 01F5 C3 B0 01 jp page0 284 01F8 285 0100 org 0100h 286 0100 00 01 02 03 04 hbct: db 00h,01h,02h,03h,04h 287 0105 05 06 07 08 09 db 05h,06h,07h,08h,09h 288 010A 10 11 12 13 14 db 10h,11h,12h,13h,14h 289 010F 15 16 17 18 19 db 15h,16h,17h,18h,19h 290 0114 20 21 22 23 24 db 20h,21h,22h,23h,24h 291 0119 25 26 27 28 29 db 25h,26h,27h,28h,29h 292 011E 30 31 32 33 34 db 30h,31h,32h,33h,34h 293 0123 35 36 37 38 39 db 35h,36h,37h,38h,39h 294 0128 40 41 42 43 44 db 40h,41h,42h,43h,44h 295 012D 45 46 47 48 49 db 45h,46h,47h,48h,49h 296 0132 50 51 52 53 54 db 50h,51h,52h,53h,54h 297 0137 55 56 57 58 59 db 55h,56h,57h,58h,59h 298 013C 299 0068 org 0068h 300 0068 28 63 29 20 50 author: db "(c) PRL" 006D 52 4C 301 006F 302 0200 org 0200h 303 0200 data: ds 0600h 304 0800