大家好!我在用PICC编绎器的时候遇到一个问题!就是自动变量只能存放在bank0中,而存放在bank1~3中在编绎时就会出错。而bank1~3只能存放静态变量。我的程序很简单。以下图1为PICC编绎的错误提示,而图2是MPLAB中带自的C编绎中的提示,虽然没有提示,但是就出现在一个警告。
#include <pic.h>
void main(void)
{
bank1 char i;//为什么这里编绎会出错,但是改为“char i;”就没有错了。
i=12;
while(1);
}
图1
(原文件名:错误提示.JPG)
图2
(原文件名:MPLAB自带C编绎器中也会警告.JPG)
更可笑的是,我在
http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=4373781&bbs_page_no=1&search_mode=3&search_text=lgh050706&bbs_id=9999
http://pic16.com/bbs/dispbbs.asp?boardid=24&Id=54463
发了一个帖子,竟然没有人有正面的回答,只不是表明这个问题只有我遇到,而大家就从来没有遇到啊!
The bank0, bank1, bank2 and bank3 type qualifiers are always recognised by HI-TECH C
PRO for the PIC10/12/16 MCU Family so that code may be easily ported from other compilers,
however by default, these qualifiers have no effect.
If the --ADDRQUAL option is set to request(see Section 2.6.19), the bank0, bank1, bank2
and bank3 qualifiers become a recommendation to place non-auto variables in RAM bank 0, bank
1, bank2 and bank 3, respectively. If space is not available in these banks, another bank will be used.
If the --ADDRQUAL option is set to require, the bank qualifiers will always place non-auto
objects in the bank specified. If no room exists in that bank, an error will be generated.
The following example of bank qualifier usage will either recommend or force (dependent on
the --ADDRQUAL option settings) the unsigned char to be stored in bank3:
static bank3 unsigned char fred;
一周热门 更多>