keil错误ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

在利用Keil C51编程时,发现程序逻辑上没有错误,但在连接时却出现了错误,如下:

*** ERROR L107: ADDRESS SPACE OVERFLOW

    SPACE:   DATA   

    SEGMENT: ?DT?GMNS_3V4

    LENGTH: 0014H

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: RECEIVE_TIMER

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: DUAL_REC_BUF

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: LAST_SEND_TIME_COUNT

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: POW_STATUS

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: POW_STATE

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: GROUP_TEST

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: S_COUNT_P

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: R_COUNT_P

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: RING_JUDGE_STATEB1

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: RING_JUDGE_STATEB0

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: YAOXIN_CHECK_STATUS4

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: YAOXIN_CHECK_STATUS3

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: YAOXIN_CHECK_STATUS2

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: YAOXIN_CHECK_STATUS1

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: YAOXIN_CHECK_STATUS0

    SEGMENT: ?DT?GMNS_3V4

*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT

    SYMBOL: YAO_XIN_COUNT

    SEGMENT: ?DT?GMNS_3V4

出现以上错误的原因主要是第一个原因,第一个原因导致了它下面所有错误,第一个原因是:

    ERROR L107: ADDRESS SPACE OVERFLOW

    SPACE:   DATA   

    SEGMENT: ?DT?GMNS_3V4

    LENGTH: 0014H

说明data空间已经不够用,原因是你可能有好多函数,而函数内部的局部变量又没有定义其空间,这种情况下,系统会将变量分配到你在Otions for Target 对话框里的设置的空间。如果你在下图所示中的 Memory Model 里设置成 Small:variables in DATA,则DATA空间很快便用完,导致data空间不够用。解决的办法有两种,一是通过更改Memory Model设置,可以设置成pdata或xdata,以便有足够大的空间,但这又带来新的问题,程序运行速度减慢,而且code代码也会加大,因为如果一个局部变量被存放在了xdata空间,汇编语言访问xdata空间的代码大小要比访问data空间的代码大,变量一旦很多,程序的代码也会逐渐增大;二是根据自己的要求设置变量的空间。所以这涉及到代码优化的问题,遇到具体问题时,在运行速度和代码大小之间取得适合自己的情况。

 


评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值