-
Notifications
You must be signed in to change notification settings - Fork 0
/
hr_monitor.asm
1877 lines (1872 loc) · 51.7 KB
/
hr_monitor.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 Thu Mar 01 13:16:04 2018
;--------------------------------------------------------
$name hr_monitor
$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 _TIMER0_Init
public _getsn
public _LCDprint_inv
public _LCDprint
public _LCD_4BIT
public _WriteCommand
public _WriteData
public _LCD_byte
public _LCD_pulse
public _waitms
public _Timer3us
public __c51_external_startup
public _LCDprint_inv_PARM_3
public _LCDprint_PARM_3
public _getsn_PARM_2
public _LCDprint_inv_PARM_2
public _LCDprint_PARM_2
public _overflow_count
;--------------------------------------------------------
; 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 B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TF5L BIT 0xc6
_TF5H BIT 0xc7
_RIE BIT 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
_overflow_count:
ds 1
_LCDprint_PARM_2:
ds 1
_LCDprint_inv_PARM_2:
ds 1
_LCDprint_inv_length_1_43:
ds 2
_getsn_PARM_2:
ds 2
_getsn_buff_1_44:
ds 3
_getsn_sloc0_1_0:
ds 2
_main_mem_1_52:
ds 4
_main_unstable_1_52:
ds 2
_main_count_1_52:
ds 2
_main_bpm_string_1_52:
ds 3
;--------------------------------------------------------
; overlayable items in internal ram
;--------------------------------------------------------
rseg R_OSEG
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
rseg R_ISEG
;--------------------------------------------------------
; absolute internal ram data
;--------------------------------------------------------
DSEG
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
rseg R_BSEG
_LCDprint_PARM_3:
DBIT 1
_LCDprint_inv_PARM_3:
DBIT 1
;--------------------------------------------------------
; 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\hr_monitor.c:31: 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\hr_monitor.c:34: SFRPAGE = 0x00;
mov _SFRPAGE,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:35: WDTCN = 0xDE; //First key
mov _WDTCN,#0xDE
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:36: WDTCN = 0xAD; //Second key
mov _WDTCN,#0xAD
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:38: VDM0CN |= 0x80;
orl _VDM0CN,#0x80
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:39: RSTSRC = 0x02;
mov _RSTSRC,#0x02
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:46: SFRPAGE = 0x10;
mov _SFRPAGE,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:47: PFE0CN = 0x20; // SYSCLK < 75 MHz.
mov _PFE0CN,#0x20
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:48: SFRPAGE = 0x00;
mov _SFRPAGE,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:69: CLKSEL = 0x00;
mov _CLKSEL,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:70: CLKSEL = 0x00;
mov _CLKSEL,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:71: while ((CLKSEL & 0x80) == 0);
L002001?:
mov a,_CLKSEL
jnb acc.7,L002001?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:72: CLKSEL = 0x03;
mov _CLKSEL,#0x03
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:73: CLKSEL = 0x03;
mov _CLKSEL,#0x03
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:74: while ((CLKSEL & 0x80) == 0);
L002004?:
mov a,_CLKSEL
jnb acc.7,L002004?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:79: P0MDOUT |= 0x10; // Enable UART0 TX as push-pull output
orl _P0MDOUT,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:80: 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\hr_monitor.c:81: XBR1 = 0X00;
mov _XBR1,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:82: XBR2 = 0x40; // Enable crossbar and weak pull-ups
mov _XBR2,#0x40
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:88: SCON0 = 0x10;
mov _SCON0,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:89: CKCON0 |= 0b_0000_0000 ; // Timer 1 uses the system clock divided by 12.
mov _CKCON0,_CKCON0
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:90: TH1 = 0x100-((SYSCLK/BAUDRATE)/(2L*12L));
mov _TH1,#0xE6
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:91: TL1 = TH1; // Init Timer1
mov _TL1,_TH1
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:92: 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\hr_monitor.c:93: TMOD |= 0x20;
orl _TMOD,#0x20
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:94: TR1 = 1; // START Timer1
setb _TR1
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:95: TI = 1; // Indicate TX0 ready
setb _TI
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:97: 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\hr_monitor.c:103: void Timer3us(unsigned char us)
; -----------------------------------------
; function Timer3us
; -----------------------------------------
_Timer3us:
mov r2,dpl
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:108: CKCON0|=0b_0100_0000;
orl _CKCON0,#0x40
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:110: TMR3RL = (-(SYSCLK)/1000000L); // Set Timer3 to overflow in 1us.
mov _TMR3RL,#0xB8
mov (_TMR3RL >> 8),#0xFF
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:111: 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\hr_monitor.c:113: TMR3CN0 = 0x04; // Sart Timer3 and clear overflow flag
mov _TMR3CN0,#0x04
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:114: 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\hr_monitor.c:116: 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\hr_monitor.c:117: TMR3CN0 &= ~(0x80); // Clear overflow indicator
anl _TMR3CN0,#0x7F
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:114: 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\hr_monitor.c:119: TMR3CN0 = 0 ; // Stop Timer3 and clear overflow flag
mov _TMR3CN0,#0x00
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'waitms'
;------------------------------------------------------------
;ms Allocated to registers r2 r3
;j Allocated to registers r4 r5
;k Allocated to registers r6
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:122: void waitms (unsigned int ms)
; -----------------------------------------
; function waitms
; -----------------------------------------
_waitms:
mov r2,dpl
mov r3,dph
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:126: for(j=0; j<ms; j++)
mov r4,#0x00
mov r5,#0x00
L004005?:
clr c
mov a,r4
subb a,r2
mov a,r5
subb a,r3
jnc L004009?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:127: for (k=0; k<4; k++) Timer3us(250);
mov r6,#0x00
L004001?:
cjne r6,#0x04,L004018?
L004018?:
jnc L004007?
mov dpl,#0xFA
push ar2
push ar3
push ar4
push ar5
push ar6
lcall _Timer3us
pop ar6
pop ar5
pop ar4
pop ar3
pop ar2
inc r6
sjmp L004001?
L004007?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:126: for(j=0; j<ms; j++)
inc r4
cjne r4,#0x00,L004005?
inc r5
sjmp L004005?
L004009?:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'LCD_pulse'
;------------------------------------------------------------
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:130: void LCD_pulse (void)
; -----------------------------------------
; function LCD_pulse
; -----------------------------------------
_LCD_pulse:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:132: LCD_E=1;
setb _P2_5
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:133: Timer3us(40);
mov dpl,#0x28
lcall _Timer3us
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:134: LCD_E=0;
clr _P2_5
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'LCD_byte'
;------------------------------------------------------------
;x Allocated to registers r2
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:137: void LCD_byte (unsigned char x)
; -----------------------------------------
; function LCD_byte
; -----------------------------------------
_LCD_byte:
mov r2,dpl
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:140: ACC=x; //Send high nible
mov _ACC,r2
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:141: LCD_D7=ACC_7;
mov c,_ACC_7
mov _P2_1,c
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:142: LCD_D6=ACC_6;
mov c,_ACC_6
mov _P2_2,c
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:143: LCD_D5=ACC_5;
mov c,_ACC_5
mov _P2_3,c
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:144: LCD_D4=ACC_4;
mov c,_ACC_4
mov _P2_4,c
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:145: LCD_pulse();
push ar2
lcall _LCD_pulse
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:146: Timer3us(40);
mov dpl,#0x28
lcall _Timer3us
pop ar2
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:147: ACC=x; //Send low nible
mov _ACC,r2
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:148: LCD_D7=ACC_3;
mov c,_ACC_3
mov _P2_1,c
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:149: LCD_D6=ACC_2;
mov c,_ACC_2
mov _P2_2,c
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:150: LCD_D5=ACC_1;
mov c,_ACC_1
mov _P2_3,c
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:151: LCD_D4=ACC_0;
mov c,_ACC_0
mov _P2_4,c
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:152: LCD_pulse();
ljmp _LCD_pulse
;------------------------------------------------------------
;Allocation info for local variables in function 'WriteData'
;------------------------------------------------------------
;x Allocated to registers r2
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:155: void WriteData (unsigned char x)
; -----------------------------------------
; function WriteData
; -----------------------------------------
_WriteData:
mov r2,dpl
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:157: LCD_RS=1;
setb _P2_6
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:158: LCD_byte(x);
mov dpl,r2
lcall _LCD_byte
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:159: waitms(2);
mov dptr,#0x0002
ljmp _waitms
;------------------------------------------------------------
;Allocation info for local variables in function 'WriteCommand'
;------------------------------------------------------------
;x Allocated to registers r2
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:162: void WriteCommand (unsigned char x)
; -----------------------------------------
; function WriteCommand
; -----------------------------------------
_WriteCommand:
mov r2,dpl
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:164: LCD_RS=0;
clr _P2_6
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:165: LCD_byte(x);
mov dpl,r2
lcall _LCD_byte
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:166: waitms(5);
mov dptr,#0x0005
ljmp _waitms
;------------------------------------------------------------
;Allocation info for local variables in function 'LCD_4BIT'
;------------------------------------------------------------
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:169: void LCD_4BIT (void)
; -----------------------------------------
; function LCD_4BIT
; -----------------------------------------
_LCD_4BIT:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:171: LCD_E=0; // Resting state of LCD's enable is zero
clr _P2_5
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:173: waitms(20);
mov dptr,#0x0014
lcall _waitms
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:175: WriteCommand(0x33);
mov dpl,#0x33
lcall _WriteCommand
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:176: WriteCommand(0x33);
mov dpl,#0x33
lcall _WriteCommand
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:177: WriteCommand(0x32); // Change to 4-bit mode
mov dpl,#0x32
lcall _WriteCommand
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:180: WriteCommand(0x28);
mov dpl,#0x28
lcall _WriteCommand
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:181: WriteCommand(0x0c);
mov dpl,#0x0C
lcall _WriteCommand
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:182: WriteCommand(0x01); // Clear screen command (takes some time)
mov dpl,#0x01
lcall _WriteCommand
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:183: waitms(20); // Wait for clear screen command to finsih.
mov dptr,#0x0014
ljmp _waitms
;------------------------------------------------------------
;Allocation info for local variables in function 'LCDprint'
;------------------------------------------------------------
;line Allocated with name '_LCDprint_PARM_2'
;string Allocated to registers r2 r3 r4
;j Allocated to registers r5 r6
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:186: void LCDprint(char * string, unsigned char line, bit clear)
; -----------------------------------------
; function LCDprint
; -----------------------------------------
_LCDprint:
mov r2,dpl
mov r3,dph
mov r4,b
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:190: WriteCommand(line==2?0xc0:0x80);
mov a,#0x02
cjne a,_LCDprint_PARM_2,L010013?
mov r5,#0xC0
sjmp L010014?
L010013?:
mov r5,#0x80
L010014?:
mov dpl,r5
push ar2
push ar3
push ar4
lcall _WriteCommand
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:191: waitms(5);
mov dptr,#0x0005
lcall _waitms
pop ar4
pop ar3
pop ar2
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:192: for(j=0; string[j]!=0; j++) WriteData(string[j]);// Write the message
mov r5,#0x00
mov r6,#0x00
L010003?:
mov a,r5
add a,r2
mov r7,a
mov a,r6
addc a,r3
mov r0,a
mov ar1,r4
mov dpl,r7
mov dph,r0
mov b,r1
lcall __gptrget
mov r7,a
jz L010006?
mov dpl,r7
push ar2
push ar3
push ar4
push ar5
push ar6
lcall _WriteData
pop ar6
pop ar5
pop ar4
pop ar3
pop ar2
inc r5
cjne r5,#0x00,L010003?
inc r6
sjmp L010003?
L010006?:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:193: if(clear) for(; j<CHARS_PER_LINE; j++) WriteData(' '); // Clear the rest of the line
jnb _LCDprint_PARM_3,L010011?
mov ar2,r5
mov ar3,r6
L010007?:
clr c
mov a,r2
subb a,#0x10
mov a,r3
xrl a,#0x80
subb a,#0x80
jnc L010011?
mov dpl,#0x20
push ar2
push ar3
lcall _WriteData
pop ar3
pop ar2
inc r2
cjne r2,#0x00,L010007?
inc r3
sjmp L010007?
L010011?:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'LCDprint_inv'
;------------------------------------------------------------
;line Allocated with name '_LCDprint_inv_PARM_2'
;string Allocated to registers r2 r3 r4
;j Allocated to registers r5 r6
;length Allocated with name '_LCDprint_inv_length_1_43'
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:196: void LCDprint_inv(char * string, unsigned char line, bit clear)
; -----------------------------------------
; function LCDprint_inv
; -----------------------------------------
_LCDprint_inv:
mov r2,dpl
mov r3,dph
mov r4,b
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:201: WriteCommand(line==2?0xc0:0x80);
mov a,#0x02
cjne a,_LCDprint_inv_PARM_2,L011017?
mov r5,#0xC0
sjmp L011018?
L011017?:
mov r5,#0x80
L011018?:
mov dpl,r5
push ar2
push ar3
push ar4
lcall _WriteCommand
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hr_monitor.c:202: waitms(5);
mov dptr,#0x0005
lcall _waitms
pop ar4
pop ar3