# Release Notes for C251
MCS® 251 Development Tool Kits

This file contains release notes and last minute changes.

Information in this file, the accompany manuals, and software is
Copyright © 2018 ARM Ltd and ARM Germany GmbH.
All rights reserved.

## Contents

1. What's New in C251
2. Example Programs
3. Device Database™
4. Peripheral Simulation
5. Technical Support
6. Contact Details

## What's New in C251

The following sections list the changes instituted in each release of the C251 toolset.

### C251 Version 5.60

- [C251 Compiler]
  - Corrected: enum value gets silently truncated. Example:

        enum E { x = 0x12345 };

    Now warning C118: 'x': enumeration value out of range is shown.
  - Corrected: a useless warning C53: redefinition of 'testbyte_2': different memory spaces appeared in following situations:

        extern unsigned char const edata testbyte_2;
        unsigned char const edata testbyte_2;

  - Corrected: allow slash '/' in addition to backslash '\' as a directory separator in all places.
  - Corrected: usage of SET/EQU for Assembler source output of aliased symbols.
  - Corrected: under some circumstances a wrong pointer size is used when a generic pointer to an array inside a struct is passed to functions with an variable argument list. Example:

        struct {
          char buffer[5];
        } names;
        char buffer[5];

        void foo(int output,...) {
          foo(output,names.buffer);
        }

- [L251 Linker/Locater]
  - Corrected: in extremely rare cases error L121: IMPROPER FIXUP and error L138: CODE GENERATION: PROBLEM WHEN PROCESSING INSTRUCTIONS, CAUSE: SYNC ERROR appeared near the end of a 64K block.
  - Corrected: in rare cases the linker crashs if using long function names and Global Register Coloring.
  - Corrected: somehow not only function names were listed in the call tree and warning L48: IGNORED RECURSION, CALL REMOVED appeared.
  - Corrected: sometimes automatic rebuilds are not executed when Global Register Coloring is used.
  - Corrected: in case of banked applications and under some circumstances the CONST- as well as the CODE-Segments located to the same bank address.
  - Corrected: under some circumstances the MERGEPUBLICS does not work for sbit variables.
- [A251 Macro Assembler]
  - Corrected: allow slash '/' in addition to backslash '\' as a directory separator in all places.
  - Corrected: two line feeds in Macro Processor Language (MPL) error message.
- [Debug Commands]
  - Added: New debugger command COVTOFILE filespec [\\app][\module][\function] [DETAILS] [ASM] which works like the COVERAGE command but sends the output into a file. This is much faster than into the output window.
- [µVision]
  - This C251 release comes with µVision V5.25.3.
- [Supported Operating Systems]
  - Refer to System Requirements Overview for hardware and operating system requirements.

### C251 Version 5.59

