-
Notifications
You must be signed in to change notification settings - Fork 0
/
subroutines.ls
1430 lines (1430 loc) · 67.5 KB
/
subroutines.ls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1 ; C Compiler for STM8 (COSMIC Software)
2 ; Parser V4.11.10 - 06 Jul 2017
3 ; Generator (Limited) V4.4.7 - 05 Oct 2017
4 ; Optimizer V4.4.7 - 05 Oct 2017
68 ; 9 void ButtonsService (void)
68 ; 10 {
70 switch .text
71 0000 _ButtonsService:
73 00000001 OFST: set 1
76 ; 13 Taskboard.ButtonsPolling = Clear;
78 0000 72110000 bres _Taskboard,#0
79 0004 88 push a
80 ; 15 if (CounterButtonsDelay != 0)
82 0005 c60000 ld a,_CounterButtonsDelay
83 0008 2603cc010c jreq L52
84 ; 17 CounterButtonsDelay--;
86 000d 725a0000 dec _CounterButtonsDelay
87 ; 18 if (CounterButtonsDelay == 0)
89 0011 2703cc011b jrne L17
90 ; 20 NewStateButtons = GPIO_ReadInputData ( GPIOB );
92 0016 ae5005 ldw x,#20485
93 0019 cd0000 call _GPIO_ReadInputData
95 001c 6b01 ld (OFST+0,sp),a
97 ; 117 if (((StateButtons & 0x40) == 0) && ((NewStateButtons & 0x40) != 0))
99 001e 720c00004b btjt _StateButtons,#6,L13
101 0023 a540 bcp a,#64
102 0025 2747 jreq L13
103 ; 119 BeepTimeCounter = 0;
105 0027 725f0000 clr _BeepTimeCounter
106 ; 120 BEEP->CSR &= ~BEEP_CSR_BEEPEN;
108 002b 721b50f3 bres 20723,#5
109 ; 122 if (Device.State == Stop)
111 002f 720a00001b btjt _Device,#5,L33
112 ; 124 if ((RealTimeSecond != 0) | (RealTimeMinute != 0))
114 0034 c60000 ld a,_RealTimeSecond
115 0037 2605 jrne L73
117 0039 c60000 ld a,_RealTimeMinute
118 003c 2730 jreq L13
119 003e L73:
120 ; 126 Device.State = Start;
122 003e 721a0000 bset _Device,#5
123 ; 127 LedData |= LedStart;
125 0042 721c0000 bset _LedData,#6
126 ; 128 RealTimeCounter = 0;
128 0046 725f0000 clr _RealTimeCounter
129 ; 129 FunctionStartGenerator();
131 004a cd07c6 call _FunctionStartGenerator
133 004d 201f jra L13
134 004f L33:
135 ; 134 Device.State = Stop;
137 004f 721b0000 bres _Device,#5
138 ; 136 Device2.TestMode = Clear;
140 0053 72190000 bres _Device2,#4
141 ; 138 LedData &=~ LedStart;
143 0057 721d0000 bres _LedData,#6
144 ; 140 FunctionStopGenerator();
146 005b cd0829 call _FunctionStopGenerator
148 ; 142 Device2.Chenal1Show = Set;
150 005e 72100000 bset _Device2,#0
151 ; 143 Device2.Chenal2Show = Set;
153 0062 72120000 bset _Device2,#1
154 ; 144 Device2.Chenal3Show = Set;
156 0066 72140000 bset _Device2,#2
157 ; 145 Device2.Chenal4Show = Set;
159 006a 72160000 bset _Device2,#3
160 006e L13:
161 ; 151 if (((StateButtons & 0x20) == 0) && ((NewStateButtons & 0x20) != 0))
163 006e 720a00004e btjt _StateButtons,#5,L34
165 0073 7b01 ld a,(OFST+0,sp)
166 0075 a520 bcp a,#32
167 0077 2748 jreq L34
168 ; 153 LedData &=~(LedA|LedB|LedC);
170 0079 c60000 ld a,_LedData
171 007c a4c7 and a,#199
172 007e c70000 ld _LedData,a
173 ; 155 FunctionStopGenerator();
175 0081 cd0829 call _FunctionStopGenerator
177 ; 157 if (Device.Mode == ModeA)
179 0084 c60000 ld a,_Device
180 0087 a506 bcp a,#6
181 0089 260a jrne L54
182 ; 159 LedData |= LedB;
184 008b 721a0000 bset _LedData,#5
185 ; 160 Device.Mode = ModeB;
187 008f 72120000 bset _Device,#1
189 0093 201c jp LC001
190 0095 L54:
191 ; 164 if (Device.Mode == ModeB)
193 0095 a406 and a,#6
194 0097 a102 cp a,#2
195 0099 260e jrne L15
196 ; 166 LedData |= LedC;
198 009b 72180000 bset _LedData,#4
199 ; 167 Device.Mode = ModeC;
201 009f 72130000 bres _Device,#1
202 00a3 72140000 bset _Device,#2
204 00a7 200c jra L74
205 00a9 L15:
206 ; 171 LedData |= LedA;
208 00a9 72160000 bset _LedData,#3
209 ; 172 Device.Mode = ModeA;
211 00ad 72130000 bres _Device,#1
212 00b1 LC001:
213 00b1 72150000 bres _Device,#2
214 00b5 L74:
215 ; 176 if (Device.State == Start)
217 00b5 720b000007 btjf _Device,#5,L34
218 ; 178 RealTimeCounter = 0;
220 00ba 725f0000 clr _RealTimeCounter
221 ; 179 FunctionStartGenerator();
223 00be cd07c6 call _FunctionStartGenerator
225 00c1 L34:
226 ; 185 if (((StateButtons & 0x04) == 0) && ((NewStateButtons & 0x04) != 0))
228 00c1 720400003f btjt _StateButtons,#2,L75
230 00c6 7b01 ld a,(OFST+0,sp)
231 00c8 a504 bcp a,#4
232 00ca 2739 jreq L75
233 ; 187 LedData &=~(LedP|LedN|LedPN);
235 00cc c60000 ld a,_LedData
236 00cf a4f8 and a,#248
237 00d1 c70000 ld _LedData,a
238 ; 189 if (Device.Polarity == PolarityP)
240 00d4 c60000 ld a,_Device
241 00d7 a518 bcp a,#24
242 00d9 260a jrne L16
243 ; 191 LedData |= LedN;
245 00db 72120000 bset _LedData,#1
246 ; 192 Device.Polarity = PolarityN;
248 00df 72160000 bset _Device,#3
250 00e3 201c jp LC002
251 00e5 L16:
252 ; 196 if (Device.Polarity == PolarityN)
254 00e5 a418 and a,#24
255 00e7 a108 cp a,#8
256 00e9 260e jrne L56
257 ; 198 LedData |= LedPN;
259 00eb 72100000 bset _LedData,#0
260 ; 199 Device.Polarity = PolarityPN;
262 00ef 72170000 bres _Device,#3
263 00f3 72180000 bset _Device,#4
265 00f7 200c jra L75
266 00f9 L56:
267 ; 203 LedData |= LedP;
269 00f9 72140000 bset _LedData,#2
270 ; 204 Device.Polarity = PolarityP;
272 00fd 72170000 bres _Device,#3
273 0101 LC002:
274 0101 72190000 bres _Device,#4
275 0105 L75:
276 ; 210 StateButtons = NewStateButtons;
278 0105 7b01 ld a,(OFST+0,sp)
279 0107 c70000 ld _StateButtons,a
280 010a 200f jra L17
281 010c L52:
282 ; 215 NewStateButtons = GPIO_ReadInputData ( GPIOB );
284 010c ae5005 ldw x,#20485
285 010f cd0000 call _GPIO_ReadInputData
288 ; 216 if (NewStateButtons != StateButtons) CounterButtonsDelay = 20;
290 0112 c10000 cp a,_StateButtons
291 0115 2704 jreq L17
294 0117 35140000 mov _CounterButtonsDelay,#20
295 011b L17:
296 ; 218 }
299 011b 84 pop a
300 011c 81 ret
347 ; 223 void TimeService (void)
347 ; 224 {
348 switch .text
349 011d _TimeService:
353 ; 225 Taskboard.TimePolling = Clear;
355 011d 72150000 bres _Taskboard,#2
356 ; 227 if (BeepTimeCounter != 0)
358 0121 c60000 ld a,_BeepTimeCounter
359 0124 2733 jreq L121
360 ; 229 BeepTimeCounter++;
362 0126 725c0000 inc _BeepTimeCounter
363 ; 230 if (BeepTimeCounter == 125)
365 012a c60000 ld a,_BeepTimeCounter
366 012d a17d cp a,#125
367 012f 2628 jrne L121
368 ; 232 BeepTimeCounte2++;
370 0131 725c0000 inc _BeepTimeCounte2
371 ; 233 if (BeepTimeCounte2 == 30)
373 0135 c60000 ld a,_BeepTimeCounte2
374 0138 a11e cp a,#30
375 013a 260a jrne L521
376 ; 235 BeepTimeCounter = 0;
378 013c 725f0000 clr _BeepTimeCounter
379 ; 236 BEEP->CSR &= ~BEEP_CSR_BEEPEN;
381 0140 721b50f3 bres 20723,#5
383 0144 2013 jra L121
384 0146 L521:
385 ; 240 if ((BEEP->CSR & BEEP_CSR_BEEPEN) == 0) BEEP->CSR |= BEEP_CSR_BEEPEN;
387 0146 720a50f306 btjt 20723,#5,L131
390 014b 721a50f3 bset 20723,#5
392 014f 2004 jra L331
393 0151 L131:
394 ; 241 else BEEP->CSR &= ~BEEP_CSR_BEEPEN;
396 0151 721b50f3 bres 20723,#5
397 0155 L331:
398 ; 242 BeepTimeCounter = 1;
400 0155 35010000 mov _BeepTimeCounter,#1
401 0159 L121:
402 ; 247 if (Device.State == Start)
404 0159 720a000003cc btjf _Device,#5,L531
405 ; 250 RealTimeCounter++;
407 0161 725c0000 inc _RealTimeCounter
408 ; 252 if (Device.Mode == ModeB)
410 0165 c60000 ld a,_Device
411 0168 a406 and a,#6
412 016a a102 cp a,#2
413 016c 267a jrne L731
414 ; 254 if (RealTimeCounter == 250)
416 016e c60000 ld a,_RealTimeCounter
417 0171 a1fa cp a,#250
418 0173 2673 jrne L731
419 ; 256 CounterParselPeriod++;
421 0175 725c0000 inc _CounterParselPeriod
422 ; 257 switch (CounterParselPeriod)
424 0179 c60000 ld a,_CounterParselPeriod
426 ; 324 default : break;
427 017c a004 sub a,#4
428 017e 2706 jreq L57
429 0180 a004 sub a,#4
430 0182 2721 jreq L77
431 0184 2062 jra L731
432 0186 L57:
433 ; 261 TIM2_Cmd(DISABLE);
435 0186 cd0000 call _TIM2_Cmd
437 ; 265 Chenal1Enable = Clear;
439 0189 725f0000 clr _Chenal1Enable
440 ; 266 Chenal2Enable = Clear;
442 018d 725f0000 clr _Chenal2Enable
443 ; 268 Device2.Chenal1Show = Clear;
445 ; 269 Device2.Chenal2Show = Clear;
447 ; 274 Device2.Chenal3Show = Set;
449 ; 275 Device2.Chenal4Show = Set;
451 ; 277 Chenal3Enable = Set;
453 0191 c60000 ld a,_Device2
454 0194 a4fc and a,#252
455 0196 aa0c or a,#12
456 0198 c70000 ld _Device2,a
457 019b 35010000 mov _Chenal3Enable,#1
458 ; 278 Chenal4Enable = Set;
460 019f 35010000 mov _Chenal4Enable,#1
461 ; 280 TIM2_AutoreloadValue = 1000;
462 ; 281 TIM2_SetAutoreload(TIM2_AutoreloadValue);
464 ; 282 Device.Way = UpWay;
465 ; 283 CurrentPulsePeriod = 10000;
466 ; 284 Device.CnPol = PolarityP;
467 ; 286 TIM2_SetCounter(1);
469 ; 287 TIM2_Cmd(ENABLE);
471 ; 289 break;
473 01a3 2021 jp LC003
474 01a5 L77:
475 ; 293 TIM2_Cmd(DISABLE);
477 01a5 cd0000 call _TIM2_Cmd
479 ; 298 Chenal3Enable = Clear;
481 01a8 725f0000 clr _Chenal3Enable
482 ; 299 Chenal4Enable = Clear;
484 01ac 725f0000 clr _Chenal4Enable
485 ; 301 Device2.Chenal3Show = Clear;
487 ; 302 Device2.Chenal4Show = Clear;
489 ; 307 Device2.Chenal1Show = Set;
491 ; 308 Device2.Chenal2Show = Set;
493 ; 310 Chenal1Enable = Set;
495 01b0 c60000 ld a,_Device2
496 01b3 a4f3 and a,#243
497 01b5 aa03 or a,#3
498 01b7 c70000 ld _Device2,a
499 01ba 35010000 mov _Chenal1Enable,#1
500 ; 311 Chenal2Enable = Set;
502 01be 35010000 mov _Chenal2Enable,#1
503 ; 313 CounterParselPeriod = 0;
505 01c2 725f0000 clr _CounterParselPeriod
506 ; 314 TIM2_AutoreloadValue = 1000;
508 ; 315 TIM2_SetAutoreload(TIM2_AutoreloadValue);
511 ; 316 Device.Way = UpWay;
513 ; 317 CurrentPulsePeriod = 10000;
515 ; 318 Device.CnPol = PolarityP;
517 ; 320 TIM2_SetCounter(1);
520 ; 321 TIM2_Cmd(ENABLE);
522 01c6 LC003:
524 01c6 ae03e8 ldw x,#1000
525 01c9 cf0000 ldw _TIM2_AutoreloadValue,x
527 01cc cd0000 call _TIM2_SetAutoreload
529 01cf 721c0000 bset _Device,#6
531 01d3 ae2710 ldw x,#10000
532 01d6 cf0000 ldw _CurrentPulsePeriod,x
535 01d9 ae0001 ldw x,#1
536 01dc 721f0000 bres _Device,#7
537 01e0 cd0000 call _TIM2_SetCounter
539 01e3 a601 ld a,#1
540 01e5 cd0000 call _TIM2_Cmd
542 ; 322 break;
544 ; 324 default : break;
546 01e8 L731:
547 ; 329 if (Device.Mode == ModeA)
549 01e8 c60000 ld a,_Device
550 01eb a506 bcp a,#6
551 01ed 2628 jrne L741
552 ; 331 if (RealTimeCounter == 250)
554 01ef c60000 ld a,_RealTimeCounter
555 01f2 a1fa cp a,#250
556 01f4 2621 jrne L741
557 ; 333 CounterParselPeriod++;
559 01f6 725c0000 inc _CounterParselPeriod
560 ; 334 switch (CounterParselPeriod)
562 01fa c60000 ld a,_CounterParselPeriod
564 ; 350 default : break;
565 01fd a004 sub a,#4
566 01ff 2706 jreq L301
567 0201 a004 sub a,#4
568 0203 270f jreq L501
569 0205 2010 jra L741
570 0207 L301:
571 ; 338 FunctionStopGenerator();
573 0207 cd0829 call _FunctionStopGenerator
575 ; 339 Device2.Chenal1Show = Clear;
577 ; 340 Device2.Chenal2Show = Clear;
579 ; 341 Device2.Chenal3Show = Clear;
581 ; 342 Device2.Chenal4Show = Clear;
583 ; 343 break;
585 020a c60000 ld a,_Device2
586 020d a4f0 and a,#240
587 020f c70000 ld _Device2,a
588 0212 2003 jra L741
589 0214 L501:
590 ; 347 FunctionStartGenerator();
592 0214 cd07c6 call _FunctionStartGenerator
594 ; 348 break;
596 ; 350 default : break;
598 0217 L741:
599 ; 355 if (RealTimeCounter == 250)
601 0217 c60000 ld a,_RealTimeCounter
602 021a a1fa cp a,#250
603 021c 266e jrne L531
604 ; 358 RealTimeCounter = 0;
606 021e 725f0000 clr _RealTimeCounter
607 ; 360 if (Device2.TestMode == Set)
609 0222 720900000b btjf _Device2,#4,L161
610 ; 362 Device2.TestMode = Clear;
612 0227 72190000 bres _Device2,#4
613 ; 363 Device.State = Stop;
615 022b 721b0000 bres _Device,#5
616 ; 364 FunctionStopGenerator();
621 022f cc0829 jp _FunctionStopGenerator
622 0232 L161:
623 ; 368 if (RealTimeSecond == 0)
625 0232 c60000 ld a,_RealTimeSecond
626 0235 260a jrne L561
627 ; 370 RealTimeSecond = 59;
629 0237 353b0000 mov _RealTimeSecond,#59
630 ; 371 RealTimeMinute--;
632 023b 725a0000 dec _RealTimeMinute
634 023f 2004 jra L761
635 0241 L561:
636 ; 375 RealTimeSecond--;
638 0241 725a0000 dec _RealTimeSecond
639 0245 L761:
640 ; 378 if ((RealTimeSecond == 0)&&(RealTimeMinute == 0))
642 0245 c60000 ld a,_RealTimeSecond
643 0248 2624 jrne L171
645 024a c60000 ld a,_RealTimeMinute
646 024d 261f jrne L171
647 ; 381 Device.State = Stop;
649 024f 721b0000 bres _Device,#5
650 ; 382 LedData &=~ LedStart;
652 0253 721d0000 bres _LedData,#6
653 ; 384 FunctionStopGenerator();
655 0257 cd0829 call _FunctionStopGenerator
657 ; 386 Device2.Chenal1Show = Set;
659 ; 387 Device2.Chenal2Show = Set;
661 ; 388 Device2.Chenal3Show = Set;
663 ; 389 Device2.Chenal4Show = Set;
665 ; 391 BeepTimeCounter = 1;
667 025a c60000 ld a,_Device2
668 025d aa0f or a,#15
669 025f c70000 ld _Device2,a
670 0262 35010000 mov _BeepTimeCounter,#1
671 ; 392 BeepTimeCounte2 = 0;
673 0266 725f0000 clr _BeepTimeCounte2
674 ; 393 BEEP->CSR |= BEEP_CSR_BEEPEN;
676 026a 721a50f3 bset 20723,#5
677 026e L171:
678 ; 396 RealTimeSecondNumberShow = NumberToNumberShow(RealTimeSecond, Clear, Set);
680 026e 4b01 push #1
681 0270 c60000 ld a,_RealTimeSecond
682 0273 5f clrw x
683 0274 95 ld xh,a
684 0275 cd0657 call _NumberToNumberShow
686 0278 cf0000 ldw _RealTimeSecondNumberShow,x
687 027b 84 pop a
688 ; 397 RealTimeMinuteNumberShow = NumberToNumberShow(RealTimeMinute, LowPoint, Set);
690 027c 4b01 push #1
691 027e c60000 ld a,_RealTimeMinute
692 0281 ae0002 ldw x,#2
693 0284 95 ld xh,a
694 0285 cd0657 call _NumberToNumberShow
696 0288 cf0000 ldw _RealTimeMinuteNumberShow,x
697 028b 84 pop a
698 028c L531:
699 ; 402 }
702 028c 81 ret
798 ; 406 void EncoderService (void)
798 ; 407 {
799 switch .text
800 028d _EncoderService:
802 028d 5207 subw sp,#7
803 00000007 OFST: set 7
806 ; 410 unsigned short ChenalNumberTemp = 0;
808 ; 412 Taskboard.EncoderPolling = Clear;
810 028f 72130000 bres _Taskboard,#1
811 ; 414 NewStateEncoder1 = (GPIO_ReadInputData(GPIOA) & (E1A|E1B));
813 0293 ae5000 ldw x,#20480
814 0296 cd0000 call _GPIO_ReadInputData
816 0299 a418 and a,#24
817 029b 6b01 ld (OFST-6,sp),a
819 ; 415 NewStateEncoder2 = (GPIO_ReadInputData(GPIOA) & (E2A|E2B));
821 029d ae5000 ldw x,#20480
822 02a0 cd0000 call _GPIO_ReadInputData
824 02a3 a460 and a,#96
825 02a5 6b02 ld (OFST-5,sp),a
827 ; 416 NewStateEncoder3 = (GPIO_ReadInputData(GPIOG) & (E3A|E3B));
829 02a7 ae501e ldw x,#20510
830 02aa cd0000 call _GPIO_ReadInputData
832 02ad a403 and a,#3
833 02af 6b03 ld (OFST-4,sp),a
835 ; 417 NewStateEncoder4 = (GPIO_ReadInputData(GPIOE) & (E4A|E4B));
837 02b1 ae5014 ldw x,#20500
838 02b4 cd0000 call _GPIO_ReadInputData
840 02b7 a460 and a,#96
841 02b9 6b04 ld (OFST-3,sp),a
843 ; 418 NewStateEncoder5 = (GPIO_ReadInputData(GPIOE) & (E5A|E5B));
845 02bb ae5014 ldw x,#20500
846 02be cd0000 call _GPIO_ReadInputData
848 02c1 a409 and a,#9
849 02c3 6b05 ld (OFST-2,sp),a
851 ; 422 switch (StateEncoder1)
853 02c5 c60000 ld a,_StateEncoder1
855 ; 476 default : break;
856 02c8 270f jreq L371
857 02ca 4a dec a
858 02cb 2724 jreq L571
859 02cd 4a dec a
860 02ce 2731 jreq L771
861 02d0 4a dec a
862 02d1 274a jreq L102
863 02d3 4a dec a
864 02d4 275d jreq L302
865 02d6 cc0376 jra L713
866 02d9 L371:
867 ; 426 if ((NewStateEncoder1 & E1A) == 0) StateEncoder1 = 1;
869 02d9 7b01 ld a,(OFST-6,sp)
870 02db a508 bcp a,#8
871 02dd 2607 jrne L123
874 02df 35010000 mov _StateEncoder1,#1
876 02e3 cc0376 jra L713
877 02e6 L123:
878 ; 427 else if ((NewStateEncoder1 & E1B) == 0) StateEncoder1 = 3;
880 02e6 a510 bcp a,#16
881 02e8 26f9 jrne L713
884 02ea 35030000 mov _StateEncoder1,#3
885 02ee cc0376 jra L713
886 02f1 L571:
887 ; 432 if ((NewStateEncoder1 & E1A) == 0)
889 02f1 7b01 ld a,(OFST-6,sp)
890 02f3 a508 bcp a,#8
891 02f5 2636 jrne L343
892 ; 434 if ((NewStateEncoder1 & E1B) == 0) StateEncoder1 = 2;
894 02f7 a510 bcp a,#16
895 02f9 267b jrne L713
898 02fb 35020000 mov _StateEncoder1,#2
899 02ff 2075 jra L713
900 ; 436 else StateEncoder1 = 0;
901 0301 L771:
902 ; 441 if ((NewStateEncoder1 & E1B) != 0)
904 0301 7b01 ld a,(OFST-6,sp)
905 0303 a510 bcp a,#16
906 0305 276f jreq L713
907 ; 443 StateEncoder1 = 0;
909 0307 725f0000 clr _StateEncoder1
910 ; 444 if ((Chenal1Number<99) & (Device2.Chenal1Show == Set))
912 030b c60000 ld a,_Chenal1Number
913 030e a163 cp a,#99
914 0310 2464 jruge L713
916 0312 720100005f btjf _Device2,#0,L713
917 ; 446 Chenal1Number++;
919 0317 725c0000 inc _Chenal1Number
920 ; 447 ChenalNumberTemp = Chenal1Number;
921 ; 448 ChenalNumberTemp = (ChenalNumberTemp*2)/3;
922 ; 449 Chenal1NumberPWM = (unsigned char)ChenalNumberTemp;
923 ; 450 Chenal1NumberShow = NumberToNumberShow(Chenal1Number, Clear, Clear);
925 ; 451 RealTimeCounter = 0 ;
927 ; 452 if (Device.State == Stop) Taskboard.NeedTestPulse = Set;
929 031b 202e jp LC004
930 031d L102:
931 ; 457 case 3 : {if ((NewStateEncoder1 & E1B) == 0) {if ((NewStateEncoder1 & E1A) == 0) StateEncoder1 = 4;} else StateEncoder1 = 0; break;}
933 031d 7b01 ld a,(OFST-6,sp)
934 031f a510 bcp a,#16
935 0321 260a jrne L343
938 0323 a508 bcp a,#8
939 0325 264f jrne L713
942 0327 35040000 mov _StateEncoder1,#4
943 032b 2049 jra L713
944 032d L343:
948 032d 725f0000 clr _StateEncoder1
949 0331 2043 jra L713
950 0333 L302:
951 ; 460 if ((NewStateEncoder1 & E1A) != 0)
953 0333 7b01 ld a,(OFST-6,sp)
954 0335 a508 bcp a,#8
955 0337 273d jreq L713
956 ; 462 StateEncoder1 = 0;
958 0339 725f0000 clr _StateEncoder1
959 ; 463 if ((Chenal1Number>0) & (Device2.Chenal1Show == Set))
961 033d c60000 ld a,_Chenal1Number
962 0340 2734 jreq L713
964 0342 720100002f btjf _Device2,#0,L713
965 ; 465 Chenal1Number--;
967 0347 725a0000 dec _Chenal1Number
968 ; 466 ChenalNumberTemp = Chenal1Number;
970 ; 467 ChenalNumberTemp = (ChenalNumberTemp*2)/3;
972 ; 468 Chenal1NumberPWM = (unsigned char)ChenalNumberTemp;
974 ; 469 Chenal1NumberShow = NumberToNumberShow(Chenal1Number, Clear, Clear);
977 ; 470 RealTimeCounter = 0;
979 ; 471 if (Device.State == Stop) Taskboard.NeedTestPulse = Set;
983 034b LC004:
985 034b c60000 ld a,_Chenal1Number
986 034e 5f clrw x
987 034f 97 ld xl,a
990 0350 58 sllw x
991 0351 a603 ld a,#3
992 0353 62 div x,a
993 0354 1f06 ldw (OFST-1,sp),x
996 0356 7b07 ld a,(OFST+0,sp)
997 0358 c70000 ld _Chenal1NumberPWM,a
999 035b 4b00 push #0
1000 035d c60000 ld a,_Chenal1Number
1001 0360 5f clrw x
1002 0361 95 ld xh,a
1003 0362 cd0657 call _NumberToNumberShow
1004 0365 cf0000 ldw _Chenal1NumberShow,x
1005 0368 725f0000 clr _RealTimeCounter
1006 036c 84 pop a
1008 036d 720a000004 btjt _Device,#5,L713
1010 0372 72180000 bset _Taskboard,#4
1011 ; 476 default : break;
1013 0376 L713:
1014 ; 479 switch (StateEncoder2)
1016 0376 c60000 ld a,_StateEncoder2
1018 ; 520 default : break;
1019 0379 270f jreq L702
1020 037b 4a dec a
1021 037c 2724 jreq L112
1022 037e 4a dec a
1023 037f 2731 jreq L312
1024 0381 4a dec a
1025 0382 274a jreq L512
1026 0384 4a dec a
1027 0385 275d jreq L712
1028 0387 cc0427 jra L163
1029 038a L702:
1030 ; 481 case 0 : {if ((NewStateEncoder2 & E2A) == 0) StateEncoder2 = 1; else if ((NewStateEncoder2 & E2B) == 0) StateEncoder2 = 3; break;}
1032 038a 7b02 ld a,(OFST-5,sp)
1033 038c a520 bcp a,#32
1034 038e 2607 jrne L363
1037 0390 35010000 mov _StateEncoder2,#1
1039 0394 cc0427 jra L163
1040 0397 L363:
1043 0397 a540 bcp a,#64
1044 0399 26f9 jrne L163
1047 039b 35030000 mov _StateEncoder2,#3
1048 039f cc0427 jra L163
1049 03a2 L112:
1050 ; 482 case 1 : {if ((NewStateEncoder2 & E2A) == 0) {if ((NewStateEncoder2 & E2B) == 0) StateEncoder2 = 2;} else StateEncoder2 = 0; break;}
1052 03a2 7b02 ld a,(OFST-5,sp)
1053 03a4 a520 bcp a,#32
1054 03a6 2636 jrne L504
1057 03a8 a540 bcp a,#64
1058 03aa 267b jrne L163
1061 03ac 35020000 mov _StateEncoder2,#2
1062 03b0 2075 jra L163
1064 03b2 L312:
1065 ; 485 if ((NewStateEncoder2 & E2B) != 0)
1067 03b2 7b02 ld a,(OFST-5,sp)
1068 03b4 a540 bcp a,#64
1069 03b6 276f jreq L163
1070 ; 487 StateEncoder2 = 0;
1072 03b8 725f0000 clr _StateEncoder2
1073 ; 488 if ((Chenal2Number<99) & (Device2.Chenal2Show == Set))
1075 03bc c60000 ld a,_Chenal2Number
1076 03bf a163 cp a,#99
1077 03c1 2464 jruge L163
1079 03c3 720300005f btjf _Device2,#1,L163
1080 ; 490 Chenal2Number++;
1082 03c8 725c0000 inc _Chenal2Number
1083 ; 491 ChenalNumberTemp = Chenal2Number;
1084 ; 492 ChenalNumberTemp = (ChenalNumberTemp*2)/3;
1085 ; 493 Chenal2NumberPWM = (unsigned char)ChenalNumberTemp;
1086 ; 494 Chenal2NumberShow = NumberToNumberShow(Chenal2Number, Clear, Clear);
1088 ; 495 RealTimeCounter = 0;
1090 ; 496 if (Device.State == Stop) Taskboard.NeedTestPulse = Set;
1092 03cc 202e jp LC006
1093 03ce L512:
1094 ; 501 case 3 : {if ((NewStateEncoder2 & E2B) == 0) {if ((NewStateEncoder2 & E2A) == 0) StateEncoder2 = 4;} else StateEncoder2 = 0; break;}
1096 03ce 7b02 ld a,(OFST-5,sp)
1097 03d0 a540 bcp a,#64
1098 03d2 260a jrne L504
1101 03d4 a520 bcp a,#32
1102 03d6 264f jrne L163
1105 03d8 35040000 mov _StateEncoder2,#4
1106 03dc 2049 jra L163
1107 03de L504:
1111 03de 725f0000 clr _StateEncoder2
1112 03e2 2043 jra L163
1113 03e4 L712:
1114 ; 504 if ((NewStateEncoder2 & E2A) != 0)
1116 03e4 7b02 ld a,(OFST-5,sp)
1117 03e6 a520 bcp a,#32
1118 03e8 273d jreq L163
1119 ; 506 StateEncoder2 = 0;
1121 03ea 725f0000 clr _StateEncoder2
1122 ; 507 if ((Chenal2Number>0) & (Device2.Chenal2Show == Set))
1124 03ee c60000 ld a,_Chenal2Number
1125 03f1 2734 jreq L163
1127 03f3 720300002f btjf _Device2,#1,L163
1128 ; 509 Chenal2Number--;
1130 03f8 725a0000 dec _Chenal2Number
1131 ; 510 ChenalNumberTemp = Chenal2Number;
1133 ; 511 ChenalNumberTemp = (ChenalNumberTemp*2)/3;
1135 ; 512 Chenal2NumberPWM = (unsigned char)ChenalNumberTemp;
1137 ; 513 Chenal2NumberShow = NumberToNumberShow(Chenal2Number, Clear, Clear);
1140 ; 514 RealTimeCounter = 0;
1142 ; 515 if (Device.State == Stop) Taskboard.NeedTestPulse = Set;
1146 03fc LC006:
1148 03fc c60000 ld a,_Chenal2Number
1149 03ff 5f clrw x
1150 0400 97 ld xl,a
1153 0401 58 sllw x
1154 0402 a603 ld a,#3
1155 0404 62 div x,a
1156 0405 1f06 ldw (OFST-1,sp),x
1159 0407 7b07 ld a,(OFST+0,sp)
1160 0409 c70000 ld _Chenal2NumberPWM,a
1162 040c 4b00 push #0
1163 040e c60000 ld a,_Chenal2Number
1164 0411 5f clrw x
1165 0412 95 ld xh,a
1166 0413 cd0657 call _NumberToNumberShow
1167 0416 cf0000 ldw _Chenal2NumberShow,x
1168 0419 725f0000 clr _RealTimeCounter
1169 041d 84 pop a
1171 041e 720a000004 btjt _Device,#5,L163
1173 0423 72180000 bset _Taskboard,#4
1174 ; 520 default : break;
1176 0427 L163:
1177 ; 523 switch (StateEncoder3)
1179 0427 c60000 ld a,_StateEncoder3
1181 ; 564 default : break;
1182 042a 270f jreq L322
1183 042c 4a dec a
1184 042d 2724 jreq L522
1185 042f 4a dec a
1186 0430 2731 jreq L722
1187 0432 4a dec a
1188 0433 274a jreq L132
1189 0435 4a dec a
1190 0436 275d jreq L332
1191 0438 cc04d8 jra L324
1192 043b L322:
1193 ; 525 case 0 : {if ((NewStateEncoder3 & E3A) == 0) StateEncoder3 = 1; else if ((NewStateEncoder3 & E3B) == 0) StateEncoder3 = 3; break;}
1195 043b 7b03 ld a,(OFST-4,sp)
1196 043d a502 bcp a,#2
1197 043f 2607 jrne L524
1200 0441 35010000 mov _StateEncoder3,#1
1202 0445 cc04d8 jra L324
1203 0448 L524:
1206 0448 a501 bcp a,#1
1207 044a 26f9 jrne L324
1210 044c 35030000 mov _StateEncoder3,#3
1211 0450 cc04d8 jra L324
1212 0453 L522:
1213 ; 526 case 1 : {if ((NewStateEncoder3 & E3A) == 0) {if ((NewStateEncoder3 & E3B) == 0) StateEncoder3 = 2;} else StateEncoder3 = 0; break;}
1215 0453 7b03 ld a,(OFST-4,sp)
1216 0455 a502 bcp a,#2
1217 0457 2636 jrne L744
1220 0459 a501 bcp a,#1
1221 045b 267b jrne L324
1224 045d 35020000 mov _StateEncoder3,#2
1225 0461 2075 jra L324
1227 0463 L722:
1228 ; 529 if ((NewStateEncoder3 & E3B) != 0)
1230 0463 7b03 ld a,(OFST-4,sp)
1231 0465 a501 bcp a,#1
1232 0467 276f jreq L324
1233 ; 531 StateEncoder3 = 0;
1235 0469 725f0000 clr _StateEncoder3
1236 ; 532 if ((Chenal3Number<99) & (Device2.Chenal3Show == Set))
1238 046d c60000 ld a,_Chenal3Number
1239 0470 a163 cp a,#99
1240 0472 2464 jruge L324
1242 0474 720500005f btjf _Device2,#2,L324
1243 ; 534 Chenal3Number++;
1245 0479 725c0000 inc _Chenal3Number
1246 ; 535 ChenalNumberTemp = Chenal3Number;
1247 ; 536 ChenalNumberTemp = (ChenalNumberTemp*2)/3;
1248 ; 537 Chenal3NumberPWM = (unsigned char)ChenalNumberTemp;
1249 ; 538 Chenal3NumberShow = NumberToNumberShow(Chenal3Number, Clear, Clear);
1251 ; 539 RealTimeCounter = 0;
1253 ; 540 if (Device.State == Stop) Taskboard.NeedTestPulse = Set;
1255 047d 202e jp LC008
1256 047f L132:
1257 ; 545 case 3 : {if ((NewStateEncoder3 & E3B) == 0) {if ((NewStateEncoder3 & E3A) == 0) StateEncoder3 = 4;} else StateEncoder3 = 0; break;}
1259 047f 7b03 ld a,(OFST-4,sp)
1260 0481 a501 bcp a,#1
1261 0483 260a jrne L744
1264 0485 a502 bcp a,#2
1265 0487 264f jrne L324
1268 0489 35040000 mov _StateEncoder3,#4
1269 048d 2049 jra L324
1270 048f L744:
1274 048f 725f0000 clr _StateEncoder3
1275 0493 2043 jra L324
1276 0495 L332:
1277 ; 548 if ((NewStateEncoder3 & E3A) != 0)
1279 0495 7b03 ld a,(OFST-4,sp)
1280 0497 a502 bcp a,#2
1281 0499 273d jreq L324
1282 ; 550 StateEncoder3 = 0;
1284 049b 725f0000 clr _StateEncoder3
1285 ; 551 if ((Chenal3Number>0) & (Device2.Chenal3Show == Set))
1287 049f c60000 ld a,_Chenal3Number
1288 04a2 2734 jreq L324
1290 04a4 720500002f btjf _Device2,#2,L324
1291 ; 553 Chenal3Number--;
1293 04a9 725a0000 dec _Chenal3Number
1294 ; 554 ChenalNumberTemp = Chenal3Number;
1296 ; 555 ChenalNumberTemp = (ChenalNumberTemp*2)/3;
1298 ; 556 Chenal3NumberPWM = (unsigned char)ChenalNumberTemp;
1300 ; 557 Chenal3NumberShow = NumberToNumberShow(Chenal3Number, Clear, Clear);
1303 ; 558 RealTimeCounter = 0;
1305 ; 559 if (Device.State == Stop) Taskboard.NeedTestPulse = Set;
1309 04ad LC008:
1311 04ad c60000 ld a,_Chenal3Number
1312 04b0 5f clrw x
1313 04b1 97 ld xl,a
1316 04b2 58 sllw x
1317 04b3 a603 ld a,#3
1318 04b5 62 div x,a
1319 04b6 1f06 ldw (OFST-1,sp),x
1322 04b8 7b07 ld a,(OFST+0,sp)
1323 04ba c70000 ld _Chenal3NumberPWM,a
1325 04bd 4b00 push #0
1326 04bf c60000 ld a,_Chenal3Number
1327 04c2 5f clrw x
1328 04c3 95 ld xh,a
1329 04c4 cd0657 call _NumberToNumberShow
1330 04c7 cf0000 ldw _Chenal3NumberShow,x
1331 04ca 725f0000 clr _RealTimeCounter
1332 04ce 84 pop a
1334 04cf 720a000004 btjt _Device,#5,L324
1336 04d4 72180000 bset _Taskboard,#4
1337 ; 564 default : break;
1339 04d8 L324:
1340 ; 567 switch (StateEncoder4)
1342 04d8 c60000 ld a,_StateEncoder4
1344 ; 608 default : break;
1345 04db 270f jreq L732
1346 04dd 4a dec a
1347 04de 2724 jreq L142
1348 04e0 4a dec a
1349 04e1 2731 jreq L342
1350 04e3 4a dec a
1351 04e4 274a jreq L542
1352 04e6 4a dec a
1353 04e7 275d jreq L742
1354 04e9 cc0589 jra L564
1355 04ec L732:
1356 ; 569 case 0 : {if ((NewStateEncoder4 & E4A) == 0) StateEncoder4 = 1; else if ((NewStateEncoder4 & E4B) == 0) StateEncoder4 = 3; break;}
1358 04ec 7b04 ld a,(OFST-3,sp)
1359 04ee a520 bcp a,#32
1360 04f0 2607 jrne L764
1363 04f2 35010000 mov _StateEncoder4,#1
1365 04f6 cc0589 jra L564
1366 04f9 L764:
1369 04f9 a540 bcp a,#64
1370 04fb 26f9 jrne L564
1373 04fd 35030000 mov _StateEncoder4,#3
1374 0501 cc0589 jra L564
1375 0504 L142:
1376 ; 570 case 1 : {if ((NewStateEncoder4 & E4A) == 0) {if ((NewStateEncoder4 & E4B) == 0) StateEncoder4 = 2;} else StateEncoder4 = 0; break;}
1378 0504 7b04 ld a,(OFST-3,sp)
1379 0506 a520 bcp a,#32
1380 0508 2636 jrne L115
1383 050a a540 bcp a,#64
1384 050c 267b jrne L564
1387 050e 35020000 mov _StateEncoder4,#2
1388 0512 2075 jra L564
1390 0514 L342:
1391 ; 573 if ((NewStateEncoder4 & E4B) != 0)
1393 0514 7b04 ld a,(OFST-3,sp)
1394 0516 a540 bcp a,#64
1395 0518 276f jreq L564
1396 ; 575 StateEncoder4 = 0;
1398 051a 725f0000 clr _StateEncoder4
1399 ; 576 if ((Chenal4Number<99) & (Device2.Chenal4Show == Set))
1401 051e c60000 ld a,_Chenal4Number
1402 0521 a163 cp a,#99
1403 0523 2464 jruge L564
1405 0525 720700005f btjf _Device2,#3,L564
1406 ; 578 Chenal4Number++;
1408 052a 725c0000 inc _Chenal4Number
1409 ; 579 ChenalNumberTemp = Chenal4Number;
1410 ; 580 ChenalNumberTemp = (ChenalNumberTemp*2)/3;
1411 ; 581 Chenal4NumberPWM = (unsigned char)ChenalNumberTemp;
1412 ; 582 Chenal4NumberShow = NumberToNumberShow(Chenal4Number, Clear, Clear);
1414 ; 583 RealTimeCounter = 0;
1416 ; 584 if (Device.State == Stop) Taskboard.NeedTestPulse = Set;
1418 052e 202e jp LC010
1419 0530 L542:
1420 ; 589 case 3 : {if ((NewStateEncoder4 & E4B) == 0) {if ((NewStateEncoder4 & E4A) == 0) StateEncoder4 = 4;} else StateEncoder4 = 0; break;}
1422 0530 7b04 ld a,(OFST-3,sp)
1423 0532 a540 bcp a,#64
1424 0534 260a jrne L115
1427 0536 a520 bcp a,#32
1428 0538 264f jrne L564
1431 053a 35040000 mov _StateEncoder4,#4
1432 053e 2049 jra L564
1433 0540 L115:
1437 0540 725f0000 clr _StateEncoder4
1438 0544 2043 jra L564
1439 0546 L742:
1440 ; 592 if ((NewStateEncoder4 & E4A) != 0)
1442 0546 7b04 ld a,(OFST-3,sp)
1443 0548 a520 bcp a,#32
1444 054a 273d jreq L564
1445 ; 594 StateEncoder4 = 0;
1447 054c 725f0000 clr _StateEncoder4
1448 ; 595 if ((Chenal4Number>0) & (Device2.Chenal4Show == Set))
1450 0550 c60000 ld a,_Chenal4Number
1451 0553 2734 jreq L564
1453 0555 720700002f btjf _Device2,#3,L564
1454 ; 597 Chenal4Number--;
1456 055a 725a0000 dec _Chenal4Number
1457 ; 598 ChenalNumberTemp = Chenal4Number;
1459 ; 599 ChenalNumberTemp = (ChenalNumberTemp*2)/3;
1461 ; 600 Chenal4NumberPWM = (unsigned char)ChenalNumberTemp;
1463 ; 601 Chenal4NumberShow = NumberToNumberShow(Chenal4Number, Clear, Clear);
1466 ; 602 RealTimeCounter = 0;
1468 ; 603 if (Device.State == Stop) Taskboard.NeedTestPulse = Set;
1472 055e LC010:
1474 055e c60000 ld a,_Chenal4Number
1475 0561 5f clrw x
1476 0562 97 ld xl,a
1479 0563 58 sllw x
1480 0564 a603 ld a,#3
1481 0566 62 div x,a
1482 0567 1f06 ldw (OFST-1,sp),x
1485 0569 7b07 ld a,(OFST+0,sp)
1486 056b c70000 ld _Chenal4NumberPWM,a
1488 056e 4b00 push #0
1489 0570 c60000 ld a,_Chenal4Number
1490 0573 5f clrw x
1491 0574 95 ld xh,a
1492 0575 cd0657 call _NumberToNumberShow
1493 0578 cf0000 ldw _Chenal4NumberShow,x
1494 057b 725f0000 clr _RealTimeCounter
1495 057f 84 pop a
1497 0580 720a000004 btjt _Device,#5,L564
1499 0585 72180000 bset _Taskboard,#4
1500 ; 608 default : break;
1502 0589 L564:
1503 ; 611 switch (StateEncoder5)
1505 0589 c60000 ld a,_StateEncoder5
1507 ; 662 default : break;
1508 058c 270f jreq L352
1509 058e 4a dec a
1510 058f 2724 jreq L552
1511 0591 4a dec a
1512 0592 2732 jreq L752
1513 0594 4a dec a
1514 0595 274d jreq L162
1515 0597 4a dec a
1516 0598 2760 jreq L362
1517 059a cc0654 jra L725
1518 059d L352:
1519 ; 613 case 0 : {if ((NewStateEncoder5 & E5A) == 0) StateEncoder5 = 1; else if ((NewStateEncoder5 & E5B) == 0) StateEncoder5 = 3; break;}
1521 059d 7b05 ld a,(OFST-2,sp)
1522 059f a501 bcp a,#1
1523 05a1 2607 jrne L135
1526 05a3 35010000 mov _StateEncoder5,#1
1528 05a7 cc0654 jra L725
1529 05aa L135:
1532 05aa a508 bcp a,#8
1533 05ac 26f9 jrne L725
1536 05ae 35030000 mov _StateEncoder5,#3
1537 05b2 cc0654 jra L725
1538 05b5 L552:
1539 ; 614 case 1 : {if ((NewStateEncoder5 & E5A) == 0) {if ((NewStateEncoder5 & E5B) == 0) StateEncoder5 = 2;} else StateEncoder5 = 0; break;}
1541 05b5 7b05 ld a,(OFST-2,sp)
1542 05b7 a501 bcp a,#1
1543 05b9 2639 jrne L155
1546 05bb a508 bcp a,#8
1547 05bd 26f3 jrne L725
1550 05bf 35020000 mov _StateEncoder5,#2
1551 05c3 cc0654 jra L725
1553 05c6 L752:
1554 ; 616 if ((NewStateEncoder5 & E5B) != 0)
1556 05c6 7b05 ld a,(OFST-2,sp)
1557 05c8 a508 bcp a,#8
1558 05ca 27f7 jreq L725
1559 ; 618 StateEncoder5 = 0;
1561 05cc 725f0000 clr _StateEncoder5
1562 ; 620 RealTimeSecond = 0;
1564 05d0 725f0000 clr _RealTimeSecond
1565 ; 622 if (RealTimeMinute<99) RealTimeMinute++;
1567 05d4 c60000 ld a,_RealTimeMinute
1568 05d7 a163 cp a,#99
1569 05d9 2404 jruge L745
1572 05db 725c0000 inc _RealTimeMinute
1573 05df L745:
1574 ; 624 RealTimeSecondNumberShow = NumberToNumberShow(RealTimeSecond, Clear, Set);
1576 05df 4b01 push #1
1577 05e1 5f clrw x
1579 ; 625 RealTimeMinuteNumberShow = NumberToNumberShow(RealTimeMinute, LowPoint, Set);
1581 05e2 205b jp LC012
1582 05e4 L162:
1583 ; 630 case 3 : {if ((NewStateEncoder5 & E5B) == 0) {if ((NewStateEncoder5 & E5A) == 0) StateEncoder5 = 4;} else StateEncoder5 = 0; break;}
1585 05e4 7b05 ld a,(OFST-2,sp)
1586 05e6 a508 bcp a,#8
1587 05e8 260a jrne L155
1590 05ea a501 bcp a,#1
1591 05ec 2666 jrne L725
1594 05ee 35040000 mov _StateEncoder5,#4
1595 05f2 2060 jra L725
1596 05f4 L155:
1600 05f4 725f0000 clr _StateEncoder5
1601 05f8 205a jra L725
1602 05fa L362:
1603 ; 632 if ((NewStateEncoder5 & E5A) != 0)
1605 05fa 7b05 ld a,(OFST-2,sp)
1606 05fc a501 bcp a,#1
1607 05fe 2754 jreq L725
1608 ; 634 StateEncoder5 = 0;
1610 0600 725f0000 clr _StateEncoder5
1611 ; 636 RealTimeSecond = 0;
1613 0604 725f0000 clr _RealTimeSecond
1614 ; 638 if (RealTimeMinute > 1) RealTimeMinute--;
1616 0608 c60000 ld a,_RealTimeMinute
1617 060b a102 cp a,#2
1618 060d 2506 jrult L165
1621 060f 725a0000 dec _RealTimeMinute
1623 0613 2023 jra L365
1624 0615 L165:
1625 ; 641 RealTimeMinute = 0;
1627 0615 725f0000 clr _RealTimeMinute
1628 ; 643 Device.State = Stop;
1630 0619 721b0000 bres _Device,#5
1631 ; 644 LedData &=~ LedStart;
1633 061d 721d0000 bres _LedData,#6
1634 ; 645 FunctionStopGenerator();
1636 0621 cd0829 call _FunctionStopGenerator
1638 ; 647 Device2.TestMode = Clear;
1640 0624 72190000 bres _Device2,#4
1641 ; 649 Device2.Chenal1Show = Set;
1643 0628 72100000 bset _Device2,#0
1644 ; 650 Device2.Chenal2Show = Set;
1646 062c 72120000 bset _Device2,#1
1647 ; 651 Device2.Chenal3Show = Set;
1649 0630 72140000 bset _Device2,#2
1650 ; 652 Device2.Chenal4Show = Set;
1652 0634 72160000 bset _Device2,#3
1653 0638 L365:
1654 ; 656 RealTimeSecondNumberShow = NumberToNumberShow(RealTimeSecond, Clear, Set);
1656 0638 4b01 push #1
1657 063a c60000 ld a,_RealTimeSecond
1658 063d 5f clrw x
1659 063e 95 ld xh,a
1661 ; 657 RealTimeMinuteNumberShow = NumberToNumberShow(RealTimeMinute, LowPoint, Set);
1664 063f LC012:
1665 063f ad16 call _NumberToNumberShow
1666 0641 cf0000 ldw _RealTimeSecondNumberShow,x
1667 0644 84 pop a
1669 0645 4b01 push #1
1670 0647 c60000 ld a,_RealTimeMinute
1671 064a ae0002 ldw x,#2
1672 064d 95 ld xh,a
1673 064e ad07 call _NumberToNumberShow
1674 0650 cf0000 ldw _RealTimeMinuteNumberShow,x
1675 0653 84 pop a
1676 ; 662 default : break;
1678 0654 L725:
1679 ; 664 }
1682 0654 5b07 addw sp,#7
1683 0656 81 ret
1736 ; 668 unsigned int NumberToNumberShow ( unsigned char NumberShowLow, unsigned char Point, unsigned char ShowHighZero)
1736 ; 669 {
1737 switch .text
1738 0657 _NumberToNumberShow: