编译代码长度为什么不一样
同样的一段C代码,为什么在MPLAB6以上版本编译出的代码长度比MPLAB5.7环境下编译出的代码长度短,而且短代码写入芯片后还不能正常使用,用的是通同一个编译器HT-PICC 8.05PL1。MPLAB6以上版本编译信息:Clean: Deleting intermediary and output files.
Clean: Deleted file "I:Prg4pic zf zf.obj".
Clean: Deleted file "I:Prg4pic zf zf.cce".
Clean: Deleted file "rzf.cof".
Clean: Deleted file "I:Prg4pic zf zf.mcs".
Clean: Done.
Executing: "C:HT-PICBINPICC.EXE" -C -E"rzf.cce" "rzf.c" -O"rzf.obj" -Zg9 -O -ASMLIST -Q -MPLAB 16F873
Warning I:Prg4pic zf zf.c 586 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 607 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 611 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 621 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 627 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 631 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 645 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 649 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 659 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 665 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 669 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 674 : implicit conversion of float to integer
Warning I:Prg4pic zf zf.c 675 : implicit conversion of float to integer
Executing: "C:HT-PICBINPICC.EXE" -E"rzf.lde" "I:Prg4pic zf zf.obj" -M"rzf.map" -O"rzf.cof" -O"rzf.hex" -Q -MPLAB -16F873
Memory Usage Map:
Program ROM $0000 - $009A$009B ( 155) words
Program ROM $05F4 - $07FF$020C ( 524) words
Program ROM $0812 - $0FFF$07EE (2030) words
$0A95 (2709) words total Program ROM
Bank 0 RAM $0022 - $006A$0049 ( 73) bytes
Bank 0 RAM $007F - $007F$0001 ( 1) bytes
$004A ( 74) bytes total Bank 0 RAM
Bank 1 RAM $00A0 - $00C2$0023 ( 35) bytes
Bank 1 RAM $00FF - $00FF$0001 ( 1) bytes
$0024 ( 36) bytes total Bank 1 RAM
Bank 0 Bits $0100 - $010B$000C ( 12) bitstotal Bank 0 Bits
Program statistics:
Total ROM used 2709 words (66.1%)
Total RAM used 112 bytes (58.3%)
MPLAB5.7下的编译信息
Memory Usage Map:
Program ROM $0000 - $00D0$00D1 ( 209) words
Program ROM $035E - $07FF$04A2 (1186) words
Program ROM $081A - $0FFF$07E6 (2022) words
$0D59 (3417) words total Program ROM
Bank 0 RAM $0022 - $006A$0049 ( 73) bytes
Bank 0 RAM $007F - $007F$0001 ( 1) bytes
$004A ( 74) bytes total Bank 0 RAM
Bank 1 RAM $00A0 - $00C2$0023 ( 35) bytes
Bank 1 RAM $00FF - $00FF$0001 ( 1) bytes
$0024 ( 36) bytes total Bank 1 RAM
Bank 0 Bits $0100 - $010B$000C ( 12) bitstotal Bank 0 Bits
Program statistics:
Total ROM used 3417 words (83.4%)
Total RAM used 112 bytes (58.3%)
Build completed successfully. 优化级别不同会导致代码长度不一致,一般说,优化级别越低,甚至是不优化,代码就越冗长,但也越可靠,只要程序空间够大,可以把优化级别调低点。
页:
[1]