- [C251 Compiler]
  - Corrected: under some circumstances the compiler does not evaluates a return expression correctly. Example:

        extern char xdata buffer[256];
        #define END (&buffer[256])

        unsigned short foo (char * ptr)
        {
            return END - 9 - ptr;      --------------------------------------------------->+
        }                                                                                  |
                                                                                           |
                                                                                           V

        ;       FUNCTION foo? (BEGIN)
                                                         ; SOURCE LINE # 5   --------------+
        ;---- Variable 'ptr' assigned to Register 'WR6' ----                               |
                                                         ; SOURCE LINE # 7                 | Wrong code generation.
        000000 7D23           MOV      WR4,WR6                                             |/  This code does not consider the buffer
        000002 7E3400F7       MOV      WR6,#0F7H                  <------------------------o   as part of the calculation.
        000006 9D32           SUB      WR6,WR4
                                                         ; SOURCE LINE # 8
        000008 AA             ERET
        ;       FUNCTION foo? (END)

        ;       FUNCTION foo? (BEGIN)
                                                         ; SOURCE LINE # 5   --------------+
        000000 7D23           MOV      WR4,WR6                                             |
        ;---- Variable 'ptr' assigned to Register 'WR4' ----                               | Corrected code generation.
                                                         ; SOURCE LINE # 7                 |/
        000002 7E340000    E  MOV      WR6,#WORD0 buffer+247      <------------------------o
        000006 9D32           SUB      WR6,WR4
                                                         ; SOURCE LINE # 8
        000008 AA             ERET
        ;       FUNCTION foo? (END)

  - Implemented the C99 feature of variable arguments in macros in this C90 compiler. Example:

        #define DEBUGPRINT(a, ...) do { if (debug) printf(a, __VA_ARGS__); } while (0)

        int debug,v1,v2,v3;

        void test() {
          DEBUGPRINT("v1 = %d\n",v1);
          DEBUGPRINT("v1 = %d, v2 = %d\n",v1,v2);
          DEBUGPRINT("v1 = %d, v2 = %d, v3 = %d\n",v1,v2,v3);
        }

  - Corrected : the compiler erroneously generates this bit variable in the standard bitaddressable area instead of the extended one. Exmaple:

        bit ebdata eb1;        /* The bit variable eb1 should be generated in the extended memory space */

                 Variable is placed in the                                         Now the variable is placed in
                 wrong memory space                                                the correct memory space

        Module Information          Static   Overlayable                  Module Information          Static   Overlayable
        ------------------------------------------------                  ------------------------------------------------
        .....                                                             .....
          bit size             =         1     ------                       bit size             =    ------     ------
          ebit size            =    ------     ------                       ebit size            =         1     ------

  - Corrected: a #pragma userclass directive which is placed before an extern variable declaration can override the userclass of the variable definition. Example:

        PRJ_GLOBALS.H
        .......
        #pragma userclass(hconst=PRJDEFAULT)
        #pragma userclass(ecode=PRJDEFAULT)    -----------------------------------------o
        .......                                                                         |
        struct t1 {                                                                     |
           int a;                                                                       |
           int b;                                                                       |
        };                                                                              |
                                                                                        |
        extern struct t1 const ecode s1;       -----------------------------------------o------+
        .......                                                                                 \
                                                                                                 \
                                                                                                  \
        MAIN.C                                                                                     \
        .......                                                                                     \
        #include PRJ_GLOBALS.H                                                                       \
        .......                                                                                       \
        #pragma userclass(hconst=MAINDEFAULT)                                                          \
        #pragma userclass(ecode=MAINDEFAULT)   ------------------------+                                \
                                                                       |                                 \
        struct t1 const ecode s1 = {0};   /* The memory class of  s1 : ECODE_MAINDEFAULT has changed to : ECODE_PRJDEFAULT */
        struct t1 const ecode s2 = {0};
        .......

- [L251 Linker/Locater]
  - Added: warning L59 for reentrant and recursive function calls. When a reentrant function calls a non-reentrant one, the memory allocated by the Linker for local variables may overwrite memory used by another function. Example :

        func1 (non-reentrant) -> func2 (reentrant) -> func3 (non-reentrant)

                  In this example, the Linker does not know that the func1 and func3 may have a dependency,
                  and may choose to reserve the same memory space for local variables.
                  Is such a case the Linker throws the new warning L59                 ---------------------------o
                                                                                                                  |
        *** WARNING L13: RECURSIVE CALL TO FUNCTION                                                               |
        *** WARNING L48: IGNORED RECURSIVE CALL                                                                   |
        *** WARNING L59: REENTRANT CALLS NON REENTRANT FUNCTION, COULD LEAD TO WRONG OVERLAY CALCULATION     <----o

  - Added: LINKER CODE PACKING SYMBOLS OF MODULE and LINKER CODE PACKING CROSS-REFERENCE LISTING extensions to the map file. These extensions provides a better overview when linker code packing is used because the order and the layout of the generated sections changes each time the linker combines common sequences. Example:

        LINKER CODE PACKING SYMBOLS OF MODULE:  TEST (?C_STARTUP)

            VALUE       CLASS    TYPE      SYMBOL NAME
            ==========================================
            0080020CH   ECODE    PART      ?L?COM0001
            00800222H   ECODE    BEGIN     ?L?COM0002
            00800242H   ECODE    PART      ?L?COM0003
            00800363H   ECODE    END       ?L?COM0004

        LINKER CODE PACKING CROSS-REFERENCE LISTING

            NAME . . . . CLASS SIZE  TYPE   SEGMENT NAMES(ADDR)
            ===================================================

            ?L?COM0001 . ECODE 000DH PART   ?L?COM0001  ?PR?MAIN??MAIN(FF02B9H)  ?PR?MAIN??MAIN(FF0297H)  ?PR?MAIN??MAIN(FF027FH)
            ?L?COM0002 . ECODE 0004H BEGIN  ?PR?XSTRLEN???LIBSAMPLE  ?PR?MAIN??MAIN(FF0221H)  ?PR?MAIN??MAIN(FF01F7H)
            ?L?COM0003 . ECODE 0009H PART   ?L?COM0003  ?PR?MAIN??MAIN(FF021DH)  ?PR?MAIN??MAIN(FF01A7H)
            ?L?COM0004 . ECODE 0000H END    ?PR?XSTRCPY???LIBSAMPLE  ?PR?MAIN??MAIN(FF01E9H)

