-
Notifications
You must be signed in to change notification settings - Fork 0
/
autotest_jc.asm
1690 lines (1685 loc) · 53.6 KB
/
autotest_jc.asm
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
;--------------------------------------------------------
; File Created by C51
; Version 1.0.0 #1069 (Apr 23 2015) (MSVC)
; This file was generated Wed Feb 28 17:23:48 2018
;--------------------------------------------------------
$name autotest_jc
$optc51 --model-small
R_DSEG segment data
R_CSEG segment code
R_BSEG segment bit
R_XSEG segment xdata
R_PSEG segment xdata
R_ISEG segment idata
R_OSEG segment data overlay
BIT_BANK segment data overlay
R_HOME segment code
R_GSINIT segment code
R_IXSEG segment xdata
R_CONST segment code
R_XINIT segment code
R_DINIT segment code
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
public _main
public _Initial_Check
public _Check_Pin_Zero
public _Test_Pair
public _dopass
public _dofailb
public _dofail
public _Read_Pin
public _Set_Pin_Zero
public _Set_Pin_One
public _Set_Pin_Input
public _Set_Pin_Output
public _countzero
public _WaitXms
public _Timer3us
public __c51_external_startup
public _Test_Pair_PARM_2
;--------------------------------------------------------
; Special Function Registers
;--------------------------------------------------------
_ACC DATA 0xe0
_ADC0ASAH DATA 0xb6
_ADC0ASAL DATA 0xb5
_ADC0ASCF DATA 0xa1
_ADC0ASCT DATA 0xc7
_ADC0CF0 DATA 0xbc
_ADC0CF1 DATA 0xb9
_ADC0CF2 DATA 0xdf
_ADC0CN0 DATA 0xe8
_ADC0CN1 DATA 0xb2
_ADC0CN2 DATA 0xb3
_ADC0GTH DATA 0xc4
_ADC0GTL DATA 0xc3
_ADC0H DATA 0xbe
_ADC0L DATA 0xbd
_ADC0LTH DATA 0xc6
_ADC0LTL DATA 0xc5
_ADC0MX DATA 0xbb
_B DATA 0xf0
_CKCON0 DATA 0x8e
_CKCON1 DATA 0xa6
_CLEN0 DATA 0xc6
_CLIE0 DATA 0xc7
_CLIF0 DATA 0xe8
_CLKSEL DATA 0xa9
_CLOUT0 DATA 0xd1
_CLU0CF DATA 0xb1
_CLU0FN DATA 0xaf
_CLU0MX DATA 0x84
_CLU1CF DATA 0xb3
_CLU1FN DATA 0xb2
_CLU1MX DATA 0x85
_CLU2CF DATA 0xb6
_CLU2FN DATA 0xb5
_CLU2MX DATA 0x91
_CLU3CF DATA 0xbf
_CLU3FN DATA 0xbe
_CLU3MX DATA 0xae
_CMP0CN0 DATA 0x9b
_CMP0CN1 DATA 0x99
_CMP0MD DATA 0x9d
_CMP0MX DATA 0x9f
_CMP1CN0 DATA 0xbf
_CMP1CN1 DATA 0xac
_CMP1MD DATA 0xab
_CMP1MX DATA 0xaa
_CRC0CN0 DATA 0xce
_CRC0CN1 DATA 0x86
_CRC0CNT DATA 0xd3
_CRC0DAT DATA 0xcb
_CRC0FLIP DATA 0xcf
_CRC0IN DATA 0xca
_CRC0ST DATA 0xd2
_DAC0CF0 DATA 0x91
_DAC0CF1 DATA 0x92
_DAC0H DATA 0x85
_DAC0L DATA 0x84
_DAC1CF0 DATA 0x93
_DAC1CF1 DATA 0x94
_DAC1H DATA 0x8a
_DAC1L DATA 0x89
_DAC2CF0 DATA 0x95
_DAC2CF1 DATA 0x96
_DAC2H DATA 0x8c
_DAC2L DATA 0x8b
_DAC3CF0 DATA 0x9a
_DAC3CF1 DATA 0x9c
_DAC3H DATA 0x8e
_DAC3L DATA 0x8d
_DACGCF0 DATA 0x88
_DACGCF1 DATA 0x98
_DACGCF2 DATA 0xa2
_DERIVID DATA 0xad
_DEVICEID DATA 0xb5
_DPH DATA 0x83
_DPL DATA 0x82
_EIE1 DATA 0xe6
_EIE2 DATA 0xf3
_EIP1 DATA 0xbb
_EIP1H DATA 0xee
_EIP2 DATA 0xed
_EIP2H DATA 0xf6
_EMI0CN DATA 0xe7
_FLKEY DATA 0xb7
_HFO0CAL DATA 0xc7
_HFO1CAL DATA 0xd6
_HFOCN DATA 0xef
_I2C0ADM DATA 0xff
_I2C0CN0 DATA 0xba
_I2C0DIN DATA 0xbc
_I2C0DOUT DATA 0xbb
_I2C0FCN0 DATA 0xad
_I2C0FCN1 DATA 0xab
_I2C0FCT DATA 0xf5
_I2C0SLAD DATA 0xbd
_I2C0STAT DATA 0xb9
_IE DATA 0xa8
_IP DATA 0xb8
_IPH DATA 0xf2
_IT01CF DATA 0xe4
_LFO0CN DATA 0xb1
_P0 DATA 0x80
_P0MASK DATA 0xfe
_P0MAT DATA 0xfd
_P0MDIN DATA 0xf1
_P0MDOUT DATA 0xa4
_P0SKIP DATA 0xd4
_P1 DATA 0x90
_P1MASK DATA 0xee
_P1MAT DATA 0xed
_P1MDIN DATA 0xf2
_P1MDOUT DATA 0xa5
_P1SKIP DATA 0xd5
_P2 DATA 0xa0
_P2MASK DATA 0xfc
_P2MAT DATA 0xfb
_P2MDIN DATA 0xf3
_P2MDOUT DATA 0xa6
_P2SKIP DATA 0xcc
_P3 DATA 0xb0
_P3MDIN DATA 0xf4
_P3MDOUT DATA 0x9c
_PCA0CENT DATA 0x9e
_PCA0CLR DATA 0x9c
_PCA0CN0 DATA 0xd8
_PCA0CPH0 DATA 0xfc
_PCA0CPH1 DATA 0xea
_PCA0CPH2 DATA 0xec
_PCA0CPH3 DATA 0xf5
_PCA0CPH4 DATA 0x85
_PCA0CPH5 DATA 0xde
_PCA0CPL0 DATA 0xfb
_PCA0CPL1 DATA 0xe9
_PCA0CPL2 DATA 0xeb
_PCA0CPL3 DATA 0xf4
_PCA0CPL4 DATA 0x84
_PCA0CPL5 DATA 0xdd
_PCA0CPM0 DATA 0xda
_PCA0CPM1 DATA 0xdb
_PCA0CPM2 DATA 0xdc
_PCA0CPM3 DATA 0xae
_PCA0CPM4 DATA 0xaf
_PCA0CPM5 DATA 0xcc
_PCA0H DATA 0xfa
_PCA0L DATA 0xf9
_PCA0MD DATA 0xd9
_PCA0POL DATA 0x96
_PCA0PWM DATA 0xf7
_PCON0 DATA 0x87
_PCON1 DATA 0xcd
_PFE0CN DATA 0xc1
_PRTDRV DATA 0xf6
_PSCTL DATA 0x8f
_PSTAT0 DATA 0xaa
_PSW DATA 0xd0
_REF0CN DATA 0xd1
_REG0CN DATA 0xc9
_REVID DATA 0xb6
_RSTSRC DATA 0xef
_SBCON1 DATA 0x94
_SBRLH1 DATA 0x96
_SBRLL1 DATA 0x95
_SBUF DATA 0x99
_SBUF0 DATA 0x99
_SBUF1 DATA 0x92
_SCON DATA 0x98
_SCON0 DATA 0x98
_SCON1 DATA 0xc8
_SFRPAGE DATA 0xa7
_SFRPGCN DATA 0xbc
_SFRSTACK DATA 0xd7
_SMB0ADM DATA 0xd6
_SMB0ADR DATA 0xd7
_SMB0CF DATA 0xc1
_SMB0CN0 DATA 0xc0
_SMB0DAT DATA 0xc2
_SMB0FCN0 DATA 0xc3
_SMB0FCN1 DATA 0xc4
_SMB0FCT DATA 0xef
_SMB0RXLN DATA 0xc5
_SMB0TC DATA 0xac
_SMOD1 DATA 0x93
_SP DATA 0x81
_SPI0CFG DATA 0xa1
_SPI0CKR DATA 0xa2
_SPI0CN0 DATA 0xf8
_SPI0DAT DATA 0xa3
_SPI0FCN0 DATA 0x9a
_SPI0FCN1 DATA 0x9b
_SPI0FCT DATA 0xf7
_SPI0PCF DATA 0xdf
_TCON DATA 0x88
_TH0 DATA 0x8c
_TH1 DATA 0x8d
_TL0 DATA 0x8a
_TL1 DATA 0x8b
_TMOD DATA 0x89
_TMR2CN0 DATA 0xc8
_TMR2CN1 DATA 0xfd
_TMR2H DATA 0xcf
_TMR2L DATA 0xce
_TMR2RLH DATA 0xcb
_TMR2RLL DATA 0xca
_TMR3CN0 DATA 0x91
_TMR3CN1 DATA 0xfe
_TMR3H DATA 0x95
_TMR3L DATA 0x94
_TMR3RLH DATA 0x93
_TMR3RLL DATA 0x92
_TMR4CN0 DATA 0x98
_TMR4CN1 DATA 0xff
_TMR4H DATA 0xa5
_TMR4L DATA 0xa4
_TMR4RLH DATA 0xa3
_TMR4RLL DATA 0xa2
_TMR5CN0 DATA 0xc0
_TMR5CN1 DATA 0xf1
_TMR5H DATA 0xd5
_TMR5L DATA 0xd4
_TMR5RLH DATA 0xd3
_TMR5RLL DATA 0xd2
_UART0PCF DATA 0xd9
_UART1FCN0 DATA 0x9d
_UART1FCN1 DATA 0xd8
_UART1FCT DATA 0xfa
_UART1LIN DATA 0x9e
_UART1PCF DATA 0xda
_VDM0CN DATA 0xff
_WDTCN DATA 0x97
_XBR0 DATA 0xe1
_XBR1 DATA 0xe2
_XBR2 DATA 0xe3
_XOSC0CN DATA 0x86
_DPTR DATA 0x8382
_TMR2RL DATA 0xcbca
_TMR3RL DATA 0x9392
_TMR4RL DATA 0xa3a2
_TMR5RL DATA 0xd3d2
_TMR0 DATA 0x8c8a
_TMR1 DATA 0x8d8b
_TMR2 DATA 0xcfce
_TMR3 DATA 0x9594
_TMR4 DATA 0xa5a4
_TMR5 DATA 0xd5d4
_SBRL1 DATA 0x9695
_PCA0 DATA 0xfaf9
_PCA0CP0 DATA 0xfcfb
_PCA0CP1 DATA 0xeae9
_PCA0CP2 DATA 0xeceb
_PCA0CP3 DATA 0xf5f4
_PCA0CP4 DATA 0x8584
_PCA0CP5 DATA 0xdedd
_ADC0ASA DATA 0xb6b5
_ADC0GT DATA 0xc4c3
_ADC0 DATA 0xbebd
_ADC0LT DATA 0xc6c5
_DAC0 DATA 0x8584
_DAC1 DATA 0x8a89
_DAC2 DATA 0x8c8b
_DAC3 DATA 0x8e8d
;--------------------------------------------------------
; special function bits
;--------------------------------------------------------
_ACC_0 BIT 0xe0
_ACC_1 BIT 0xe1
_ACC_2 BIT 0xe2
_ACC_3 BIT 0xe3
_ACC_4 BIT 0xe4
_ACC_5 BIT 0xe5
_ACC_6 BIT 0xe6
_ACC_7 BIT 0xe7
_TEMPE BIT 0xe8
_ADGN0 BIT 0xe9
_ADGN1 BIT 0xea
_ADWINT BIT 0xeb
_ADBUSY BIT 0xec
_ADINT BIT 0xed
_IPOEN BIT 0xee
_ADEN BIT 0xef
_B_0 BIT 0xf0
_B_1 BIT 0xf1
_B_2 BIT 0xf2
_B_3 BIT 0xf3
_B_4 BIT 0xf4
_B_5 BIT 0xf5
_B_6 BIT 0xf6
_B_7 BIT 0xf7
_C0FIF BIT 0x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 0xd8
_RXTO0 BIT 0xd9
_RXTO1 BIT 0xda
_RFRQ BIT 0xdb
_TIE BIT 0xdc
_TXHOLD BIT 0xdd
_TXNF1 BIT 0xde
_TFRQ BIT 0xdf
;--------------------------------------------------------
; overlayable register banks
;--------------------------------------------------------
rbank0 segment data overlay
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
rseg R_DSEG
_Test_Pair_PARM_2:
ds 1
;--------------------------------------------------------
; overlayable items in internal ram
;--------------------------------------------------------
rseg R_OSEG
rseg R_OSEG
rseg R_OSEG
rseg R_OSEG
rseg R_OSEG
rseg R_OSEG
rseg R_OSEG
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
rseg R_ISEG
;--------------------------------------------------------
; absolute internal ram data
;--------------------------------------------------------
DSEG
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
rseg R_BSEG
;--------------------------------------------------------
; paged external ram data
;--------------------------------------------------------
rseg R_PSEG
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
rseg R_XSEG
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
XSEG
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
rseg R_IXSEG
rseg R_HOME
rseg R_GSINIT
rseg R_CSEG
;--------------------------------------------------------
; Reset entry point and interrupt vectors
;--------------------------------------------------------
CSEG at 0x0000
ljmp _crt0
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
rseg R_HOME
rseg R_GSINIT
rseg R_GSINIT
;--------------------------------------------------------
; data variables initialization
;--------------------------------------------------------
rseg R_DINIT
; The linker places a 'ret' at the end of segment R_DINIT.
;--------------------------------------------------------
; code
;--------------------------------------------------------
rseg R_CSEG
;------------------------------------------------------------
;Allocation info for local variables in function '_c51_external_startup'
;------------------------------------------------------------
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:27: char _c51_external_startup (void)
; -----------------------------------------
; function _c51_external_startup
; -----------------------------------------
__c51_external_startup:
using 0
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:30: SFRPAGE = 0x00;
mov _SFRPAGE,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:31: WDTCN = 0xDE; //First key
mov _WDTCN,#0xDE
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:32: WDTCN = 0xAD; //Second key
mov _WDTCN,#0xAD
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:35: SFRPAGE = 0x10;
mov _SFRPAGE,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:36: PFE0CN = 0x10; // SYSCLK < 50 MHz.
mov _PFE0CN,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:37: SFRPAGE = 0x00;
mov _SFRPAGE,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:54: CLKSEL = 0x00;
mov _CLKSEL,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:55: CLKSEL = 0x00;
mov _CLKSEL,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:56: while ((CLKSEL & 0x80) == 0);
L002001?:
mov a,_CLKSEL
jnb acc.7,L002001?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:57: CLKSEL = 0x07;
mov _CLKSEL,#0x07
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:58: CLKSEL = 0x07;
mov _CLKSEL,#0x07
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:59: while ((CLKSEL & 0x80) == 0);
L002004?:
mov a,_CLKSEL
jnb acc.7,L002004?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:72: P0MDOUT |= 0x10; // Enable UART0 TX as push-pull output
orl _P0MDOUT,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:73: XBR0 = 0x01; // Enable UART0 on P0.4(TX) and P0.5(RX)
mov _XBR0,#0x01
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:74: XBR1 = 0X00;
mov _XBR1,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:75: XBR2 = 0x40; // Enable crossbar and weak pull-ups
mov _XBR2,#0x40
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:81: SCON0 = 0x10;
mov _SCON0,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:82: CKCON0 |= 0b_0000_1000 ; // Timer 1 uses the system clock.
orl _CKCON0,#0x08
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:83: TH1 = 0x100-((SYSCLK/BAUDRATE)/2L);
mov _TH1,#0x30
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:84: TL1 = TH1; // Init Timer1
mov _TL1,_TH1
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:85: TMOD &= ~0xf0; // TMOD: timer 1 in 8-bit auto-reload
anl _TMOD,#0x0F
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:86: TMOD |= 0x20;
orl _TMOD,#0x20
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:87: TR1 = 1; // START Timer1
setb _TR1
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:88: TI = 1; // Indicate TX0 ready
setb _TI
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:90: return 0;
mov dpl,#0x00
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'Timer3us'
;------------------------------------------------------------
;us Allocated to registers r2
;i Allocated to registers r3
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:95: void Timer3us(unsigned char us)
; -----------------------------------------
; function Timer3us
; -----------------------------------------
_Timer3us:
mov r2,dpl
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:100: CKCON0|=0b_0100_0000;
orl _CKCON0,#0x40
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:102: TMR3RL = (-(SYSCLK)/1000000L); // Set Timer3 to overflow in 1us.
mov _TMR3RL,#0xD0
mov (_TMR3RL >> 8),#0xFF
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:103: TMR3 = TMR3RL; // Initialize Timer3 for first overflow
mov _TMR3,_TMR3RL
mov (_TMR3 >> 8),(_TMR3RL >> 8)
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:105: TMR3CN0 = 0x04; // Sart Timer3 and clear overflow flag
mov _TMR3CN0,#0x04
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:106: for (i = 0; i < us; i++) // Count <us> overflows
mov r3,#0x00
L003004?:
clr c
mov a,r3
subb a,r2
jnc L003007?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:108: while (!(TMR3CN0 & 0x80)); // Wait for overflow
L003001?:
mov a,_TMR3CN0
jnb acc.7,L003001?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:109: TMR3CN0 &= ~(0x80); // Clear overflow indicator
anl _TMR3CN0,#0x7F
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:106: for (i = 0; i < us; i++) // Count <us> overflows
inc r3
sjmp L003004?
L003007?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:111: TMR3CN0 = 0 ; // Stop Timer3 and clear overflow flag
mov _TMR3CN0,#0x00
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'WaitXms'
;------------------------------------------------------------
;ms Allocated to registers r2 r3
;j Allocated to registers r2 r3
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:114: void WaitXms (unsigned int ms)
; -----------------------------------------
; function WaitXms
; -----------------------------------------
_WaitXms:
mov r2,dpl
mov r3,dph
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:117: for(j=ms; j!=0; j--)
L004001?:
cjne r2,#0x00,L004010?
cjne r3,#0x00,L004010?
ret
L004010?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:119: Timer3us(249);
mov dpl,#0xF9
push ar2
push ar3
lcall _Timer3us
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:120: Timer3us(249);
mov dpl,#0xF9
lcall _Timer3us
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:121: Timer3us(249);
mov dpl,#0xF9
lcall _Timer3us
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:122: Timer3us(250);
mov dpl,#0xFA
lcall _Timer3us
pop ar3
pop ar2
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:117: for(j=ms; j!=0; j--)
dec r2
cjne r2,#0xff,L004011?
dec r3
L004011?:
sjmp L004001?
;------------------------------------------------------------
;Allocation info for local variables in function 'countzero'
;------------------------------------------------------------
;j Allocated to registers r2
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:126: unsigned char countzero(void)
; -----------------------------------------
; function countzero
; -----------------------------------------
_countzero:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:130: j=0;
mov r2,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:132: if (P0_0==0) j++;
jb _P0_0,L005002?
mov r2,#0x01
L005002?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:133: if (P0_1==0) j++;
jb _P0_1,L005004?
inc r2
L005004?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:134: if (P0_2==0) j++;
jb _P0_2,L005006?
inc r2
L005006?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:135: if (P0_3==0) j++;
jb _P0_3,L005008?
inc r2
L005008?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:138: if (P0_6==0) j++;
jb _P0_6,L005010?
inc r2
L005010?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:139: if (P0_7==0) j++;
jb _P0_7,L005012?
inc r2
L005012?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:141: if (P1_0==0) j++;
jb _P1_0,L005014?
inc r2
L005014?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:142: if (P1_1==0) j++;
jb _P1_1,L005016?
inc r2
L005016?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:143: if (P1_2==0) j++;
jb _P1_2,L005018?
inc r2
L005018?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:144: if (P1_3==0) j++;
jb _P1_3,L005020?
inc r2
L005020?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:145: if (P1_4==0) j++;
jb _P1_4,L005022?
inc r2
L005022?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:146: if (P1_5==0) j++;
jb _P1_5,L005024?
inc r2
L005024?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:147: if (P1_6==0) j++;
jb _P1_6,L005026?
inc r2
L005026?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:148: if (P1_7==0) j++;
jb _P1_7,L005028?
inc r2
L005028?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:150: if (P2_0==0) j++;
jb _P2_0,L005030?
inc r2
L005030?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:151: if (P2_1==0) j++;
jb _P2_1,L005032?
inc r2
L005032?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:152: if (P2_2==0) j++;
jb _P2_2,L005034?
inc r2
L005034?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:153: if (P2_3==0) j++;
jb _P2_3,L005036?
inc r2
L005036?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:154: if (P2_4==0) j++;
jb _P2_4,L005038?
inc r2
L005038?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:155: if (P2_5==0) j++;
jb _P2_5,L005040?
inc r2
L005040?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:156: if (P2_6==0) j++;
jb _P2_6,L005042?
inc r2
L005042?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:158: if (P3_0==0) j++;
jb _P3_0,L005044?
inc r2
L005044?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:159: if (P3_1==0) j++;
jb _P3_1,L005046?
inc r2
L005046?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:160: if (P3_2==0) j++;
jb _P3_2,L005048?
inc r2
L005048?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:161: if (P3_3==0) j++;
jb _P3_3,L005050?
inc r2
L005050?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:162: if (P3_7==0) j++;
jb _P3_7,L005052?
inc r2
L005052?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:164: return j;
mov dpl,r2
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'Set_Pin_Output'
;------------------------------------------------------------
;pin Allocated to registers r2
;mask Allocated to registers r3
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:167: void Set_Pin_Output (unsigned char pin)
; -----------------------------------------
; function Set_Pin_Output
; -----------------------------------------
_Set_Pin_Output:
mov r2,dpl
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:171: mask=(1<<(pin&0x7));
mov a,#0x07
anl a,r2
mov b,a
inc b
mov a,#0x01
sjmp L006011?
L006009?:
add a,acc
L006011?:
djnz b,L006009?
mov r3,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:172: switch(pin/0x10)
mov a,r2
swap a
anl a,#0x0f
mov r2,a
add a,#0xff - 0x03
jc L006006?
mov a,r2
add a,r2
add a,r2
mov dptr,#L006013?
jmp @a+dptr
L006013?:
ljmp L006001?
ljmp L006002?
ljmp L006003?
ljmp L006004?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:174: case 0: P0MDOUT |= mask; break;
L006001?:
mov a,r3
orl _P0MDOUT,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:175: case 1: P1MDOUT |= mask; break;
ret
L006002?:
mov a,r3
orl _P1MDOUT,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:176: case 2: P2MDOUT |= mask; break;
ret
L006003?:
mov a,r3
orl _P2MDOUT,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:177: case 3: P3MDOUT |= mask; break;
ret
L006004?:
mov a,r3
orl _P3MDOUT,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:178: }
L006006?:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'Set_Pin_Input'
;------------------------------------------------------------
;pin Allocated to registers r2
;mask Allocated to registers r3
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:181: void Set_Pin_Input (unsigned char pin)
; -----------------------------------------
; function Set_Pin_Input
; -----------------------------------------
_Set_Pin_Input:
mov r2,dpl
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:185: mask=(1<<(pin&0x7));
mov a,#0x07
anl a,r2
mov b,a
inc b
mov a,#0x01
sjmp L007011?
L007009?:
add a,acc
L007011?:
djnz b,L007009?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:186: mask=~mask;
cpl a
mov r3,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:187: switch(pin/0x10)
mov a,r2
swap a
anl a,#0x0f
mov r2,a
add a,#0xff - 0x03
jc L007006?
mov a,r2
add a,r2
add a,r2
mov dptr,#L007013?
jmp @a+dptr
L007013?:
ljmp L007001?
ljmp L007002?
ljmp L007003?
ljmp L007004?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:189: case 0: P0MDOUT &= mask; break;
L007001?:
mov a,r3
anl _P0MDOUT,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:190: case 1: P1MDOUT &= mask; break;
ret
L007002?:
mov a,r3
anl _P1MDOUT,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:191: case 2: P2MDOUT &= mask; break;
ret
L007003?:
mov a,r3
anl _P2MDOUT,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:192: case 3: P3MDOUT &= mask; break;
ret
L007004?:
mov a,r3
anl _P3MDOUT,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:193: }
L007006?:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'Set_Pin_One'
;------------------------------------------------------------
;pin Allocated to registers r2
;mask Allocated to registers r3
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:196: void Set_Pin_One (unsigned char pin)
; -----------------------------------------
; function Set_Pin_One
; -----------------------------------------
_Set_Pin_One:
mov r2,dpl
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:200: mask=(1<<(pin&0x7));
mov a,#0x07
anl a,r2
mov b,a
inc b
mov a,#0x01
sjmp L008011?
L008009?:
add a,acc
L008011?:
djnz b,L008009?
mov r3,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:201: switch(pin/0x10)
mov a,r2
swap a
anl a,#0x0f
mov r2,a
add a,#0xff - 0x03
jc L008006?
mov a,r2
add a,r2
add a,r2
mov dptr,#L008013?
jmp @a+dptr
L008013?:
ljmp L008001?
ljmp L008002?
ljmp L008003?
ljmp L008004?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:203: case 0: P0 |= mask; break;
L008001?:
mov a,r3
orl _P0,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:204: case 1: P1 |= mask; break;
ret
L008002?:
mov a,r3
orl _P1,a
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\autotest_jc.c:205: case 2: P2 |= mask; break;
ret