本帖最后由 zhimagod 于 2018-3-26 15:55 编辑
在一个项目中使用了PIC12F683这个芯片。片内有两个bank,分别为bank0和bank1
bank0中有96字节通用寄存器,bank1中有32字节通用寄存器,一共128字节
编译之后不通过,原因写着一个大树组放不下了
将数组逐渐减小直到编译通过后发现所有变量均使用了bank0,而bank1里的32字节一点都没用上
很好奇,CSTACK 段只有21字节,bank1里完全放得下,为啥他就不放进bank1里呢?
Psect Usage Map:
Psect | Contents | Memory Range | Size
-----------|----------------------------------|---------------|-------------
reset_vec | Reset vector | 0000h - 0000h | 1 word
intentry | Interrupt context entry code | 0004h - 0009h | 6 words
end_init | Initialization code | 000Ah - 000Ah | 1 word
cinit | Initialization code | 000Bh - 0012h | 8 words
text5 | Program and library code | 0013h - 00B6h | 164 words
text7 | Program and library code | 00B7h - 0124h | 110 words
text9 | Program and library code | 0125h - 018Ch | 104 words
text1 | Program and library code | 018Dh - 01E9h | 93 words
maintext | Program code for main() function | 01EAh - 0233h | 74 words
text14 | Program and library code | 0234h - 027Ch | 73 words
text13 | Program and library code | 027Dh - 02BCh | 64 words
text6 | Program and library code | 02BDh - 02F5h | 57 words
text4 | Program and library code | 02F6h - 031Ch | 39 words
text15 | Program and library code | 031Dh - 0343h | 39 words
text12 | Program and library code | 0344h - 0365h | 34 words
text3 | Program and library code | 0366h - 0380h | 27 words
text2 | Program and library code | 0381h - 0399h | 25 words
text8 | Program and library code | 039Ah - 03AFh | 22 words
text10 | Program and library code | 03B0h - 03BDh | 14 words
text11 | Program and library code | 03BEh - 03CBh | 14 words
clrtext | Memory clearing code | 03CCh - 03D3h | 8 words
| | |
swtext1 | | 0001h - 0003h | 3 words
-----------|----------------------------------|---------------|-------------
cstackCOMM | Stack in common memory | 0070h - 007Ah | 11 bytes
bssCOMMON | RAM variables in common memory | 007Bh - 007Bh | 1 byte
| | |
bssBANK0 | BSS variables in bank 0 | 0020h - 0059h | 58 bytes
cstackBANK | Stack in bank 0 | 005Ah - 006Eh | 21 bytes
| | |
abs_s1 | Absolute RAM variables | 007Eh - 007Fh | 2 bytes
-----------|----------------------------------|---------------|-------------
config | | 2007h - 2007h | 1 word
-----------|----------------------------------|---------------|-------------
Memory Summary:
Program space used 3D3h ( 979) of 800h words ( 47.8%)
Data space used 5Dh ( 93) of 80h bytes ( 72.7%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of 20h bytes ( 0.0%)
Configuration bits used 1h ( 1) of 1h word (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
|