- [A251 Macro Assembler]
  - Removed: a path length limitation of 127 characters.
- [µVision]
  - This C251 release comes with µVision V5.21.1.
  - µVision now offers Japanese localization on Windows PCs with the 'primary language' Japanese.
    To select the language use the uVision menu item Edit - Configuration - Other - Startup - Language.
  - A Japanese Getting Started user's guide is available in the uVision Books Window.
  - Added: new option to limit the Find in Files utility to the "Current Document".
  - Enhanced: editor now supports Arabic, Baltic, Eastern European, Greek, Hebrew, Russian, Thai, Turkish, and Vietnamese character sets.
  - Corrected: Bookmark navigation is now working only on the "Current Document".
  - Corrected: opening struct elements in the Watch Window did not always show up-to-date values.
- [Supported Operating Systems]
  - µVision and it's dynamically loaded libraries (DLL) have been ported to MSVC 2015. MSVC 2015 does not officially support Windows XP any longer.
  - Refer to System Requirements Overview for hardware and operating system requirements.

### C251 Version 5.58

- [C251 Compiler]
  - Corrected: the variable attribute __attribute__((aligned)) was overruled by the linker directive NOSORTSIZE. Example:

        unsigned char ucValg __attribute__((aligned(4)));   /* The variable ucValg must be aligned on 4-byte boundary */

        void main (void)
        {
        :::::::::::
        }

    The MAP file for the above definition shows that the variable 'ucValg' was located at address 00000009H which is not a 4-byte boundary.

        00000009H   EDATA    BYTE      ucValg

  - Corrected: under some circumstances wrong code will be generated in case of the following expression and high optimization levels:

        unsigned char GetByte(unsigned char i);
        unsigned short value;

        value = (GetByte(0) * 256) + GetByte(1);        /* Wrong result */

    Generated assembler code:

        ---- Assembler code for : (GetByte(0) * 256) -----
        000016 E4             CLR      A                ; Parameter passing via R11=A to the callee function GetByte.
        000017 9A000000    R  ECALL    GetByte?         ;
                                                        ; The GetByte return value (unsigned char) is passed to the caller function via R11.

        ---- Load word registers WR14 and WR12 for the upcoming multiplication ----
        00001B 0A7B           MOVZ     WR14,R11         ; WR14 = | 00  | R11 |
        00001D 7E640100       MOV      WR12,#0100H      ; WR12 = | 01  | 00  |
        000021 AD67           MUL      WR12,WR14        ; The result is stored in the double word register DR12 = | WR12 | WR14 |, DR12 = | 00  |  00  | R11 | 00  |

        ---- Assembler code for : GetByte(1) -----
        000023 7401           MOV      A,#01H           ;
        000025 9A000000    R  ECALL    GetByte?         ;

        000029 0A7B           MOVZ     WR14,R11         ; Overwrites previous result in word register WR14
        00002B 2D76           ADD      WR14,WR12        ;

- [L251 Linker/Locater]
  - Corrected: under some circumstances the L251 ingnores the NOJMPTAB directive and and throws erroneously the following error:

        *** ERROR L210: I/O ERROR ON INPUT FILE:
            EXCEPTION 0021H: PATH OR FILE NOT FOUND
            FILE: C:\KEIL\C51\LIB\L51_BANK.OBJ

- [A251 Macro Assembler]
  - Corrected: under some circumstances the assembler shows wrong line numbers if an $include file cannot be found. The root cause for this behavior is the erroneous line number generation by the preprocessor. Example:

        NAME xxx
        S       SEGMENT  CODE
            RSEG  S
        #line                 ; The preprocessor generates wrong line numbers if an $include file cannot be found.
        PUT:    MOV   A,#x    ; The assembler shows these wrong line numbers inside the build output window as part of a warning or error message.
                RET
                END

- [µVision]
  - This C251 release comes with µVision V5.16.2.0.

### C251 Version 5.57 Release

- [C251 Compiler]
  - 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
        }

- [L251 Linker/Locater]
  - 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) -------

