What's New in Version 6.2x? C51 Version 6.2x offers several enhancements (when compared to C51 Version 6.0) that generate smaller, faster programs. These new features were added in V6.20 and V6.21. Dynamic Register Allocation A major improvement (which was introduced in C51 Version 6.20) is more dynamic register allocation which results in fewer MOV instructions and less overlayable data requirements. For example, the following program, int func (int i) { if (i > 0x50) return (i+1); else return (i); } char c; int k; int func2 (int i) { switch (c) { case 0: k = i+1; break; case 1: k = i; break; case 2: return (i+1); case 3: k = i*2; break; } return (0); } extern char Func3 (int iA, int iB, int iC); int TestFunc (int iA, int iB, int iC) { int iD, iE; iE = Func3 (iA, iC, iB); iD = 0xff; return (iD + iE); } when compiled with C51 V6.21, generates 101 bytes of code and uses no memory for variables (all variables are stored in registers). The same program, when compiled with C51 V6.01, generates 122 bytes of code and uses 2 bytes of overlayable data space. Switch/If Path Combination C51 V6.21 now combines identical paths in switch and if constructs. For example, the following program, extern char func (char x); char test (char y) { switch (y) { case 10: y = func (y | 0xC0) + 3; break; default: y = func (y | 0x80) + 3; break; } return y; } when compiled with C51 V6.21, generates 22 bytes of code and uses no memory for variables (all variables are stored in registers). The same program, when compiled with C51 V6.01, generates 39 bytes of code and uses 1 byte of overlayable data space. Long Compare for 0 Values C51 V6.21 improves the performance of long comparisons to the value 0. For example: long l; if (l < 0) c = 1; Copyright c 2002 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.