单片机-- 51-keil使用查看空间占用
1.keil打开map文件(.m51格式)
软件:keil51 v9.60
硬件:sonix sn8f570212asg
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 1
BL51 BANKED LINKER/LOCATER V6.22.2.0, INVOKED BY:
D:\KEIL_V5\C51\BIN\BL51.EXE .\Output\main.obj, .\Output\Timer0.obj, .\Output\UART0.obj, .\Output\OPTIONS_SN8F5702A.obj T
O .\Output\_SN8F570212ASG PRINT (.\LST\_SN8F570212ASG.m51) RAMSIZE (256)
MEMORY MODEL: SMALL
INPUT MODULES INCLUDED:
.\Output\main.obj (MAIN)
.\Output\Timer0.obj (TIMER0)
.\Output\UART0.obj (UART0)
.\Output\OPTIONS_SN8F5702A.obj (OPTIONS_SN8F5702A)
D:\KEIL_V5\C51\LIB\C51S.LIB (?C_STARTUP)
D:\KEIL_V5\C51\LIB\C51S.LIB (?C?ULCMP)
D:\KEIL_V5\C51\LIB\C51S.LIB (?C?LILDIDATA)
D:\KEIL_V5\C51\LIB\C51S.LIB (?C_INIT)
LINK MAP OF MODULE: .\Output\_SN8F570212ASG (MAIN)
TYPE BASE LENGTH RELOCATION SEGMENT NAME
-----------------------------------------------------
* * * * * * * D A T A M E M O R Y * * * * * * *
REG 0000H 0008H ABSOLUTE "REG BANK 0"
DATA 0008H 0048H UNIT ?DT?MAIN
DATA 0050H 0017H UNIT ?DT?UART0
DATA 0067H 0008H UNIT ?DT?TIMER0
IDATA 006FH 0001H UNIT ?STACK
* * * * * * * C O D E M E M O R Y * * * * * * *
CODE 0000H 0003H ABSOLUTE
CODE 0003H 0007H UNIT ?PR?UART0_ENABLE_INTERRUPT?UART0
CODE 000AH 0001H UNIT ?PR?START_ALARM?MAIN
CODE 000BH 0003H ABSOLUTE
CODE 000EH 000CH UNIT ?PR?RELAY_SET?MAIN
CODE 001AH 0009H UNIT ?PR?ALL_LED_ON?MAIN
CODE 0023H 0003H ABSOLUTE
CODE 0026H 0470H UNIT ?PR?T0INTERRUPT?TIMER0
CODE 0496H 0149H UNIT ?PR?MAIN?MAIN
CODE 05DFH 0090H UNIT ?C_INITSEG
CODE 066FH 008CH UNIT ?C_C51STARTUP
CODE 06FBH 0050H UNIT ?PR?UART0_INIT?UART0
CODE 074BH 0047H UNIT ?PR?UART0_ISR?UART0
CODE 0792H 0037H UNIT ?PR?RESET_ALARM_PD1?MAIN
CODE 07C9H 0037H UNIT ?PR?RESET_ALARM_PD2?MAIN
CODE 0800H 0037H UNIT ?PR?RESET_ALARM_PD3?MAIN
CODE 0837H 0037H UNIT ?PR?RESET_ALARM_PD4?MAIN
CODE 086EH 0031H UNIT ?C?LIB_CODE
CODE 089FH 0028H UNIT ?PR?START_ALARM_PD1?MAIN
CODE 08C7H 0028H UNIT ?PR?START_ALARM_PD2?MAIN
CODE 08EFH 0028H UNIT ?PR?START_ALARM_PD3?MAIN
CODE 0917H 0028H UNIT ?PR?START_ALARM_PD4?MAIN
CODE 093FH 0028H UNIT ?PR?_DELAY1MS?MAIN
CODE 0967H 0025H UNIT ?PR?SCAN_ALL_PD_STATE?MAIN
CODE 098CH 001DH UNIT ?PR?RESET_SELF_CHECK?MAIN
content_copy
download
Use code with caution.
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 2
CODE 09A9H 0018H UNIT ?PR?INITT0T1?TIMER0
CODE 09C1H 000CH UNIT ?PR?RELAY_RESET?MAIN
CODE 09CDH 000CH UNIT ?PR?_UART0TX_WRITEONEBYTE?UART0
CODE 09D9H 0009H UNIT ?PR?ALL_LED_OFF?MAIN
CODE 09E2H 0009H UNIT ?PR?GET_CURRENT_TIME?TIMER0
CODE 09EBH 0001H UNIT ?PR?RESET_ALARM?MAIN
09ECH 060AH *** GAP ***
CODE 0FF6H 000AH ABSOLUTE
content_copy
download
Use code with caution.
OVERLAY MAP OF MODULE: .\Output\_SN8F570212ASG (MAIN)
SEGMENT
+--> CALLED SEGMENT
?PR?T0INTERRUPT?TIMER0
+--> ?PR?ALL_LED_ON?MAIN
+--> ?PR?ALL_LED_OFF?MAIN
+--> ?PR?RESET_SELF_CHECK?MAIN
+--> ?PR?RELAY_RESET?MAIN
+--> ?PR?RESET_ALARM_PD1?MAIN
+--> ?PR?RESET_ALARM_PD2?MAIN
+--> ?PR?RESET_ALARM_PD3?MAIN
+--> ?PR?RESET_ALARM_PD4?MAIN
?PR?RESET_SELF_CHECK?MAIN
+--> ?PR?ALL_LED_OFF?MAIN
?PR?RELAY_RESET?MAIN
+--> ?PR?_DELAY1MS?MAIN
?PR?RESET_ALARM_PD1?MAIN
+--> ?PR?RELAY_RESET?MAIN
?PR?RESET_ALARM_PD2?MAIN
+--> ?PR?RELAY_RESET?MAIN
?PR?RESET_ALARM_PD3?MAIN
+--> ?PR?RELAY_RESET?MAIN
?PR?RESET_ALARM_PD4?MAIN
+--> ?PR?RELAY_RESET?MAIN
*** NEW ROOT ***************************************************
?C_C51STARTUP
+--> ?PR?MAIN?MAIN
+--> ?C_INITSEG
?PR?MAIN?MAIN
+--> ?PR?INITT0T1?TIMER0
+--> ?PR?RELAY_RESET?MAIN
+--> ?PR?ALL_LED_OFF?MAIN
+--> ?PR?_DELAY1MS?MAIN
+--> ?PR?ALL_LED_ON?MAIN
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 3
+--> ?PR?SCAN_ALL_PD_STATE?MAIN
+--> ?PR?RESET_SELF_CHECK?MAIN
+--> ?PR?RELAY_SET?MAIN
+--> ?PR?RESET_ALARM_PD1?MAIN
+--> ?PR?RESET_ALARM_PD2?MAIN
+--> ?PR?RESET_ALARM_PD3?MAIN
+--> ?PR?RESET_ALARM_PD4?MAIN
+--> ?PR?START_ALARM_PD1?MAIN
+--> ?PR?START_ALARM_PD2?MAIN
+--> ?PR?START_ALARM_PD3?MAIN
+--> ?PR?START_ALARM_PD4?MAIN
?PR?RELAY_SET?MAIN
+--> ?PR?_DELAY1MS?MAIN
?PR?START_ALARM_PD1?MAIN
+--> ?PR?RELAY_SET?MAIN
?PR?START_ALARM_PD2?MAIN
+--> ?PR?RELAY_SET?MAIN
?PR?START_ALARM_PD3?MAIN
+--> ?PR?RELAY_SET?MAIN
?PR?START_ALARM_PD4?MAIN
+--> ?PR?RELAY_SET?MAIN
SYMBOL TABLE OF MODULE: .\Output\_SN8F570212ASG (MAIN)
VALUE TYPE NAME
------- MODULE MAIN
C:0000H SYMBOL ICE_DUMMY
C:0800H PUBLIC Reset_Alarm_PD3
C:0837H PUBLIC Reset_Alarm_PD4
D:0080H PUBLIC P0
D:0008H PUBLIC PD1_control_t
D:0090H PUBLIC P1
D:0012H PUBLIC PD2_control_t
D:00A0H PUBLIC P2
D:001CH PUBLIC PD3_control_t
D:0026H PUBLIC PD4_control_t
C:093FH PUBLIC _Delay1ms
B:0090H.2 PUBLIC SW_RST
D:0030H PUBLIC delay_time_to_stop_model
B:0080H.5 PUBLIC LED1
C:089FH PUBLIC Start_Alarm_PD1
B:0080H.7 PUBLIC LED2
C:08C7H PUBLIC Start_Alarm_PD2
B:00A0H.0 PUBLIC LED3
C:08EFH PUBLIC Start_Alarm_PD3
B:0090H.6 PUBLIC LED4
C:0917H PUBLIC Start_Alarm_PD4
B:0090H.5 PUBLIC LED5
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 4
C:09D9H PUBLIC All_LED_OFF
D:00A8H PUBLIC IEN0
C:000EH PUBLIC Relay_Set
D:00B8H PUBLIC IEN1
D:0034H PUBLIC delay_time_to_stop_model_count
D:0038H PUBLIC g_led_ctrl
D:00D8H PUBLIC S0CON2
D:003CH PUBLIC enter_while_flag
B:0090H.1 PUBLIC TIM1
B:0090H.0 PUBLIC TIM2
C:0496H PUBLIC main
D:003DH PUBLIC g_sys
B:00A0H.0 PUBLIC P20
B:0090H.3 PUBLIC NET_RELAYTHN
C:098CH PUBLIC Reset_Self_Check
B:0090H.3 PUBLIC P13
B:0090H.4 PUBLIC P14
D:0088H PUBLIC TCON
B:0080H.5 PUBLIC P05
B:0090H.5 PUBLIC P15
B:0090H.6 PUBLIC P16
B:0080H.7 PUBLIC P07
B:0090H.4 PUBLIC NET_RLAYCYDZ
D:00F0H PUBLIC B
D:0048H PUBLIC PD1_flag
D:0086H PUBLIC WDTR
D:0049H PUBLIC PD2_flag
D:004AH PUBLIC PD3_flag
D:004BH PUBLIC PD4_flag
B:0080H.4 PUBLIC PD1
B:0080H.3 PUBLIC PD2
B:0080H.2 PUBLIC PD3
D:00E0H PUBLIC ACC
B:0080H.0 PUBLIC PD4
D:004CH PUBLIC alarm_total_num
D:00F9H PUBLIC P0M
C:001AH PUBLIC All_LED_ON
D:00FAH PUBLIC P1M
D:00FBH PUBLIC P2M
C:09EBH PUBLIC Reset_Alarm
D:0091H PUBLIC P1W
C:0967H PUBLIC Scan_All_PD_State
C:000AH PUBLIC Start_Alarm
D:0098H PUBLIC S0CON
C:09C1H PUBLIC Relay_Reset
D:00C8H PUBLIC T2CON
D:00D0H PUBLIC PSW
C:0792H PUBLIC Reset_Alarm_PD1
D:00C0H PUBLIC IRCON
C:07C9H PUBLIC Reset_Alarm_PD2
------- PROC MAIN
C:0496H LINE# 81
C:0496H LINE# 82
C:0496H LINE# 83
C:0499H LINE# 86
C:049CH LINE# 89
C:049FH LINE# 93
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 5
C:04A1H LINE# 94
C:04A4H LINE# 98
C:04A6H LINE# 99
C:04A9H LINE# 102
C:04ABH LINE# 103
C:04AEH LINE# 106
C:04B0H LINE# 107
C:04B3H LINE# 110
C:04B5H LINE# 111
C:04B8H LINE# 112
C:04BAH LINE# 115
C:04BCH LINE# 116
C:04BFH LINE# 119
C:04C1H LINE# 120
C:04C4H LINE# 123
C:04C7H LINE# 127
C:04CAH LINE# 128
C:04D1H LINE# 129
C:04D4H LINE# 130
C:04DBH LINE# 131
C:04DEH LINE# 132
C:04E5H LINE# 137
C:04E7H LINE# 138
C:04E9H LINE# 145
C:04ECH LINE# 146
C:04F0H LINE# 147
C:04F3H LINE# 148
C:04F5H LINE# 149
C:04F8H LINE# 150
C:04F8H LINE# 151
C:04FAH LINE# 152
C:04FEH LINE# 153
C:0501H LINE# 154
C:0503H LINE# 155
C:050CH LINE# 156
C:050CH LINE# 157
C:050CH LINE# 160
C:050FH LINE# 161
C:050FH LINE# 162
C:0512H LINE# 165
C:0515H LINE# 169
C:0528H LINE# 170
C:0528H LINE# 173
C:052AH LINE# 174
C:0532H LINE# 175
C:0532H LINE# 176
C:0535H LINE# 177
C:0538H LINE# 178
C:053BH LINE# 179
C:053EH LINE# 181
C:0541H LINE# 183
C:054AH LINE# 184
C:054DH LINE# 185
C:0550H LINE# 186
C:0550H LINE# 188
C:0555H LINE# 192
C:0558H LINE# 193
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 6
C:0558H LINE# 196
C:0562H LINE# 198
C:0565H LINE# 199
C:0568H LINE# 200
C:056BH LINE# 201
C:056EH LINE# 202
C:0571H LINE# 203
C:0574H LINE# 204
C:0577H LINE# 205
C:057AH LINE# 208
C:057AH LINE# 212
C:0587H LINE# 213
C:0587H LINE# 214
C:058BH LINE# 215
C:058BH LINE# 216
C:058EH LINE# 217
C:0591H LINE# 218
C:0591H LINE# 219
C:0591H LINE# 222
C:059EH LINE# 223
C:059EH LINE# 224
C:05A2H LINE# 225
C:05A2H LINE# 226
C:05A5H LINE# 227
C:05A8H LINE# 228
C:05A8H LINE# 229
C:05A8H LINE# 232
C:05B5H LINE# 233
C:05B5H LINE# 234
C:05B9H LINE# 235
C:05B9H LINE# 236
C:05BCH LINE# 237
C:05BFH LINE# 238
C:05BFH LINE# 239
C:05BFH LINE# 242
C:05CFH LINE# 243
C:05CFH LINE# 244
C:05D6H LINE# 245
C:05D6H LINE# 246
C:05D9H LINE# 247
C:05DCH LINE# 248
C:05DCH LINE# 249
C:05DCH LINE# 260
------- ENDPROC MAIN
------- PROC RELAY_SET
C:000EH LINE# 266
C:000EH LINE# 267
C:000EH LINE# 269
C:0010H LINE# 270
C:0017H LINE# 271
C:0019H LINE# 272
------- ENDPROC RELAY_SET
------- PROC RELAY_RESET
C:09C1H LINE# 276
C:09C1H LINE# 277
C:09C1H LINE# 279
C:09C3H LINE# 280
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 7
C:09CAH LINE# 281
C:09CCH LINE# 282
------- ENDPROC RELAY_RESET
------- PROC ALL_LED_ON
C:001AH LINE# 285
C:001AH LINE# 286
C:001AH LINE# 288
C:001CH LINE# 289
C:001EH LINE# 290
C:0020H LINE# 291
C:0022H LINE# 292
------- ENDPROC ALL_LED_ON
------- PROC ALL_LED_OFF
C:09D9H LINE# 296
C:09D9H LINE# 297
C:09D9H LINE# 299
C:09DBH LINE# 300
C:09DDH LINE# 301
C:09DFH LINE# 302
C:09E1H LINE# 303
------- ENDPROC ALL_LED_OFF
------- PROC SCAN_ALL_PD_STATE
C:0967H LINE# 306
C:0967H LINE# 307
C:0967H LINE# 309
C:0973H LINE# 312
C:0976H LINE# 313
C:0979H LINE# 314
C:0979H LINE# 315
C:097CH LINE# 316
C:097FH LINE# 317
C:097FH LINE# 318
C:0982H LINE# 319
C:0985H LINE# 320
C:0985H LINE# 321
C:0988H LINE# 322
C:098BH LINE# 323
C:098BH LINE# 324
C:098BH LINE# 329
------- ENDPROC SCAN_ALL_PD_STATE
------- PROC RESET_SELF_CHECK
C:098CH LINE# 332
C:098CH LINE# 333
C:098CH LINE# 335
C:098FH LINE# 336
C:0993H LINE# 338
C:0995H LINE# 341
C:099DH LINE# 342
C:099DH LINE# 344
C:09A0H LINE# 345
C:09A2H LINE# 346
C:09A6H LINE# 347
C:09A8H LINE# 348
C:09A8H LINE# 349
------- ENDPROC RESET_SELF_CHECK
------- PROC START_ALARM
C:000AH LINE# 354
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 8
C:000AH LINE# 355
C:000AH LINE# 370
------- ENDPROC START_ALARM
------- PROC START_ALARM_PD1
C:089FH LINE# 374
C:089FH LINE# 375
C:089FH LINE# 377
C:08A7H LINE# 378
C:08A7H LINE# 379
C:08AAH LINE# 380
C:08B3H LINE# 381
C:08B5H LINE# 382
C:08B9H LINE# 383
C:08BBH LINE# 384
C:08BEH LINE# 385
C:08C1H LINE# 387
C:08C3H LINE# 390
C:08C6H LINE# 391
C:08C6H LINE# 393
------- ENDPROC START_ALARM_PD1
------- PROC START_ALARM_PD2
C:08C7H LINE# 397
C:08C7H LINE# 398
C:08C7H LINE# 400
C:08CFH LINE# 401
C:08CFH LINE# 402
C:08D2H LINE# 403
C:08DBH LINE# 404
C:08DDH LINE# 405
C:08E1H LINE# 406
C:08E3H LINE# 407
C:08E6H LINE# 408
C:08E9H LINE# 410
C:08EBH LINE# 412
C:08EEH LINE# 413
C:08EEH LINE# 414
------- ENDPROC START_ALARM_PD2
------- PROC START_ALARM_PD3
C:08EFH LINE# 417
C:08EFH LINE# 418
C:08EFH LINE# 420
C:08F7H LINE# 421
C:08F7H LINE# 422
C:08FAH LINE# 423
C:0903H LINE# 424
C:0905H LINE# 425
C:0909H LINE# 426
C:090BH LINE# 427
C:090EH LINE# 428
C:0911H LINE# 430
C:0913H LINE# 433
C:0916H LINE# 434
C:0916H LINE# 435
------- ENDPROC START_ALARM_PD3
------- PROC START_ALARM_PD4
C:0917H LINE# 438
C:0917H LINE# 439
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 9
C:0917H LINE# 441
C:091FH LINE# 442
C:091FH LINE# 443
C:0922H LINE# 444
C:092BH LINE# 445
C:092DH LINE# 446
C:0931H LINE# 447
C:0933H LINE# 448
C:0936H LINE# 449
C:0939H LINE# 451
C:093BH LINE# 454
C:093EH LINE# 455
C:093EH LINE# 456
------- ENDPROC START_ALARM_PD4
------- PROC RESET_ALARM
C:09EBH LINE# 460
C:09EBH LINE# 461
C:09EBH LINE# 480
------- ENDPROC RESET_ALARM
------- PROC RESET_ALARM_PD1
C:0792H LINE# 485
C:0792H LINE# 486
C:0792H LINE# 488
C:0796H LINE# 489
C:0796H LINE# 490
C:0799H LINE# 491
C:079DH LINE# 492
C:079FH LINE# 493
C:07A7H LINE# 494
C:07A9H LINE# 495
C:07ABH LINE# 498
C:07ADH LINE# 499
C:07AFH LINE# 500
C:07AFH LINE# 502
C:07C3H LINE# 503
C:07C3H LINE# 504
C:07C5H LINE# 507
C:07C8H LINE# 508
C:07C8H LINE# 510
------- ENDPROC RESET_ALARM_PD1
------- PROC RESET_ALARM_PD2
C:07C9H LINE# 514
C:07C9H LINE# 515
C:07C9H LINE# 517
C:07CDH LINE# 518
C:07CDH LINE# 519
C:07D0H LINE# 520
C:07D4H LINE# 521
C:07D6H LINE# 522
C:07DEH LINE# 523
C:07E0H LINE# 524
C:07E2H LINE# 527
C:07E4H LINE# 528
C:07E6H LINE# 529
C:07E6H LINE# 532
C:07FAH LINE# 533
C:07FAH LINE# 534
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 10
C:07FCH LINE# 537
C:07FFH LINE# 538
C:07FFH LINE# 539
------- ENDPROC RESET_ALARM_PD2
------- PROC RESET_ALARM_PD3
C:0800H LINE# 542
C:0800H LINE# 543
C:0800H LINE# 545
C:0804H LINE# 546
C:0804H LINE# 547
C:0807H LINE# 548
C:080BH LINE# 549
C:080DH LINE# 550
C:0815H LINE# 551
C:0817H LINE# 552
C:0819H LINE# 555
C:081BH LINE# 556
C:081DH LINE# 557
C:081DH LINE# 559
C:0831H LINE# 560
C:0831H LINE# 561
C:0833H LINE# 564
C:0836H LINE# 565
C:0836H LINE# 566
------- ENDPROC RESET_ALARM_PD3
------- PROC RESET_ALARM_PD4
C:0837H LINE# 569
C:0837H LINE# 570
C:0837H LINE# 572
C:083BH LINE# 573
C:083BH LINE# 574
C:083EH LINE# 575
C:0842H LINE# 576
C:0844H LINE# 577
C:084CH LINE# 578
C:084EH LINE# 579
C:0850H LINE# 582
C:0852H LINE# 583
C:0854H LINE# 584
C:0854H LINE# 585
C:0868H LINE# 586
C:0868H LINE# 587
C:086AH LINE# 590
C:086DH LINE# 591
C:086DH LINE# 592
------- ENDPROC RESET_ALARM_PD4
------- PROC _DELAY1MS
D:0006H SYMBOL n
------- DO
D:0004H SYMBOL i
D:0002H SYMBOL j
------- ENDDO
C:093FH LINE# 600
C:093FH LINE# 601
C:093FH LINE# 605
C:0942H LINE# 606
C:0942H LINE# 608
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 11
C:0949H LINE# 609
C:094CH LINE# 610
C:094EH LINE# 611
C:0950H LINE# 612
C:0952H LINE# 613
C:0954H LINE# 614
C:095FH LINE# 615
C:0966H LINE# 616
------- ENDPROC _DELAY1MS
------- ENDMOD MAIN
------- MODULE TIMER0
C:0000H SYMBOL ICE_DUMMY
D:0080H PUBLIC P0
D:0090H PUBLIC P1
D:00A0H PUBLIC P2
B:0080H.5 PUBLIC LED1
B:0080H.7 PUBLIC LED2
B:00A0H.0 PUBLIC LED3
B:0090H.6 PUBLIC LED4
D:00A8H PUBLIC IEN0
D:00B8H PUBLIC IEN1
D:00D8H PUBLIC S0CON2
C:09A9H PUBLIC InitT0T1
D:0087H PUBLIC PCON
D:0089H PUBLIC TMOD
D:0088H PUBLIC TCON
C:09E2H PUBLIC get_current_time
D:0067H PUBLIC time_count
D:00F0H PUBLIC B
D:0086H PUBLIC WDTR
D:00E0H PUBLIC ACC
B:00A8H.1 PUBLIC ET0
D:008CH PUBLIC TH0
D:008AH PUBLIC TL0
B:00A8H.7 PUBLIC EAL
B:0088H.4 PUBLIC TR0
C:0026H PUBLIC T0Interrupt
D:006BH PUBLIC wdt_count
D:0098H PUBLIC S0CON
D:00E7H PUBLIC TCON0
D:00C8H PUBLIC T2CON
D:00D0H PUBLIC PSW
D:00C0H PUBLIC IRCON
------- PROC INITT0T1
C:09A9H LINE# 18
C:09A9H LINE# 19
C:09A9H LINE# 20
C:09B1H LINE# 24
C:09B4H LINE# 25
C:09B7H LINE# 27
C:09BAH LINE# 29
C:09BCH LINE# 30
C:09BEH LINE# 31
C:09C0H LINE# 34
------- ENDPROC INITT0T1
------- PROC T0INTERRUPT
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 12
C:0026H LINE# 38
C:0043H LINE# 41
C:0046H LINE# 42
C:0049H LINE# 44
C:005EH LINE# 47
C:0070H LINE# 48
C:007CH LINE# 49
C:007FH LINE# 50
C:007FH LINE# 54
C:0086H LINE# 55
C:0086H LINE# 56
C:008EH LINE# 57
C:009AH LINE# 60
C:00A1H LINE# 61
C:00A1H LINE# 62
C:00B3H LINE# 63
C:00B3H LINE# 64
C:00B3H LINE# 65
C:00BEH LINE# 66
C:00BEH LINE# 67
C:00C1H LINE# 68
C:00C7H LINE# 69
C:00CAH LINE# 70
C:00CAH LINE# 71
C:00CCH LINE# 73
C:00CCH LINE# 74
C:00D7H LINE# 75
C:00D7H LINE# 76
C:00DAH LINE# 77
C:00E0H LINE# 78
C:00E3H LINE# 79
C:00E3H LINE# 80
C:00E5H LINE# 82
C:00E5H LINE# 83
C:00F0H LINE# 84
C:00F0H LINE# 85
C:00F3H LINE# 86
C:00F9H LINE# 87
C:00FCH LINE# 88
C:00FCH LINE# 89
C:00FEH LINE# 91
C:00FEH LINE# 92
C:0109H LINE# 93
C:0109H LINE# 94
C:010FH LINE# 95
C:0112H LINE# 97
C:011AH LINE# 98
C:0125H LINE# 99
C:0125H LINE# 100
C:0128H LINE# 101
C:012BH LINE# 102
C:012DH LINE# 104
C:012DH LINE# 106
C:0130H LINE# 107
C:0130H LINE# 108
C:0130H LINE# 109
C:0130H LINE# 110
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 13
C:0130H LINE# 111
C:0130H LINE# 114
C:0137H LINE# 115
C:0137H LINE# 117
C:0141H LINE# 118
C:0149H LINE# 119
C:015BH LINE# 120
C:015BH LINE# 121
C:015BH LINE# 122
C:0169H LINE# 123
C:0169H LINE# 124
C:016BH LINE# 125
C:0171H LINE# 126
C:0174H LINE# 127
C:0174H LINE# 128
C:0176H LINE# 130
C:0176H LINE# 131
C:0181H LINE# 132
C:0181H LINE# 133
C:0183H LINE# 134
C:0189H LINE# 135
C:018CH LINE# 136
C:018CH LINE# 137
C:018EH LINE# 139
C:018EH LINE# 140
C:0199H LINE# 141
C:0199H LINE# 142
C:019BH LINE# 143
C:01A1H LINE# 144
C:01A4H LINE# 145
C:01A4H LINE# 146
C:01A6H LINE# 148
C:01A6H LINE# 149
C:01B1H LINE# 150
C:01B1H LINE# 151
C:01B7H LINE# 152
C:01BAH LINE# 154
C:01D3H LINE# 155
C:01E9H LINE# 156
C:01E9H LINE# 157
C:01ECH LINE# 158
C:01EFH LINE# 159
C:01F1H LINE# 161
C:01F1H LINE# 162
C:01F3H LINE# 163
C:01F3H LINE# 164
C:01F3H LINE# 165
C:01F3H LINE# 166
C:01F3H LINE# 167
C:01F3H LINE# 170
C:01FDH LINE# 171
C:0205H LINE# 172
C:0217H LINE# 173
C:0217H LINE# 174
C:0217H LINE# 175
C:0225H LINE# 176
C:0225H LINE# 177
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 14
C:0227H LINE# 178
C:022DH LINE# 179
C:0230H LINE# 180
C:0230H LINE# 181
C:0232H LINE# 183
C:0232H LINE# 184
C:023DH LINE# 185
C:023DH LINE# 186
C:023FH LINE# 187
C:0245H LINE# 188
C:0248H LINE# 189
C:0248H LINE# 190
C:024AH LINE# 192
C:024AH LINE# 193
C:0255H LINE# 194
C:0255H LINE# 195
C:0257H LINE# 196
C:025DH LINE# 197
C:0260H LINE# 198
C:0260H LINE# 199
C:0262H LINE# 201
C:0262H LINE# 202
C:026DH LINE# 203
C:026DH LINE# 204
C:0273H LINE# 205
C:0276H LINE# 207
C:028FH LINE# 208
C:02A5H LINE# 209
C:02A5H LINE# 210
C:02A8H LINE# 211
C:02ABH LINE# 212
C:02ADH LINE# 214
C:02ADH LINE# 215
C:02AFH LINE# 216
C:02AFH LINE# 217
C:02AFH LINE# 218
C:02AFH LINE# 219
C:02AFH LINE# 220
C:02AFH LINE# 223
C:02B9H LINE# 224
C:02C1H LINE# 225
C:02D3H LINE# 226
C:02D3H LINE# 227
C:02D3H LINE# 228
C:02E1H LINE# 229
C:02E1H LINE# 230
C:02E3H LINE# 231
C:02E9H LINE# 232
C:02ECH LINE# 233
C:02ECH LINE# 234
C:02EEH LINE# 236
C:02EEH LINE# 237
C:02F9H LINE# 238
C:02F9H LINE# 239
C:02FBH LINE# 240
C:0301H LINE# 241
C:0304H LINE# 242
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 15
C:0304H LINE# 243
C:0306H LINE# 245
C:0306H LINE# 246
C:0311H LINE# 247
C:0311H LINE# 248
C:0313H LINE# 249
C:0319H LINE# 250
C:031CH LINE# 251
C:031CH LINE# 252
C:031EH LINE# 254
C:031EH LINE# 255
C:0329H LINE# 256
C:0329H LINE# 257
C:032FH LINE# 258
C:0332H LINE# 260
C:034BH LINE# 261
C:0361H LINE# 262
C:0361H LINE# 263
C:0364H LINE# 264
C:0367H LINE# 265
C:0369H LINE# 267
C:0369H LINE# 268
C:036BH LINE# 269
C:036BH LINE# 270
C:036BH LINE# 271
C:036BH LINE# 272
C:036BH LINE# 273
C:036BH LINE# 276
C:0375H LINE# 277
C:037DH LINE# 278
C:038FH LINE# 279
C:038FH LINE# 280
C:038FH LINE# 281
C:039DH LINE# 282
C:039DH LINE# 283
C:039FH LINE# 284
C:03A5H LINE# 285
C:03A8H LINE# 286
C:03A8H LINE# 287
C:03ABH LINE# 289
C:03ABH LINE# 290
C:03B9H LINE# 291
C:03B9H LINE# 292
C:03BBH LINE# 293
C:03C1H LINE# 294
C:03C4H LINE# 295
C:03C4H LINE# 296
C:03C7H LINE# 298
C:03C7H LINE# 299
C:03D5H LINE# 300
C:03D5H LINE# 301
C:03D7H LINE# 302
C:03DDH LINE# 303
C:03E0H LINE# 304
C:03E0H LINE# 305
C:03E3H LINE# 307
C:03E3H LINE# 308
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 16
C:03F1H LINE# 309
C:03F1H LINE# 310
C:03F7H LINE# 311
C:03FAH LINE# 313
C:0413H LINE# 314
C:0429H LINE# 315
C:0429H LINE# 316
C:042CH LINE# 317
C:042FH LINE# 318
C:0431H LINE# 320
C:0431H LINE# 321
C:0433H LINE# 322
C:0433H LINE# 323
C:0433H LINE# 324
C:0435H LINE# 325
C:0435H LINE# 326
C:0435H LINE# 327
C:0435H LINE# 328
C:0435H LINE# 329
C:0442H LINE# 331
C:0457H LINE# 332
C:046CH LINE# 333
C:0478H LINE# 334
C:047BH LINE# 336
C:047BH LINE# 337
C:047BH LINE# 342
------- ENDPROC T0INTERRUPT
------- PROC GET_CURRENT_TIME
C:09E2H LINE# 345
C:09E2H LINE# 346
C:09E2H LINE# 347
C:09EAH LINE# 348
------- ENDPROC GET_CURRENT_TIME
------- ENDMOD TIMER0
------- MODULE UART0
C:0000H SYMBOL ICE_DUMMY
D:0080H PUBLIC P0
D:0090H PUBLIC P1
D:00A0H PUBLIC P2
D:00A8H PUBLIC IEN0
D:00B8H PUBLIC IEN1
D:00D8H PUBLIC S0CON2
D:0050H PUBLIC u8Rx0Flag
D:0051H PUBLIC u8Tx0Flag
D:0052H PUBLIC u8Rx0BufLength
D:00BAH PUBLIC S0RELH
D:0087H PUBLIC PCON
B:0080H.3 PUBLIC P03
D:00AAH PUBLIC S0RELL
D:0088H PUBLIC TCON
C:074BH PUBLIC UART0_ISR
D:00F0H PUBLIC B
C:09CDH PUBLIC _UART0TX_WriteOneByte
D:00E0H PUBLIC ACC
D:0053H PUBLIC u8Rx0Buf
C:0003H PUBLIC UART0_Enable_Interrupt
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 17
D:00F9H PUBLIC P0M
D:0099H PUBLIC S0BUF
C:06FBH PUBLIC UART0_Init
D:0098H PUBLIC S0CON
D:00C8H PUBLIC T2CON
D:00D0H PUBLIC PSW
D:00C0H PUBLIC IRCON
------- PROC _UART0TX_WRITEONEBYTE
D:0007H SYMBOL tx0Data
C:09CDH LINE# 128
C:09CDH LINE# 129
C:09CDH LINE# 130
C:09CFH LINE# 132
C:09D3H LINE# 134
C:09D5H LINE# 135
C:09D5H LINE# 136
C:09D8H LINE# 137
C:09D8H LINE# 138
------- ENDPROC _UART0TX_WRITEONEBYTE
------- PROC UART0_ENABLE_INTERRUPT
C:0003H LINE# 145
C:0003H LINE# 146
C:0003H LINE# 147
C:0006H LINE# 149
C:0009H LINE# 150
------- ENDPROC UART0_ENABLE_INTERRUPT
------- PROC UART0_INIT
C:06FBH LINE# 157
C:06FBH LINE# 158
C:06FBH LINE# 159
C:06FDH LINE# 160
C:0700H LINE# 168
C:0703H LINE# 171
C:0706H LINE# 173
C:071AH LINE# 174
C:071AH LINE# 175
C:071AH LINE# 176
C:071AH LINE# 177
C:071AH LINE# 179
C:071AH LINE# 181
C:071AH LINE# 182
C:071CH LINE# 183
C:071CH LINE# 184
C:071FH LINE# 185
C:0722H LINE# 187
C:0722H LINE# 189
C:0722H LINE# 190
C:0724H LINE# 191
C:0724H LINE# 192
C:0727H LINE# 193
C:072AH LINE# 195
C:072AH LINE# 197
C:072AH LINE# 198
C:072CH LINE# 199
C:072CH LINE# 200
C:072FH LINE# 201
C:0732H LINE# 203
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 18
C:0732H LINE# 205
C:0732H LINE# 206
C:0734H LINE# 207
C:0734H LINE# 208
C:0737H LINE# 209
C:073AH LINE# 211
C:073AH LINE# 213
C:073AH LINE# 214
C:073CH LINE# 215
C:073FH LINE# 218
C:0742H LINE# 220
C:0745H LINE# 222
C:0748H LINE# 223
C:0748H LINE# 224
C:0748H LINE# 226
------- ENDPROC UART0_INIT
------- PROC UART0_ISR
C:074BH LINE# 232
C:0756H LINE# 234
C:075CH LINE# 235
C:075CH LINE# 236
C:075FH LINE# 238
C:0762H LINE# 240
C:076CH LINE# 241
C:076FH LINE# 243
C:077AH LINE# 244
C:077AH LINE# 245
C:077DH LINE# 246
C:077DH LINE# 247
C:077DH LINE# 249
C:0783H LINE# 250
C:0783H LINE# 251
C:0786H LINE# 253
C:0789H LINE# 254
C:0789H LINE# 255
------- ENDPROC UART0_ISR
------- ENDMOD UART0
------- MODULE OPTIONS_SN8F5702A
N:000EH SYMBOL CLOCKSRC_SET
N:0030H SYMBOL RESETPIN_SET
N:1000H SYMBOL ROM_SIZE
N:0001H SYMBOL SECURITY_SET
N:00C0H SYMBOL WATCHCLK_SET
N:0050H SYMBOL WATCHDOG_SET
------- ENDMOD OPTIONS_SN8F5702A
------- MODULE ?C?ULCMP
C:086EH PUBLIC ?C?ULCMP
------- ENDMOD ?C?ULCMP
------- MODULE ?C?LILDIDATA
C:0888H PUBLIC ?C?LILDIDATA
C:087FH PUBLIC ?C?LILDIDATA1
C:0881H PUBLIC ?C?LILDIDATA8
------- ENDMOD ?C?LILDIDATA
BL51 BANKED LINKER/LOCATER V6.22.2.0 12/31/2024 16:11:53 PAGE 19
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?START_ALARM?MAIN
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?RESET_ALARM?MAIN
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?GET_CURRENT_TIME?TIMER0
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_UART0TX_WRITEONEBYTE?UART0
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?UART0_INIT?UART0
Program Size: data=112.0 xdata=0 code=2550
LINK/LOCATE RUN COMPLETE. 5 WARNING(S), 0 ERROR(S)
分析空间占用和其他也要解释
Map 文件结构:
这个 Map 文件主要分为以下几个部分:
BL51 BANKED LINKER/LOCATER 版本信息:
显示了使用的 BL51 链接器/定位器的版本号。
BL51 BANKED LINKER/LOCATER V6.22.2.0 表明使用的是 Keil 的 BL51 链接器/定位器,版本号是 6.22.2.0。
链接器调用信息:
显示了 BL51 链接器被调用时使用的命令行参数,包括:
输入的目标文件 (.obj 文件)。
输出的 Map 文件名。
内存大小 (RAMSIZE (256),表示 RAM 大小为 256 字节)。
MEMORY MODEL:
MEMORY MODEL: SMALL 表示使用了 SMALL 内存模型,这意味着代码和数据都在 64K 范围内。
INPUT MODULES INCLUDED:
列出了参与链接的所有输入模块 (.obj 文件),包括:
您的源代码编译生成的目标文件 (main.obj, Timer0.obj, UART0.obj, OPTIONS_SN8F5702A.obj).
Keil 的 C 库文件 (C51S.LIB 中的启动代码 ?C_STARTUP 等)。
LINK MAP OF MODULE:
显示了各个段在内存中的分配情况,分为数据内存 (DATA MEMORY) 和代码内存 (CODE MEMORY) 两部分。
OVERLAY MAP OF MODULE:
显示了函数之间的调用关系,并分析了哪些函数可以进行 Overlay (覆盖),从而节省 RAM。
SYMBOL TABLE OF MODULE:
列出了所有的符号 (包括变量、函数等),及其地址、类型等信息。
WARNING 信息:
显示了编译器和链接器产生的警告信息。
内存空间占用分析:
DATA MEMORY:
REG 0000H 0008H ABSOLUTE "REG BANK 0"
表示寄存器区(Register Bank 0),起始地址为 0000H,大小为 0008H (8 字节)。
DATA 0008H 0048H UNIT ?DT?MAIN
表示 main.obj 模块中的 data 段,起始地址为 0008H,大小为 0048H (72 字节)。
通常包含已初始化的全局变量和静态变量。
DATA 0050H 0017H UNIT ?DT?UART0
表示 UART0.obj 模块中的 data 段,起始地址为 0050H,大小为 0017H (23 字节)。
通常包含已初始化的全局变量和静态变量。
DATA 0067H 0008H UNIT ?DT?TIMER0
表示 Timer0.obj 模块中的 data 段,起始地址为 0067H,大小为 0008H (8 字节)。
通常包含已初始化的全局变量和静态变量。
IDATA 006FH 0001H UNIT ?STACK
表示 stack 段, 起始地址为 006FH, 大小为 0001H (1 字节),这非常小,表示你的栈空间很小,可能需要增加栈空间以避免堆栈溢出。
* `IDATA` 表示内部 RAM。
Use code with caution.
RAM 使用情况:
从DATA段来看,全局变量和静态变量总共使用了 8 + 72 + 23 + 8 = 111个字节。
从IDATA 段来看,栈使用了 1 字节。
总的RAM使用量为 112 个字节。
CODE MEMORY:
CODE 0000H 0003H ABSOLUTE
表示代码起始地址为 0000H, 占用3个字节,通常是启动代码。
CODE 0003H 0007H UNIT ?PR?UART0_ENABLE_INTERRUPT?UART0
表示 UART0_ENABLE_INTERRUPT 函数的代码段,起始地址为 0003H,占用7个字节。
CODE 000AH 0001H UNIT ?PR?START_ALARM?MAIN
表示 START_ALARM 函数的代码段,起始地址为 000AH,占用1个字节。
* CODE 000BH 0003H ABSOLUTE
表示起始地址为 000BH,占用3个字节。
* ** CODE 000EH 000CH UNIT ?PR?RELAY_SET?MAIN**
表示 RELAY_SET 函数的代码段,起始地址为 000EH,占用12个字节。
* 其他 CODE 段类似,都表示不同的函数代码。
* CODE 05DFH 0090H UNIT ?C_INITSEG
* 表示C库的初始化代码,占用144个字节
* CODE 066FH 008CH UNIT ?C_C51STARTUP
* 表示C库的启动代码,占用140个字节。
* 代码占用情况:
所有的 CODE 段加起来,可以看到代码段占用了 2550 个字节。
OVERLAY MAP 分析:
作用: 可以查看程序中的函数调用关系,分析哪些函数可以覆盖使用内存空间,可以优化代码,减少RAM占用。
分析方法: 可以看到每个函数会调用哪些函数,方便我们分析调用关系和优化程序。
SYMBOL TABLE 分析:
作用: 可以查看所有变量和函数的定义和地址。
分析方法:
VALUE 表示地址,TYPE表示变量或者函数的类型,NAME表示名称。
D: 表示数据区, C: 表示代码区, B: 表示位变量。
可以看到每个变量的地址,从而确定哪些变量占用了RAM空间。
还可以看到变量的类型,方便我们分析变量的大小。
WARNING 信息分析:
WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS 表示某些代码段没有被调用,因此可以忽略掉,例如:
?PR?START_ALARM?MAIN: 表示 START_ALARM 函数没有被调用。
?PR?RESET_ALARM?MAIN: 表示 RESET_ALARM 函数没有被调用。
?PR?GET_CURRENT_TIME?TIMER0 : 表示 GET_CURRENT_TIME 函数没有被调用。
?PR?_UART0TX_WRITEONEBYTE?UART0 : 表示 _UART0TX_WRITEONEBYTE 函数没有被调用。
?PR?UART0_INIT?UART0 : 表示UART0_INIT函数没有被调用。
解决: 如果这些函数确实不需要被调用,可以删除或者注释掉,以免浪费代码空间。
总结:
这个 Map 文件提供了关于程序内存分配的详细信息,您可以从中了解到:
RAM 使用情况: 数据段使用了 111 字节的 RAM,栈使用了1字节的RAM, 可以看到,RAM资源使用很少,可能需要扩展栈空间。
代码空间占用: 代码段共占用 2550个字节。
函数调用关系: OVERLAY MAP 可以看到函数之间的调用关系。
未调用函数: WARNING 信息提示了一些未调用的代码段。
资源占用: 程序中声明的所有变量的地址和类型。
通过分析 Map 文件,您可以更好地了解程序运行时的内存使用情况,并进行代码优化,以避免内存溢出,提高程序效率。
希望这个详细的分析能够帮助您理解 Map 文件!如果您还有其他问题,请随时提出。
芯片读回的程序(整个地址0x00000--0x00ff0)