- [µVision]
  - This C251 release comes with µVision V5.11.2.0.

### C251 Version 5.55 Release

- [C251 Compiler]
  - Implemented local SBIT with external EBDATA/BDATA.
  - Implemented: unlimited length and count of command line DEFINEs.
- [A251 Assembler]
  - Allow class BIT and EBIT in expressions.
  - Corrected: an erroneously issued error A57 'REGISTER USAGE' REQUIRES A PUBLIC CODE SYMBOL which occurs when REGUSE directive is used by mixed-case (composed by upper and lower case characters) symbols.
  - Implemented ALIGN directive.
  - Generate workfile name dependent on process number.
- [L251 Linker/Locater]
  - Added: Error 144: OVERLAY GROUP SEGMENT CANNOT HAVE 'LAST' ADDRESS ASSIGNMENT message. The LAST attribute cannot be used to locate segments that collect overlayable segments.
- [µVision]
  - This C251 release comes with µVision V4.72.9.0.

### C251 Version 5.54 Release

- [C251 Compiler]
  - Added: optimization for handling of 32 bit numbers.
  - Added: optimization for for functions that do never return. This functions need to use __attribute__ ((noreturn)).
  - Corrected: assembler instructions used as label name erroneously thrown an Syntax-Error in SRC mode.
  - Corrected: a potential inline-assembler macro problem with '#' when meant for the #imm operand. Example:

        #pragma SRC

        #define AOP         \
           __asm { NOP }    \
           __asm { MOV A,#1 }    // incorrect generated error C302: misused # operator

        void main (void) {
          AOP
        }

  - Corrected: incorrect error C143 "initializer is not a constant" generation at cast of a constant pointer which is part of a struct. Example:

        struct GlStruct {
          char a;
          char cArr[1];
        };

        long offset = (long) (*(struct GlStruct*)0x0D000000).cArr;   // incorrect generated error: C143 "initializer is not a constant"

  - Corrected: incorrect error C83 "incompatible types" generation when used floating point types togehter with & operator. Example:

         volatile unsigned long  ul2;
         volatile signed char    sc1;
         volatile signed char    sc2;

         void main(void) {
           ul2 = 2147483647L;
           sc1 = -1;
           sc2 = 1;
           (ul2 ^= (((( ! ( (double) (char)127))) > ((( -- sc2)))) & sc1));  // incorrect generated error C83: '&': incompatible types
         }

  - Corrected: huge at function definition is not allowed. Erroneously has been taken as near. Example:

        void huge hg_fnc() {  }   // The warning C65: 'hg_fnc': illegal use of near/far/huge will be generated.

- [L251 Linker/Locater]
  - Corrected: a potential incorrect overlap of data segments when this features are used in combination:
    - Overlapping segments by command line directives.
    - Linker Code Packing optimization with ROM (HUGE) model.
    - Code segments placed in the same 64KB region as the DATA segments.
- [A251 Assembler]
  - Added: support for forward slash (/) as path seperator.
- [C Run-Time Library]
  - Corrected: the function free failed when the complete memory pool was allocated.
  - Corrected: the HPTR variant of the function float LOG does not work.
- [µVision]
  - This C251 release is delivered with µVision V4.60.6.9 IDE.

### C251 Version 5.50l Release

- [C251 Compiler]
  - Improved: handling of rotation expressions. There will be optimized as a _*rol_/_*ror_. Example:

        unsigned short s1,s2;
        s1 = s2 << 10 | s2 >> 6;

        // There will be optimized as:

        s1 = _iror_(s2,6);

  - Improved: optimization for shifts and rotations. Optimization of mod and div by 1. Example:

        int x = y%1;    // y%1 always results in 0. This have been optimized to an assignment of 0.

        int x = y/1;    // y/1 always results in y. This have been optimized to an assignment of y.

  - Improved: branch optimization. In case of a short branch distance a smaller opcode will be used.

- ##### [µVision]

  This C251 release is delivered with µVision V4.60.8.0 IDE.
  - Improved: build process for applications which using cross module optimization.

### C251 Version 5.50a Release

- ##### [µVision]

- This C251 release comes with µVision V4.53.0.6 IDE.

### C251 Version 5.50 Release

- [C251 Compiler]
  - Removed multiple register loads with constant zero by using SUB/XRL. Example:

        unsigned short us,us1;
        signed short ss;

        void foo(void){
          us  = 0;     // The selected register will be loaded only once with constant zero for all three statements.
          us1 = 0;
          ss  = 0;
        }

  - Added a new warning message which occurs when a case label value exceeds the value range of the switch expression. Example:

        void foo(void){
          signed char g;

          switch (g) {
           case 255:   // "Warning case label value exceeds maximum" will be generated.
             break;
           case -1:
             break;}

        }

  - Removed multiple warning C209 for same line. Example:

        unsigned char uc;

        uc = -257;     // The warning C209 appeared twice in previous versions.

  - Corrected issue in C251 which ignored REENTRANT pragma. Example:

        #pragma CODE SYMBOLS XSMALL MODECC7 INTR2 FUNCTIONS (REENTRANT) NOCASE ROM(HUGE)

        typedef int (foo)(void *p1, void *p2, void *p3, void *p4, int i);
        foo foo_function; /* prototype the function */

        /* Is non-reentrant due to typedef'd prototype: */
        int foo_function(void *p1, void *p2, void *p3, void *p4, int i)  {
          return i;
        }

        #define NULL  (void *) 0
        void main(void){
          volatile int ret=0;

          ret=foo_function(NULL, NULL, NULL, NULL, 2);
          if (ret != 2)
            while(1);
          while(1);
        }

- ##### [µVision]

  - This C251 release comes with µVision V4.53.0.4 which includes the new Scintilla based editor.
  - The new editor includes the following enhancements:
    Encoding for UTF-8 Unicode, DBCS Korean, DBCS Japanese, and DBCS Chinese languages. Unicode and Asian ANSI encoding is recognized automatically when a file is opened.
    Monospaced fonts and proportional fonts are supported.
    Syntax coloring has been extended.
    Unprintable characters, such as End-Of-Line, can be visualized in the editor.
    The Outlining menu has been simplified. Outlining information is saved and restored for each file.
    Search and replace utilities (Incremental Find, Find-in-Files, and Replace) have been reworked.
    Text can be zoomed with Ctrl+mouse wheel. The information is saved and restored for each file.
    In case device-specific books are not found in the local installation, then www.keil.com is scanned for a matching document.
  - and corrections: Scrolling quickly through large files with Page Up or Page Down works smoothly.
    The editor's context menu can be closed by pressing ESC.
    Breakpoints can be set now with a simple click into the editor margin.
    Under some circumstances the Debugger showed wrong values of arrays or structures in the Watch window.
  - Refer to Revision History for a complete list.

### C251 Version 5.08 Release

- [New Supported Devices]
  - PalmChip PALM8x251S
- [C Run-Time Library]
  - free: corrected a problem when all memory blocks were allocated, using the function free may generate a corrupted memory pool.
- [C251 Compiler]
  - Corrected: when assigning an char value to bit SFR registers the generated code may be incorrect. Example:

        sbit ET0  = 0xA9;

        ES  = u8ES;    // previous compiler versions may generate incorrect code

### C251 Version 5.07b Release

- [C Run-Time Library]
  - Corrected: the functions memcmp, hmemcmp, strcmp, strncmp, and hstrcmp now compare the memory content using unsigned char (instead of signed char) data types.
- [C251 Compiler]
  - Corrected: problem with constant folding in address calculation. Example:

        unsigned char array[0x2000];
        unsigned long l1, l2;

        void foo(void)  {
          l1 = ((((unsigned long)array) + (0x100)) + (0x80));       // incorrectly calculated in previous versions
          l2 = ((((unsigned long)&(array[0])) + (0x100)) + (0x80)); // work-arround
        }

- [µVision4]
  - This C251 release comes with µVision V4.22.00.

### C251 Version 5.04b Release

- [C Run-Time Library]
  - Corrected: the function toint did not detect the value range 0x59 - 0x40 as invalid. Now the function returns -1 for these values.
  - Corrected: double numbers are incorrectly converted to float numbers when round-up is required. Example:

        double d = 3.9999999999123;  // needs round-up to 4.0 when converting to float
        float f;
        f = d;                       // incorrect result due to incorrect round-up

- [µVision4]
  - This C251 release comes with µVision V4.14.16.

### C251 Version 5.00 Release

- [µVision4]
  - This C251 release comes with the new µVision4 IDE.
- [C251 Compiler]
  - Enhanced: register values are tracked and reload of identical values are removed to improve code density.
  - Add: NOCCODE directive to ensure proper optimization with linker code packing for setjmp/longjmp constructs.
  - Corrected: _irol_ and _iror_ intrinsic functions did not deliver correct results.

### C251 Version 4.61a Release

- [C251 Compiler - Header Files]
  Added: header file srom.h to obtain segment and class information in C source files.
- [C251 Compiler]
  - Enhanced: several enhancements for code efficiency for pointer accesses and long shift operations.
  - Corrected: double multiplication with 2 was folded into shift operation with potential loss of precision. Example:

        float func (double f)  {
          return (f * 2);      // shift-operation used instead of multiplication
        }

  - Added: NVM_CONST directive that disables access optimizations to const for in-system programming.

### C251 Version 4.55 Release

- [C251 Compiler]
  Corrected: long shift in complex combinations (in this case an decryption / encryption algorithm) may create register clashes and therefore incorrect results.

### C251 Version 4.54 Release

- [C251 Compiler]
  Added: new directive HPTR that uses 32-bit arithmetic even for far address calculation.
- [L251 Run-Time Library]
  - Added: library functions hmemccpy, hmemchr, hmemcmp, hmemcpy, hmemmove, hmemset, hstrcmp, hstrcpy, hstrlen, and hstrncpy.
  - Changed: run-time library is no longer build with the directive FIXDRK; when using Intel 80C251Sx C-step devices copy the libraries in the folder ..\C251\LIB\FIXDRK to ..\C251\LIB.

- [Monitor-251]
  Corrected: setup of interrupt functions (over RETI instructions) did not work.

### C251 Version 4.52 Release

- [L251 Linker/Locater]
  - Enhanced: Linker Size Summary Line.
  - Corrected: REMOVEDUNUSED did not correctly work with SROM symbols and linker code packing.
  - Corrected: debug symbols of absolute bits generated in AX51 had wrong offset.
  - Corrected: segment locating with the LAST keyword generated unnecessary memory gaps when used with code banking.
- [L251 Run-Time Library]
  - Corrected: strncmp library function changed from signed char to unsigned char compare (ANSI requirement).
- [Device Support]
  Corrected: instruction execution times in the device simulator for Dolphin Flip80251 Hurricane.
- [A251 Macro Assembler]
  Added: the operators '>>', '<<', '|', '&', '~' can now be used in expressions.

### Version 4.50 Release

- [C251 Compiler]
  Added: new Optimization Levels 8 and 9 that enabled together with the OBJECTADVANCED directive Linker Code Packing.
- [uVision3 IDE/Debugger]
  Added: Load Incremental that allows to load multiple applications to the debugger.
- [User's Manuals]
  Updated: the user's manuals are now updated and available as on-line documentation.
- [Monitor-251]
  Corrected: potential communication problems with low-cost USB-COM adapters.

### C251 Version 4.01 Release

- [C251 Compiler]
  - Corrected: a problem with long shift factor 24.
  - Corrected: a problem with integer promotion when the result is divided. Example: (x+y) / 2; The sum (x+y) was only calculated as unsigned char value, when both x and y are unsigned char.

  [L251 Linker/Locater]
  Corrected: there might be incorrect WARNING L15: MULTIPLE CALL TO FUNCTION messages when using syntax: OVERLAY (* ! (func1, func2,func3,...)) to group more than just two functions.

### C251 Version 4.00 Release

- [uVision3 IDE/Debugger]
  Changed toolset to uVision3 IDE/Debugger which provides many new features.
- [C251 Compiler]
  Several improvements on the code generator including:
  - Post increment and decrement is rearranged to optimize code.
  - Bit-field access and bit-field compares with constants are optimized.
  - CALL/RET combination is replaced by JMP.
  - Enhanced allocation for register variables.
  - Multiplication, division, and modulo operation with long/int optimized.
  - Long shift with constant shift factors 8/16/24.

### C251 Version 3.60 Release

- [uVision2 Debugger]
  Added Device support for the Dolphin Flip80251 Typhoon IP core.
- [uVision2 IDE]
  Added a new dialog for project component management under Project - Components, Environment and Books. This dialog allows you to change the order of project targets and file groups.
- [C251 Compiler]
  Corrected a code generation problem on the stack correction with reentrant function call as show in the example below:

      extern void pr (long l1, long l2, int i)  reentrant;
      long l;
      char c;

      void test (void)  {
        pr (0, 1, (l == 0));  // wrong stack correction SP-4 instead of SP-2 due to long compare.
        pr (0, 1, (c == 0));  // wrong stack correction SP-1 instead of SP-2 due to char compare.
      }

### C251 Version 3.53 Release

- [C251 Compiler]
  Corrected code generation problems with int multiplication and internal errors.

### C251 Version 3.52 Release

- [C251 Compiler]
  Corrected code generation problem with internal errors and int multiplication.

### C251 Version 3.51 Release

- [C251 Compiler]
  Added bank switching capability. Refer to the \C251\LIB\L251BANK.A51 configuration file. Bank switching works similarly to the code banking scheme used for 8051 targets. A new banking mode (mode 3) allows bank switching using a memory-mapped EDATA port. Sample programs may be found in the \C251\EXAMPLES\CODEBANKING folder.
- [C251 Compiler]
  Improved compiler optimization on common tail merging.
- [C251 Compiler]
  Corrected a round-up problem in the double-precision floating-point library.
- [C251 Compiler]
  Corrected a problem in V3.20 that sometimes caused for and while loops to ignore constant assignments in the loop initialization.

### C251 Version 3.20 Release

- [C251 Compiler]
  Added several minor enhancements.
- [uVision2 Debugger]
  Stabilized support for MON251.
- [uVision2 IDE]
  Added several new options to the Help Menu.
- [uVision2 IDE]
  Improved the SVCS connection.
- [uVision2 IDE]
  Corrected problems with environment variables.

### C251 Version 3.12 Release

- [C251 Compiler]
  Corrected several minor problems.

### C251 Version 3.00 Release

- [uVision2 IDE]
  Added simulation support for all MCS® 251 devices. This includes the Intel 80C251Sx and 80C251Tx and the Atmel WM C251G1D, C251G2D, and C251A1.

## Example Programs

Example programs included in the \C251\EXAMPLES folder demonstrate how to use the uVision4 Project Manager and Debugger (see the uVision Quick Start Guide for details). Please refer to these if you are new to the tools and want to get started quickly.

## Device Database™

A unique feature of the Keil uVision4 IDE is the Device Database™ which contains information about more than 3500 supported microcontrollers. When you create a new uVision project and select the target chip from the database, uVision sets all assembler, compiler, linker, and debugger options for you. The only option you must configure is the memory map.

As new devices become available, they are added to the database along with data sheets and header files. For information about adding your own chips to the database or about creating your own personal databases refer to the following knowledgebase articles.

- Adding Custom Parts to the Device Database
- Creating Custom Databases

## Peripheral Simulation

The uVision4 Debugger provides complete simulation for the CPU and on-chip peripherals of most embedded devices. To discover which peripherals of a device are supported, in uVision4 select the Simulated Peripherals item from the Help menu. You may also use the web-based Device Database™. We are constantly adding new devices and simulation support for on-chip peripherals so be sure to check Device Database™ often.

## Technical Support

At Keil Software, we are dedicated to providing you with the best development tools and technical support. That's why we offer numerous ways you can get the technical support you need to complete your embedded projects.

- Technical Support Knowledgebase
  More than 2500 technical support questions and answers are available in the Support Solutions Knowledgebase. When a new question arises, it is added to the knowledgebase which is continuously published to the Web. This enables you to get technical support at times when our support staff is unavailable.
- Application Notes
  Numerous Application Notes help you decipher complex features and implement robust applications.
- Example Programs and Files
  Utility programs, example code, and sample projects are regularly added to the Download File section of the web site.
- Discussion Forum
  Post questions, comments, and suggestions to the Keil Software Discussion Forum and interact with other Keil users around the world.
- Contact Technical Support
  Describes how to contact the Technical Support.

Many of the features of our Technical Support Knowledgebase and Web Site are the results of your suggestions. If you have any ideas that will improve them, please give us your feedback!

## Contact Details

If you experience any problems or have any questions about this product, contact one of our distributors or offices for assistance.

In the USA... ARM, Inc. 1501 10th Street, Suite 110 Plano, TX 75074 USA 800-348-8051 - Sales 972-312-1107 - Support 972-312-1159 - Fax sales.us@keil.com - Sales E-Mail |  | In Europe... ARM Germany GmbH Bretonischer Ring 16 D-85630 Grasbrunn Germany +49 89 456040-0 - Sales +49 89 456040-24 - Support +49 89 468162 - Fax sales.intl@keil.com - Sales E-Mail

Copyright © 2018 ARM Ltd and ARM Germany GmbH.
All rights reserved.
Visit our web site at http://www.keil.com/.