Keil Logo

What's New in C251 Version 5.57

  • 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.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.