keil c251 v5.57 uvision5开发工具 更新日志(2014年8月):
release date: 5 august, 2014
- comes with compiler version c251 v5.57
- removed: unnecessary warning c53 when bits are defined and declared in the same module.
-
corrected: problem with wrong type conversion when bitwise not operator (~) is used. example:
volatile unsigned long va, vb; void main(void) { vb = va & ~0x2; <-- wrong : results in vb = va & 0xfffd instead of vb = va & 0xfffffffd vb &= ~0x2; <-- wrong : results in vb &= 0xfffd instead of vb &= 0xfffffffd vb = va & -3; <-- correct : results in vb = va & 0xfffffffd }
-
corrected: l251 code optimization does not remove common blocks for unused functions. these code blocks remains inside the image. example:
unsigned char a, b, c; unsigned char darr [0x10]; void funca (void) { darr[c] = darr[b]; } void funcb (void) { darr[c] = darr[b]; } void funcc (void) { darr[c] = darr[a] darr[b]; } void funcd (void) { darr[c] = darr[a] darr[b]; } void main(void) { funca (); funcb (); while(1); } ; function funca (begin) ; function funcb (begin) ; function funcc (begin) ; function funcd (begin) r mov a,#low darr r mov a,#low darr r mov a,#low darr ----- ----- r mov a,#low darr r add a,b r add a,b r add a,b | r add a,b mov r0,a ----- ----- mov r0,a mov r0,a | mov r0,a mov a,@r0 | mov a,@r0 mov a,@r0 | mov a,@r0 mov r7,a | mov r7,a mov r7,a | mov r7,a r mov a,#low darr | r mov a,#low darr r mov a,#low darr ----- ----- r mov a,#low darr r add a,c | r add a,c r add a,a | r add a,a mov r0,a | mov r0,a mov r0,a | mov r0,a mov @r0,ar7 ----- ----- mov @r0,ar7 mov a,@r0 | mov a,@r0 ret | ret add a,r7 | add a,r7 o-> common code for funca and funcb mov r7,a | mov r7,a r mov a,#low darr | r mov a,#low darr r add a,c | r add a,c mov r0,a | mov r0,a mov @r0,ar7 | mov @r0,ar7 ret | ret o-> common code for funcc and funcd
in the example above the functions funcc() and funcd() are removed when the removeunused linker directive is specified. now, the first part of the common code block (function ?l?com0001) is no longer necessary. in previous verions this was still part of the image. with the new linker enhancement even this code block is removed.
----- function ?l?com0001 (begin) ----- 000021 7408 mov a,#low darr --- 000023 2519 add a,b |\ 000025 f8 mov r0,a | \ 000026 e6 mov a,@r0 | o-> common code for funcc and funcd 000027 ff mov r7,a | 000028 7408 mov a,#low darr --- 00002a ?l?com0002: 00002a f8 mov r0,a --- 00002b e6 mov a,@r0 |\ 00002c ff mov r7,a | \ 00002d 7408 mov a,#low darr | o-> common code for funca and funcb 00002f 251a add a,c | 000031 f8 mov r0,a | 000032 a607 mov @r0,ar7 --- 000034 22 ret ----- function ?l?com0001 (end) -------
- this c251 release comes with μvision v5.11.2.0.