Keil Logo

Release Notes for C166
C16x/ST10/XC16x Development Tool Kits

Download this Update

This file contains release notes and last minute changes that are not found in the printed manuals.

Information in this file, the accompanying manuals, and software is
Copyright © Keil™, An ARM® Company.
All rights reserved.


  1. What's New in C166
  2. Release Summary
  3. Example Programs
  4. Device Database
  5. Peripheral Simulation
  6. Technical Support
  7. Contact Details

What's New in C166

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

C166 Version 6.18 Release

Release Date: 26 Mar 2009

  • [C166 Compiler]
    Corrected a problem where a true expression with bits evaluated incorrectly
    #define _TRUE ((bit)1)
    void test(void) {
      if( _TRUE != 0 ) {  // incorrectly evaluated to FALSE
  • [C166 Compiler]
    Corrected: Using explicit jump prediction (i.e. JMPA+ instruction used) the jump target was wrong.
  • [Device Support]
    Added header files and startup code for the Infineon XE162 devices. Several new Infineon XE167 and XC2000 variants added.

C166 Version 6.17 Release

Release Date: 4 Dec 2008

  • [C166 Compiler]
    Corrected problem with common-sub expression elimination on bit-field variables when OPTIMIZE(8) is used.
  • [C166 Compiler]
    Enhancement in pre-processor limits.
    • Maximum macro nesting increased from 100 to 150
    • Maximum number of macro-arguments increased from 50 to 100
    • Maximum #if - #endif nesting increased from 20 to 128
  • [Device Support]
    Added header files, start-up code, enhanced debug and Flash download support for new Infineon devices
  • [ULINK Driver + Infineon DAS Driver]
    Corrected problem with non responding Infineon XC2000 and XE166 series devices with new ULINK reset sequence.

C166 Version 6.14 Release

Release Date: 26 Aug 2008

  • [C166 Compiler]
    Corrected instruction reordering with the REORDER directive was incorrect when used in combination with ATOMIC/ENDATOMIC sequences.

C166 Version 6.11 Release

Release Date: 31 Jan 2008

  • [C166 Run-Time Library]
    Corrected a free_box failure when the pool size is just for one block.
  • [C166 Compiler]
    Corrected an issue where user stack (R0) might be overwritten when bit negate is used in a parameter list of a function call.
  • [ULINK Driver + Infineon DAS Driver]
    Enhanced on-the-fly memory access allowing variable value display during program execution.

C166 Version 6.10 Release

Release Date: 15 Jan 2008

  • [Device Support]
    Corrected a problem where BMOVN incorrectly set PSW status flags N and Z.
  • [Device Support]
    Corrected register Header files for Infineon XC22xx devices.
  • [Device Support]
    Added support for XC23xx, XC27xx, and XE16x devices including debug and flash support.
  • [C166 Compiler]
    Corrected: _lror_ (value, 1) incorrectly shifts bit 0 to bit 63.
  • [Device Support]
    Corrected: strtod did potentially fail with memory model COMPACT, HCOMPACT, LARGE, HLARGE, and XLARGE.
  • [Device Support]
    Corrected: a problem with EXT sequence merging and REORDER directive on XC16x/XC2xxx/XE16x devices.
  • [Device Support]
    Corrected: when a extended sfr bit was assigned to a standard sfr bit using a negation, the ext sequence was incorrectly generated.

C166 Version 6.09 Release

Release Date: 19 Nov 2007

  • [OCDS Debugging Support]
    Added ULINK firmware for C165U and C165UTAH.
  • [µVision3 IDE/Debugger/Simulator]
    Corrected register header files for Infineon XC22xx devices.
  • [µVision3 IDE/Debugger/Simulator]
    Added support for Infineon XC23xx devices.
  • [XC16x ULINK Driver]
    Corrected several problems with the ULINK Driver including:
    • 'Stop on Reset' was broken in V6.08.
    • The Flash download option of 'Reset and Run' was broken in V6.08.
    • Flash programming angorithm problems with Infineon XC22xx devices.
    • ULINK2 did not correctly connect to Infineon XC164 devices due to a startup effect on the TRST line.
  • [C166 Compiler]
    Corrected a problem with the log library routine for double-precision floating-point numbers. In some cases this function might return incorrect values. This problem was introduced in C166 V6.08.
  • [C166 Compiler]
    Corrected a problem with OPTIMIZE(8) that may cause incorrect register variable assignments. This problem can be identified by empty strings in *.LST files.
  • [C166 Compiler]
    Corrected a problem with returning a type struct from a function. When the structure is returned via multiple call levels, the compiler may create an incorrect stack balance.
  • [C166 Compiler]
    Enhanced the NOFRAME directive so that it now supports MAC register saves in interrupts.
  • [Monitor-166]
    Corrected potential communication problems with low-cost USB-COM adapters.

C166 Version 6.08 Release

Release Date: 27 Mar 2007

  • [µVision3 IDE/Debugger/Simulator]
    Corrected a problem that could cause the IDE to crash when the mouse was right-clicked in the project window when no item was selected.
  • [µVision3 IDE/Debugger/Simulator]
    Added ULINK2 and new Flash algorithm support for XC2000 devices.
  • [µVision3 IDE/Debugger/Simulator]
    Added the \KEIL\C166\BOARDS\INFINEON XC2278\ folder which contains example projects for the Infineon EASY KIT XC2xxx.
  • [C166 Compiler]
    Corrected a problem where division was performed using the DIVLU instruction instead of the intended library routin. This caused incorrect values in the case of value overflows. For example:
    unsigned int ui1, ui2, ui3, ui4;
    ui4 = (unsigned int) (((ui1+15)
          * ((499000ul - usTemp1) / (unsigned long)ui2)
          - 499000ul) - ui3;
  • [C166 Compiler]
    Corrected a problem with the strtod library routine where strtod returned incorrect values for the pointer to subsequent characters.
  • [C166 Compiler]
    Corrected a problem with the log routine when used with FLOAT64 (double-precision arithmetic). In some cases with negative values this routine created an unbalanced user stack.
  • [Infineon DAS Driver]
    Added support for DAS Server Version 2.5.
  • [Infineon DAS Driver]
    Corrected a problem that occasionally reported DAS error messages when starting the µVision debugger.
  • [Infineon DAS Driver]
    Corrected a problem that caused the Run LED to fail with JTAG over USB Chip.

C166 Version 6.06 Release

Release Date: 15 Jan 2007

  • [C166 Compiler]
    Corrected the fstrpos, fstrrchr, and fstrrpos library routines so that they include the '\0' character in the search.
  • [C166 Compiler]
    Enhanced the code generator so that struct copies (on XC16x devices) use CoMOV/JMPA- instructions when the MAC directive is specified.
  • [C166 Compiler]
    Enhanced the code generator so that a single DIVLU instruction is generated (instead of a library function) for (unsigned int)(ulong / uint) operations.
  • [C166 Compiler]
    Corrected a problem with register overwrites on BYTEALIGN variable access.
  • [C166 Compiler]
    Corrected a problem with OPTIMIZE(8) and inline assembly code.
  • [A166 Assembler]
    Corrected a code generation problem for the Infineon XC16x when the MODV2 is used. The assembler did not output the REGUSE information which is required for global register optimization.
  • [µVision3 IDE/Debugger/Simulator]
    Added simulation support for fast external interrupts on Infineon XC164CM.
  • [µVision3 IDE/Debugger/Simulator]
    Corrected a problem with I²C transmit simulation when the transmit buffer size is larger than 1.
  • [µVision3 IDE/Debugger/Simulator]
    Added support for ULINK2.
  • [L166 Linker/Locator]
    Corrected an ELF file generation problem for applications that have code with different storage and execution address (RAM functions).

C166 Version 6.04 Release

Release Date: 31 Jan 2006

  • [µVision3 IDE/Debugger/Simulator]
    Added peripheral simulation support and target debugging dialogs for the following devices:
  • [C166 Compiler]
    Corrected several problems with the new Optimization Level 8.
  • [C166 Compiler]
    Corrected a register assignment problem with BYTEALIGN variable access.
  • [C166 Compiler]
    Modified several warning messages that were too aggressive.
  • [C166 Compiler]
    Corrected a problem in XLARGE model with printf string output. Problems occurred when the precision was stated and the string crossed a 64KB boundary.
  • [XC16x ULINK Driver]
    Corrected occasional 'Flash erase error' problems with XC16x devices.
  • [Infineon DAS Driver]
    Corrected occasional 'Flash erase error' problems with XC16x devices.
  • [Infineon DAS Driver]
    Corrected a problem that caused the RUN LED on the USB Wiggler to never turn on.
  • [µVision3 IDE/Debugger/Simulator]
    Corrected a problem with the AGSI Debug Interface that caused memory range watch calls to fail on large memory ranges.
  • [µVision3 IDE/Debugger/Simulator]
    Enhanced the EasyWEB example for Keil MCBXC167 boards. The example did not work with on-chip flash due to invalid external bus configuration. Added a Target for Monitor-166 debugging.

C166 Version 6.03 Release

  • [C166 Compiler]
    Corrected several warnings that were too aggressive and that were not restricted to situations where they apply.
  • [C166 Compiler]
    Corrected a problem when using OPTIMIZE(8) with rotated loops and shift operations.
  • [C166 Compiler]
    Corrected a problem with signed long division that generated a wrong sign when the divisor was a 16-bit number.
  • [C166 Compiler]
    Modified Warning C192 to be less aggressive in some situations to reduce the impact on legacy code.
  • [µVision3 IDE/Debugger/Simulator]
    Added a new driver for the Infineon DAS (Debug Access Server). This is described in the OCDS Debugging User's Guide.

C166 Version 6.02 Release

  • [C166 Compiler]
    Enhanced the following warnings to include more problematic situations:
    • Warning C98: Pointer to Different Objects
    • Warning C192: Value Truncated
    • Warning C141: Incorrect Initialization
  • [C166 Compiler]
    Corrected a potential register overlap problem with struct copy when pointers are used as the source or target address.
  • [C166 Compiler]
    Corrected a problem that sometimes caused registers to get overwritten when using OPTIMIZE(8) in combination with STATIC memory for register automatics.
  • [µVision3 IDE/Debugger/Simulator]
    Added a new symbol window with drag and drop capabilities.

C166 Version 6.00a Release

  • [OCDS Debugging Support]
    Added detection of the C164CM device ID in the UL2OCDS driver.
  • [OCDS Debugging Support]
    Added a flash programming algorithm for C16x-8F devices.

C166 Version 6.00 Release

  • [µVision3 IDE/Debugger/Simulator]
    Added simulation for PEC Channel link with XC16x devices.
  • [C166 Compiler]
    Improved the efficiency of Common Sub-Expression Elimination.
  • [C166 Compiler]
    Improved access for long variable types and 32-bit pointers.
  • [C166 Compiler]
    Improved Register Variable Lifetime Analysis so that more optimal registers are used for automatic variables. This optimization improves execution speed and code density. On some functions, this optimization improves the code density and execution speed up to 20%.
  • [C166 Compiler]
    Added SAVEMAC and NOSAVEMAC directives to enable/disable saving and restoring MAC registers in interrupt service routines.
  • [C166 Compiler]
    Corrected a problem with the free function. When all memory blocks were allocated the free function, in some instances, generated invalid reference lists.
  • [C166 Compiler]
    Corrected a problem with the printf, sprintf, scanf, and sscanf functions when the format string crossed a 64KB memory boundary in HLARGE model.
  • [C166 Compiler]
    Corrected a problem in MAC multiplication on XC16x devices that caused invalid results when CoSHL was used.
  • [L166 Linker/Locator]
    Added ELF output support. A new linker directive ELF (elf_output_file) allows you to generate an ELF/DWARF compatible output file. This file may be used by third-party tools to analyze memory contents or symbol information. The ELF/DWARF file may be loaded by the µVision Debugger.
  • [XC16x ULINK Driver]
    Added a configuration register (OPSEN) to START_V2.A66 file to allow stopping specific peripherals during debugging. Refer to C166: DO PERIPHERALS STOP WITH ULINK DEBUGGING for more information.
  • [XC16x ULINK Driver]
    Changed the default setting of the Branch Prediction Unit (CPUCON1.1) in START_V2.A66. The branch prediction unit may incorrectly jump to address 0x0020 when the Step Into command reached a breakpoint and the previous instruction was a JMP.
  • [XC16x ULINK Driver]
    Corrected a problem with Flash Programming that did not program on the boundary between on-chip and off-chip Flash ROM.
  • [XC16x ULINK Driver]
    Corrected a problem with char or unsigned char automatic variables that might have shown incorrect values in the highest nibble.
  • [Monitor-166]
    Added a new monitor configuration for the Keil MCBXC167 Board.

C166 Version 5.05 Release

  • [XC16x ULINK Driver]
    Added a new, dedicated ULINK driver that has several enhancements over the previous driver:
    • Potential hang-ups are avoided when the user application contains active interrupt functions.
    • Breakpoints are no longer ignored when all four flash breakpoints are used.
    • Generates only one RESET at debugger startup. The CPU is stopped at the reset vector and no user code is executed.
    • Breakpoints may be set while user code is running.
    • Breakpoints may be set at the beginning of Class B traps and in the highest interrupt level.
    In µVision, you may select this driver under Project - Options - Debug - ULINK Driver for XC16x. Detailed information is available in the OCDS Debugger User's Guide.
  • [XC164CM Starter Kit Examples]
    Added a sample project for the new Infineon XC164CM Starter Kit in the \KEIL\C166\BOARDS\INFINEON XC164CM\BLINKY\ folder.
  • [C166 Compiler]
    Corrected a problem in macro expansions that may have truncated identifiers to 53 characters.
  • [C166 Compiler]
    Corrected a problem in macros that contain the stringize or number-sign operator ('#') in __asm blocks. On occasion, macros meeting these conditions may cause a Misused '#' Error.

C166 Version 5.04a Release

  • [µVision3 IDE/Debugger/Simulator]
    µVision3 was accidentally excluded from the 5.04 release. It has been re-included in Version 5.04a.
  • [START_V2.A66 Startup Code]
    Added a new configuration setting under CPU Configuration - Definitions for Internal Memory Block Control Register IBMCTR - WSFLASH: Wait States for the Flash Memory. This option allows you to bypass the FCPUR X.162832 Flash Read Performance problem described in C166: ACCESS PROBLEM WITH XC16X ON-CHIP FLASH.

C166 Version 5.04 Release

  • [µVision3 IDE/Debugger/Simulator]
    Added module display to the Project - Functions Window.
  • [µVision3 IDE/Debugger/Simulator]
    Added complete simulation for the XC16x CAPCOM6 Unit and ASC1 Interface.
  • [µVision3 IDE/Debugger/Simulator]
    Added simulation support for the Infineon XC164CM.
  • [L166 Linker/Locator]
    Added program size summary.
  • [START_V2.A66 Startup Code]
    Synchronized with current Infineon Data Sheets and the current Infineon DAvE Version.
  • [C166 Compiler]
    Enhanced bit-field comparisons to use bit instructions.
  • [C166 Compiler]
    Corrected a problem with xhuge variable initialization when initialized data exceeded 64KB.
  • [C166 Compiler]
    Corrected a problem address xhuge const objects.
  • [C166 Compiler]
    Corrected a problem with local automatic bits and function inlining.

C166 Version 5.03 Release

  • [L166 - Data Mismatch Warning]
    Warning 20 and Warning 21 have been enhanced to output the module in which the symbol is defined. This should simplify locating data type mismatches in an application.
  • [µVision3 - Help System]
    The on-line help system in µVision has been improved as follows:
    • Configuration dialogs have Help buttons that link to the user's guide.
    • The F1 context help is improved.
  • [µVision3 - Logic Analyzer]
    Added data export capability to the Logic Analyzer.
  • [Infineon DAvE Support]
    Corrected several problems in the DAvE project import that were caused by new configuration options in the DAvE project file.
  • [C166 - Problems Solved]
    Problems with function in-lining that result in compile-time errors are solved.
  • [C166 Library - membox initialization]
    Corrected a problem in the thread-safe fixed-block memory allocation function _init_boxm with the pool initialization for far and huge memory pools.

C166 Version 5.01 Release

  • [C166 - Problems Solved]
    The ORDER directive in V5.00 generated incorrect code when EXT sequences were involved. In some circumstances, incorrect code may have been generated for inline functions. These problems are corrected.
  • [L166 - Source Browser Output File]
    Beginning in C166 Version 5.00, the L166 Linker generated an output file (extension *.SBR) which is not deleted if linker errors are encountered. µVision3 was not able to read this file. This problem is corrected.
  • [µVision3 - Corrections and Enhancements]
    Several minor corrections were made to µVision3. Setup problems for Kernel-Aware Debugging with RTX166 and Advanced RTX166 have been corrected. Two new toolbar buttons were added: Back moves the cursor back to the location before a find or go to line command, Forward moves the cursor towards the current position.
  • [C166 Library - membox Initialization]
    The thread-safe fixed-block memory allocation function _init_boxm failed when the end of a memory buffer was at a 64KB boundary. This problem is corrected.
  • [EC++ Compiler]
    Corrected a problem with type mismatch warnings at the L166 Linker level when linking C and EC++ files with indentical data types.
  • [Traffic Example Project]
    Corrected a potential hang-up problem in the interrupt driven serial interface routine.

C166 Version 5.00 Release

  • [µVision3 - Integrated New IDE]
    µVision3 is now a part of all C166 kits. Projects created with µVision3 and µVision are fully interchangable. You may use whichever IDE you like. µVision3 adds many new features such as Source Outlining, Function Navigation, Template Editor, Incremental Search, Configuration Wizard, and Logic Analyzer.

    µVision3 adds support for CVS Software Version Control System which is an Open Source version control system.

    Refer to the µVision3 Quick Start Brochure for more information.
  • [µVision3 - Added XC16x Device Simulation and Target Dialogs]
    Device simulation and target peripheral dialogs (with the exception of CAPCOM6) have been added for the XC161, XC164, and XC167 devices. CAPCOM6 is planned for release in March 2004.
  • [EC++ Compiler]
    The EC++ Compiler is now available in the release version.
  • [C166 - Added XLARGE Memory Model]
    Added the XLARGE memory model which stores variables in xhuge memory and functions in far memory. This new memory model allows virtually unlimited memory access. Note that size_t for most library functions is unsigned int which limits the size of a single object to 64KB. However the object itself may reside anywhere in the xhuge memory space.
  • [C166 Library - Added Block-Based Memory Allocation Routines]
    New library functions (malloc_b, free_b, calloc_b, realloc_b, init_mempool_b) support block-based memory management of xhuge buffers. These functions return memory blocks that may be accessed with huge or far pointers. They provide efficient addressing for xhuge memory buffers without the memory limitations imposed by huge and far memory objects.
  • [C166 Library - Added Thread-safe, Fixed-Block Memory Allocation Routines]
    Added library routines to support memory pools with fixed-size memory blocks. In contrast to the standard memory allocation routines, these routines are reentrant and thread-safe. They may be used without restriction in real-time operating systems like the new Advanced RTX166. You may call them from interrupt routines and from the main function. The following routines are available:
    • Near Memory Box: _init_boxn, _alloc_boxn, _calloc_boxn, and _free_boxn.
    • Far Memory Box: _init_boxf, _alloc_boxf, _calloc_boxf, and _free_boxf.
    • Huge Memory Box: _init_boxh, _alloc_boxh, _calloc_boxh, and _free_boxh.
    Execution times for these routines are deterministic and are independent of memory pool sizes.
  • [MAC Programming: Example Code for Signal Processing]
    Application Note 178 shows how to implement and debug DSP algorithms designed using the MAC instructions of the Infineon XC16x devices. The example code uses in-line assembler and function inlining to obtain maximum performance. Program debugging is performed with the µVision Debugger/Simulator and the new Logic Analyzer function.

    The DSP Library from Infineon (using in-line assembly for MAC programming) is now available.
  • [MCBXC167 Examples]
    Examples for the MCBXC167 Board are available in the \KEIL\C166\BOARDS\KEIL MCB-XC167 folder. They may be used to demonstrate OCDS debugging with ULINK, PLL configuration, and TwinCAN communication. An Easy Web Server that uses the 10/100bps Ethernet controller on this board is also available.

    These examples may be used with user hardware that is based on XC16x devices.
  • [C166 Compiler - Improved Function In-Lining]
    Function in-lining has been improved in cases where the __inline function calls other __inline functions. The rules for function in-lining are as follows:
    1. Function in-lining is performed on an expression statement boundary where the right side operator is a function call. For example:
      z = iFunc (z1, z2)          // in-lined:     first operation is function call
      z = iFunc (z1, z2) * 11     // not in-lined: first operation is multiplication
      z = iFunc (z1, z2) + 2;     // not in-lined: first operation is addition
    2. Expressions with for statements are never in-lined. For example:
      for (z = iFunc (z1, z2) ; z != 0 ; )  {  // call to iFunc never in-lined
    3. An __inline function with no calls (leaf function) or calls to other leaf functions is in-lined as long as the above rules are fulfilled.
      static __inline int yFunc (int n)  {
        return (n + 10);
      static int zFunc (int n)  {
        return (n + 10);
      static __inline int iFunc (int i, int y)  {
        i += y;
        i += yFunc (y);      // Note: i += yFunc * zFunc (i): not in-lined
        i *= zFunc (i);
        return (i);
      static int z, z1, z2;
      void main (void)  {
        z = iFunc (z1, z2);           // in-lined
        z = z2 + iFunc (z1, z2);      // not in-lined
        z = iFunc (z1, z2) * 11;      // not in-lined

C166 Version 4.27 Release

  • [OCDS Debugging Support]
    Corrected problems with single-step in combination with breakpoints and connection problems to debug hardware on LPT ports.
  • [µVision2 Debugger/Simulator]
    Added context menu commands in the Source Window and Disassembly Window for Set Program Counter, Show Disassembly, and Show Source Code.
  • [Monitor-166]
    Added support for the Forth EVA269 board.
  • [C166 Compiler]
    Corrected specific problems with in-line assembly and function in-lining.
  • [C166 Compiler]
    Corrected problems with DaVE support for the new XC161/XC164 devices.

C166 Version 4.26a Release

  • [C166 Compiler - Source Mode (RTX166 Config File)]
    Corrected a problem in C166 Version 4.26 that failed to translate the RTX166 configuration file into Source Mode.
  • [Monitor-166]
    Corrected a problem in C166 Version 4.26 that caused Monitor-166 to fail.
  • [C166 Compiler]
    Updated several header files. Added RSTCON for the C167CS. Added the XC167 header file.

C166 Version 4.26 Release

  • [C166 Compiler]
    The extended inline assembler now supports C preprocessor macros. Details are documented in Application Note 172: Using the Extended C166 Inline Assembler.
  • [C166 Compiler]
    Added named constant optimization. The values of const variables are no longer loaded. Instead the constant value is used in a way which provides the opportunity for additional optimization. For example:
    const int d = 0x200;   // named constant
    unsigned int i;
    void main() {
      i /= d;           // now uses shift instead of div (power of 2 optimization)
  • [OCDS Support]
    Enhanced OCDS support. Breakpoints and single stepping now work correctly on EXTS sequences. A new configuration setting OCDS Break Level allows you to execute interrupt functions while your system is stopped. Flash programming support is now configured for the XC16x AC steps and allows programming off-chip Flash devices.
  • [XC16x Device Support]
    Fast Register Banks may now be correctly defined in the tools. These are fully simulated in the µVision debugger.
  • [µVision2 Debugger]
    Corrected a problem with local variables not displaying in the watch window - locals tab.

C166 Version 4.25 Release

  • [XC16x Device Support]
    Corrected a problem with OCDS debugging that caused breakpoints in interrupt functions with level > 3 not to work.
  • [C166 Compiler - Compiler Warnings]
    Corrected a problem with C166 Version 4.24 that caused warning 192 messages when there was no value truncation.
  • [C166 Compiler - Function In-Lining]
    Added function in-lining that is fully optimized into the program context. When used with the extended in-line assembler the Keil C16x/ST10 C Compiler allows you to create in-line functions that generate the same efficient code as intrinsic functions.
        1         typedef unsigned char  BYTE;
        2         typedef unsigned int   WORD;
        4         typedef struct cla  {
        5           unsigned char  type;
        6           unsigned char  mode;
        7           struct cla    *p[2];
        8         } CLA;
       10         CLA  cl1;
       11         BYTE  type, mode;
       12         CLA    *pL,  *pR;
       13         int     it;
       15         __inline int Getit (CLA *pthis)  {
       16  1        int   n1;
       17  1        if (pthis->mode == 2)  {
       18  2          n1 = pthis->p[0]->mode | pthis->p[1]->mode;
       19  2        }
       20  1        else  {
       21  2          n1 = pthis->p[0]->type & pthis->p[1]->type;
       22  2        }
       23  1        return (n1);
       24  1      }
       26         __inline BYTE GetMode (CLA *pthis)  {
       27  1        return (pthis->mode & 0x0F);
       28  1      }
       29         __inline BYTE GetType (CLA *pthis)  {
       30  1        return (pthis->type & 0x08);
       31  1      }
       32         __inline CLA *GetNodeL (CLA *pthis)  {
       33  1        return (pthis->p[0]);
       34  1      }
       35         __inline CLA *GetNodeR (CLA *pthis)  {
       36  1        return (pthis->p[1]);
       37  1      }
       39         int near iLocal;
       41         __inline WORD Mul2 (WORD w)  {
       42  1        if (w >= 0x10)  {
       43  2          __asm  {
       44  2            MOV    R4,w
       45  2      al1:  MOV    R5,iLocal
       46  2            ADD    R4,R5
       47  2            mov    w,R4
       48  2          }
       49  2        } else w <<= 10;
       50  1        return (w);
       51  1      }
       54         void main (void)  {
       55  1        CLA   *p1;
       56  1
       57  1        it = Mul2 (cl1.mode);
       58  1        p1 = &cl1;
       59  1        type = GetMode (p1);
       60  1        mode = GetType (p1);
       61  1        pL   = GetNodeL (p1);
       62  1        pR   = GetNodeR (p1);
       63  1        it   = Getit (&cl1);
       64  1      }
                 ; FUNCTION main (BEGIN  RMASK = @0x41F2)
                                               ; SOURCE LINE # 54
    ;---- Variable 'n1?6?Getit' assigned to Register 'R7' ----
                                               ; SOURCE LINE # 57
    0000 C2F60900 R    MOVBZ     R6,cl1+01H
    ;---- Variable 'w?1?Mul2' assigned to Register 'R6' ----
                                               ; SOURCE LINE # 42
    0004 46F61000      CMP       R6,#010H
    0008 8D06          JMPR      cc_ULT,?C0001
                                               ; SOURCE LINE # 44
    000A F046          MOV    R4,w
                                               ; SOURCE LINE # 45
    000C         al1?1?Mul2:
    000C F2F50000 R    al1:  MOV    R5,iLocal
                                               ; SOURCE LINE # 46
    0010 0045          ADD    R4,R5
                                               ; SOURCE LINE # 47
    0012 F064          mov    w,R4
                                               ; SOURCE LINE # 49
    0014 0D01          JMPR      cc_UC,?C0003
    0016         ?C0001:
    0016 5CA6          SHL       R6,#0AH
    0018         ?C0003:
                                               ; SOURCE LINE # 50
    0018 F086          MOV       R8,R6
                                               ; SOURCE LINE # 57
    001A F6F60000 R    MOV       it,R6
                                               ; SOURCE LINE # 58
    001E E6F40800 R    MOV       R4,#cl1
    0022 F054          MOV       R5,R4
    ;---- Variable 'p1' assigned to Register 'R5' ----
                                               ; SOURCE LINE # 59
    ;---- Variable 'pthis?2?GetMode' assigned to Register 'R4' ----
                                               ; SOURCE LINE # 27
    0024 F4840100      MOVB      RL4,[R4+#01H]
    0028 67F80F00      ANDB      RL4,#0FH
    ;---- Variable 'Rvb?2?GetMode' assigned to Register 'RL4' ----
                                               ; SOURCE LINE # 59
    002C F7F80E00 R    MOVB      type,RL4
                                               ; SOURCE LINE # 60
    0030 F065          MOV       R6,R5
    ;---- Variable 'pthis?3?GetType' assigned to Register 'R6' ----
                                               ; SOURCE LINE # 30
    0032 A985          MOVB      RL4,[R5]
    0034 67F80800      ANDB      RL4,#08H
    ;---- Variable 'Rvb?3?GetType' assigned to Register 'RL4' ----
                                               ; SOURCE LINE # 60
    0038 F7F80F00 R    MOVB      mode,RL4
                                               ; SOURCE LINE # 61
    003C F045          MOV       R4,R5
    ;---- Variable 'pthis?4?GetNodeL' assigned to Register 'R4' ----
                                               ; SOURCE LINE # 33
    003E D4650200      MOV       R6,[R5+#02H]
                                               ; SOURCE LINE # 61
    0042 F6F60600 R    MOV       pL,R6
                                               ; SOURCE LINE # 62
    ;---- Variable 'pthis?5?GetNodeR' assigned to Register 'R5' ----
                                               ; SOURCE LINE # 36
    0046 D4650400      MOV       R6,[R5+#04H]
                                               ; SOURCE LINE # 62
    004A F6F60400 R    MOV       pR,R6
                                               ; SOURCE LINE # 63
    004E F065          MOV       R6,R5
    ;---- Variable 'pthis?6?Getit' assigned to Register 'R6' ----
                                               ; SOURCE LINE # 17
    0050 F4840100      MOVB      RL4,[R4+#01H]
    0054 4982          CMPB      RL4,#02H
    0056 3D0B          JMPR      cc_NZ,?C0004
                                               ; SOURCE LINE # 18
    0058 D4160400      MOV       R1,[R6+#04H]
    005C F4A10100      MOVB      RL5,[R1+#01H]
    0060 D4160200      MOV       R1,[R6+#02H]
    0064 F4810100      MOVB      RL4,[R1+#01H]
    0068 718A          ORB       RL4,RL5
    006A C087          MOVBZ     R7,RL4
                                               ; SOURCE LINE # 19
    006C 0D08          JMPR      cc_UC,?C0005
    006E         ?C0004:
                                               ; SOURCE LINE # 21
    006E D4160400      MOV       R1,[R6+#04H]
    0072 A9A1          MOVB      RL5,[R1]
    0074 D4160200      MOV       R1,[R6+#02H]
    0078 F18A          MOVB      RL4,RL5
    007A 6989          ANDB      RL4,[R1]
    007C C087          MOVBZ     R7,RL4
                                               ; SOURCE LINE # 22
    007E         ?C0005:
                                               ; SOURCE LINE # 23
    007E F087          MOV       R8,R7
                                               ; SOURCE LINE # 63
    0080 F6F70000 R    MOV       it,R7
                                               ; SOURCE LINE # 64
    0084 CB00          RET
                 ; FUNCTION main (END    RMASK = @0x41F2)

C166 Version 4.24 Release

  • [XC16x Device Support]
    Corrected XC16x example programs to match the released devices. Added OCDS Debugging Information and corrected various problems with the XC164 OCDS interface. Interrupt vector tables are located at the segment start address derived from the ICODE class when the L166 VECTAB directive is not used.
  • [Extended C166 Inline Assembler]
    A new extended inline assembler is integrated into the Keil C166 Compiler. With the extended inline assembler you may insert assembler instructions into C function code while retaining full debug and optimization capabilities. The extended inline assembler fully supports all C16x, XC16x, ST10, and Super10 instruction set extensions. Example programs are provided in the \C166\EXAMPLES\XC16X DEVICES\ folder.
  • [ULINK Installation]
    Enhanced the Keil ULINK installation. Details on ULINK can be found in \C166\HLP\OCDS.CHM.
  • [µVision2 IDE]
    Added Flash menu to µVision2. This menu provides a direct interface to external Flash programming tools and allows you to use the OCDS interface to program the on-chip FLASH memory of XC16x devices. Flash programming commands are configured under Options for Target ? Utilities.

C166 Version 4.23 Release

  • [µVision2]
    Added DaVE support for the new XC161/XC164 devices.
  • [µVision2]
    Added drivers for ULINK (USB-OCDS Adapter for XC16x Devices).
  • [C166 Compiler]
    Corrected the behavior of pragma directives to be compatible with C166 Version 4.20. Version 4.22 added detailed checking for primary controls and created problems with existing source code. Now the behavior is compatible with Version 4.20 except that the ORDER directive must be specified on the command line or at the beginning of a C source file.
  • [L166 Linker]
    Corrected a problem that occurred (due to EC++ segments) when building Monitor-166. EC++ segments are now generated only for projects that contain EC++ modules.
  • [µVision2 Debugger]
    Added debug dialogs (for most C16x and ST10 devices) that display the peripheral status while debugging using Monitor-166 or an Emulator.

C166 Version 4.22 Release

    Added EC++ Compiler. Several tool enhancements were made to support EC++. Details for using the EC++ Compiler can be found in \C166\HLP\EC166.CHM.
    Added support for the new Infineon XC161/XC164 devices.

C166 Version 4.20 Release

  • [L166 Linker]
    Added the NOSORTSIZE (abbreviation NOSO) directive which disables section sorting within the linker. By default, the linker sorts sections by size before locating them. This ensures fewer gaps in the memory space which reduces memory consumption. The NOSORTSIZE directive disables sorting and is compatible with the version 3 linker.

C166 Version 4.12 Release

  • [C166 Compiler]
    Corrected various minor problems.

C166 Version 4.10a Release

  • [C166 Compiler]
    Added the COMMONRET directive (abbreviation CR) which forces the compiler to generate functions that always exit at the same RET instruction. RET instructions will not be inserted in the middle of a function.
  • [C166 Compiler]
    Added the FIXBFLD directive (abbreviation FB) which ensures that the compiler encloses BFLDL and BFLDH instructions within ATOMIC sequences. This is required to avoid problems documented by Infineon in CPU.21 problem description. To use this directive in µVision2, you must enter it in Options-C166-Misc.

    The FIXBFLD directive causes the compiler to insert ATOMIC #1 instructions before each BFLDL and BFLDH instruction. If the BFLD instruction is used to access ESFR registers, the EXTR sequence is not combined with other EXTR sequences. An exception to this occurs when accessing the SYSCON1, SYSCON2, and SYSCON3 SFR's since this is required by the hardware for UNLOCK sequences.

    The compiler does not modify the use of the _bfld_ intrinsic function within _atomic_-_endatomic_ blocks. You must check such code blocks carefully and insert NOP's if required (using the _nop_ intrinsic function) before the _bfld_() intrinsic call.

    If you use RTX166 Tiny you must enable the FIXBFLD option in RTX166T.A66 and rebuild the RTX166 Tiny library. This corrects the CPU.21 problems in the kernel.
  • [L166 Linker]
    Enhanced the INTNO directive by adding two new subcommands.

    INTNO (interrupt_name (FILL)) causes the linker to direct unused interrupts to the specified interrupt_name. For example:
    void interrupt_trap (void) interrupt MYINT
      while (1);

    defines the interrupt service routine MYINT and...

    L166 myfile.obj INTNO (MYINT (FILL))

    instructs the linker to direct all unused interrupts to MYINT.

    INTNO (interrupt_name (NONE)) suppresses generation of the interrupt vector. For example:

    L166 myfile.obj INTNO (MYINT (NONE))

    instructs the linker not to generate an interrupt vector for MYINT. This may be useful if you supply the interrupt vector in an assembly file. For example:

    EXTERN interrupt_trap:NEAR             ; FAR for MEDIUM, LARGE, HLARGE Model
         int_vector4 section code at 4     ; interrupt vector address
         vector4 proc
            jmp FAR interrupt_trap
         vector4 endp
         int_vector4 ends

C166 Version 4.06 Release

  • [C166 Compiler]
    Added the EXTINS directive which causes the compiler to terminate EXTS and EXTP instruction sequences after each source line (typically, the compiler generates code with EXTS and EXTP sequences that are longer than one source line). This directive improves single-stepping during debugging.

C166 Version 4.05 Release

  • [C166 Compiler]
    Added the _pop_ intrinsic function which uses the POP instruction to pop a 16-bit word value from the system stack.
  • [C166 Compiler]
    Added the _push_ intrinsic function which uses the PUSH instruction to push a 16-bit word value onto the system stack.
  • [C166 Compiler]
    Added the _prior_ intrinsic function which uses the PRIOR instruction to calculate the number of left shifts required to normalize a number.
  • [C166 Compiler]
    Added the _priord_ intrinsic function which uses the PRIORD instruction to calculate the number of left shifts required to normalize a number.
  • [C166 Compiler]
    Changed the behavior of hidden string placement. Hidden strings (those declared without an associated name and memory space) are now located in the memory space requested by their associated pointer declaration. For example:
    const char huge  *phc = "const huge memory";  // String located in huge-const
    const char xhuge *pxc = "const xhuge memory"; // String located in xhuge-const
    const char   far *pfc = "const far memory";   // String located in far const
    const char  near *pnc = "near memory";        // String located in near const

C166 Version 4.03 Release

  • [C166 Compiler]
    Corrected various minor problems.

C166 Version 4.02 Release

  • [C166 Compiler]
    Corrected various minor problems.

C166 Version 4.01 Release

  • [C166 Compiler]
    Added the FIXPEC directive which ensures that functions do not begin with JMP instructions. When you use optimizer level 7 (OPTIMIZE(7)) the compiler may generates JMPs to functions (instead of CALLs). If the function begins with a JMP instruction, you may experience problems with the PEC on some chip steppings. The FIXPEC directive solves this potential problem. To use this directive in µVision2, you must enter it in Options-C166-Misc.
  • [A166 Assembler]
    Enhanced the OMF166 object module format to support 32-bit and 64-bit numbers. This OMF format is supported by the L166 Linker Version 4.02 and higher. The absolute OMF format was not changed so existing debugging tools will continue to function without any problems.
  • [A166 Assembler]
    Enhanced expression evaluation to use 64-Bit arithmetic. Previous versions of the A166 Assembler used 16-bit math when calculating expressions. In the following equate:
    Value EQU (8000h + 9000h) / 2

    A166 Version 3 calculates a value of 800h since the result of the addition is 1000h (a 16-bit value). A166 Version 4.12 calculates a value of 8800h since the result of the addition is 110000h (a 64-bit value).

  • [A166 Assembler]
    Added new directives and operators to support 32-bit and 64-bit values.

    The following directives were added to support defining and reserving space for 32-bit and 64-bit objects:
    • DD: Define double-word value.
    • DF32: Define 32-bit floating-point value.
    • DF64: Define 64-bit floating-point value.
    • DSD: Define storage for a double-word value.

    For example:

    [name[:]] DD   init [, init] [,...] /* DWORD */
    [name[:]] DF32 init [, init] [,...] /* 32-bit IEEE float */
    [name[:]] DF64 init [, init] [,...] /* 64-bit IEEE float */
    [name[:]] DSD  expression           /* DWORD */

    The following operators were added to support 32-bit and 64-bit constant manipulations:

    • DATA32: Creates a 32-bit constant value.
    • DATA64: Creates a 64-bit constant value.
    • WORD0, WORD2, WORD4, WORD6: Extracts a word from an expression.
    • BYTE0, BYTE1, BYTE2, ... BYTE7: Extracts a byte from an expression.
  • [A166 Assembler]
    Reserved more symbols and directives to support new features. If your existing assembler modules use names that are the same as those reserved by the assembler, you must change them. For example, the symbol DD is a reserved symbol. It is used to define a double word value. Therefore, your program may not use DD as a label or other name.
  • [A166 Assembler]
    Enhanced the macro processor to behave like the A51 Assembler and A2561 Assembler. The following directives are now available.
    • NOMACRO disables all macro processing.
    • NOMPL disables the MPL Macro processor.
    • MPL enables the MPL Macro processor.
  • [A166 Assembler]
    Added support for all instructions of the STMicroelectronics ST10 MAC unit. MAC instructions are enabled with the EXTMAC directive. For example:

C166 Version 4.00 Release

  • [C166 Compiler]
    Added support for accessing bit-fields with bit instructions when the associated structure is located in the BDATA address space. For example:
    struct test {
      int bit0: 1;
      int bit1: 1;
      int bit2: 1;
      int bit3: 1;
      int bit4: 1;
      int bit5: 1;
    struct test bdata t;
    void main (void)  {
      t.bit0 = 1;
      if (t.bit1) {
        t.bit2 = t.bit0;

    You may use the HOLD directive to locate structures with single-bit bit-fields to the BDATA memory area. The compiler then generates bit instructions to access the bit-fields. For example:

    C166 MYPROG.C HOLD (bdata 2, near 6)

    locates all structures (smaller than 2 bytes) with bit-fields to the BDATA memory.

  • [C166 Compiler]
    Added a new memory type (EBDATA) which allows you to access extended bits in the Special Function Register (SFR) area. The memory classes EBDATA and EBDATA0 are used for bits in EBDATA.

    You may use this bit-addressing mode to access SFR registers of the 166 derivatives by 1) defining all the CPU SFR registers in a C source file, 2) translating the file with the ORDER directive, 3) and locating the section containing the SFR definitions with the SECTIONS linker directive. For example:

  • [C166 Compiler]
    Added the PACK directive which allows you to specify whether objects in structures are aligned on byte (PACK(1)) or word (PACK()) boundaries. By default, the compiler located all structure members so that they begin on 16-bit word boundaries. The following example shows the difference between byte-alignment and word-alignment:
    #pragma pack(1)     // Select byte-alignment
         struct s1  {
           int  i1;     // i1 has offset 0
           char c1;     // c1 has offset 2
           int  i2;     // i2 has offset 3
           char c2;     // c2 has offset 5
           int  i3;     // i3 has offset 6
           char z1;     // z1 has offset 8
    #pragma pack()      // Select word-alignment
         struct s2  {
           int  i1;     // i1 has offset 0
           char c1;     // c1 has offset 2
           int  i2;     // i2 has offset 4
           char c2;     // c2 has offset 6
           int  i3;     // i3 has offset 8
           char z1;     // z1 has offset 10

    The PACK(1) directive may be useful when exchanging data structures with other systems where no alignment is required. This directive is compatible with the Microsoft C directive.

    Note that the C166 compiler generates considerably more code to access byte-aligned words. For this reason, the PACK(1) directive should be used only when necessary.

  • [C166 Compiler]
    Added the BYTEALIGN directive. By default, the compiler assumes that pointers point to objects that start on word (16-bit) boundaries. The BYTEALIGN directive informs the compiler that struct pointers may point to byte-aligned structures. This directive is required when you use the PACK(1) directive. The following example illustrates this:
    #pragma PACK(1)       // Select byte-alignment
    #pragma BYTEALIGN     // Use pointers to byte-aligned structures
         struct s1  {
           int  i1;       // i1 has offset 0
           char c1;       // c1 has offset 2
           struct s2  {
             int  i2;     // s2.i2 has offset 3
             char c2;     // s2.c2 has offset 5
             int  i3;     // s2.i3 has offset 6
           } s2;
           char z1;       // z1 has offset 8
         } s1;
         struct s2 *s2p;
         void main (void)  {
           s2p = &s1.s2;  // &s1.s2 is a byte-aligned structure
           s2p->i2 = 0;   // s2p->i2 is a byte-aligned int
  • [C166 Compiler]
    Added the PREPRINTONLY directive (abbreviation PPO) which causes the compiler to create a C preprocessor output file and stop after the C preprocessor completes. This directive is similar to the PREPRINT directive except that no object file is created. PREPRINTONLY allows you to optionally specify an output filename (the default filename is basename.I). For example:
  • [C166 Compiler]
    Added the ASMEXPAND directive (abbreviation AE) and the NOASMEXPAND directive (abbreviation NOAE).

    The ASMEXPAND directive is the default setting. It instructs the compiler to expand all symbols used in ASM-ENDASM blocks.

    The NOASMEXPAND directive prevents the the compiler from expanding symbols used in ASM-ENDASM blocks. For example:

    #pragma noasmexpand
    #define  abc  1
    #define  xx0  2
    #define  xx1  3
    #pragma asm
      abc equ 2     ; abc (which is defined above) is not expanded
      xx0 equ 10    ; xx0 (which is defined above) is not expanded
    #ifdef QQQ
      xx1 equ 20    ; xx1 (which is defined above) is not expanded
    #pragma endasm
  • [C166 Compiler]
    Added the USERSTACKDPP3 directive (abbreviation U3) which changes assumptions made by the compiler regarding access to the user stack. By default, the user stack is located in the NDATA memory class and is accessed using R0.

    Use the USERSTACKDPP3 directive to change the memory class of the user stack to IDATA or SDATA (which are accessed using DPP3). To accomplish this you must change the definition of the ?C_USERSTACK section in the STARTUP.A66 or START167.A66 file.

    To this:


    Or this:


    Additionally, you must change the address of the user stack that is loaded into R0.

    From this:


    To this:

  • [C166 Compiler]
    Added the DYNAMICUSRSTK directive (abbreviation DU) which informs the compiler that your program modifies the user stack area. This is useful to developers who create real-time operating systems that change the user stack area. With this directive, it is possible to have a 16KB user stack for each task. Without this control, the entire user stack area must reside in the NDATA memory class which is limited to a maximum of 64 Kbytes.
  • [C166 Compiler]
    Added the NOFRAME directive (abbreviation NOF) which causes the compiler to suppress the prolog and epilog in an interrupt service routine (ISR) that immediately follows the directive specification. This directive is active for only one function. It is useful for interrupt routines that never return (like CPU RESET).

    The following example illustrates the difference in generated code between a standard interrupt and one generated using the NOFRAME directive.

     1          int i1, i2, i3;
     3          void intr_func1 (void)  interrupt 0x21  {
     4   1        i1 = i2 * i3;
     5   1      }
     7          #pragma NOFRAME
     8          void intr_func2 (void)  interrupt 0x22  {
     9   1        i1 = i2 * i3;
    10   1      }
         ; FUNCTION intr_func1 (BEGIN  RMASK = @0x2030)
                                              ; SOURCE LINE # 3
    0000 C6871000      SCXT    MDC,#010H
    0004 EC06          PUSH    MDH
    0006 EC07          PUSH    MDL
    0008 ECF4          PUSH    R4
    000A ECF5          PUSH    R5
                                              ; SOURCE LINE # 4
    000C F2F50000 R    MOV     R5,i3
    0010 F2F40200 R    MOV     R4,i2
    0014 0B45          MUL     R4,R5
    0016 F2F40EFE      MOV     R4,MDL
    001A F6070400 R    MOV     i1,MDL
                                              ; SOURCE LINE # 5
    001E FCF5          POP     R5
    0020 FCF4          POP     R4
    0022 FC07          POP     MDL
    0024 FC06          POP     MDH
    0026 FC87          POP     MDC
    0028 FB88          RETI
         ; FUNCTION intr_func1 (END    RMASK = @0x2030)
         ; FUNCTION intr_func2 (BEGIN  RMASK = @0x2030)
                                              ; SOURCE LINE # 8
                                              ; SOURCE LINE # 9
    002A F2F50000 R    MOV     R5,i3
    002E F2F40200 R    MOV     R4,i2
    0032 0B45          MUL     R4,R5
    0034 F2F40EFE      MOV     R4,MDL
    0038 F6070400 R    MOV     i1,MDL
                                              ; SOURCE LINE # 10
    003C FB88          RETI
         ; FUNCTION intr_func2 (END    RMASK = @0x2030)

    The interrupt function built using NOFRAME does not switch context nor save and restore registers.

  • [C166 Compiler]
    Added the SAVESYS directive which instructs the compiler to save temporary results to the system stack. This is the default setting for the compiler. This directive is useful for The system stack is always in the on-chip RAM. It is faster than the user stack but the size is limited. See the SAVEUSR directive description for an example of how this directive is used.
  • [C166 Compiler]
    Added the SAVEUSR directive which instructs the C Compiler to save temporary results and saved-by-callee variables to the user stack. This directive is useful when your stack will exceed the size of the on-chip system stack. Of course, accesses to the user stack are slower than accesses to the system stack. For example:
     1    extern void func (void);
     3    #pragma SAVESYS   // Temporary Saves to SYSTEM STACK (default)
     4    int func1 (int i1, int i2)  {
     5 1    func ();
     6 1    return (i1 + i2);
     7 1  }
    10    #pragma SAVEUSR   // Temporary Saves to USER STACK
    11    int func2 (int i1, int i2)  {
    12 1    func ();
    13 1    return (i1 + i2);
    14 1  }
         ; FUNCTION func1 (BEGIN  RMASK = @0x7FFF)
                                              ; SOURCE LINE # 4
    0000 ECFD          PUSH    R13
    0002 ECFE          PUSH    R14
    0004 F0D9          MOV     R13,R9
    ;---- Variable 'i2' assigned to Register 'R13' ----
    0006 F0E8          MOV     R14,R8
    ;---- Variable 'i1' assigned to Register 'R14' ----
                                              ; SOURCE LINE # 5
    0008 CA000000 E    CALLA   cc_UC,func
                                              ; SOURCE LINE # 6
    000C F04E          MOV     R4,R14
    000E 004D          ADD     R4,R13
                                              ; SOURCE LINE # 7
    0010 FCFE          POP     R14
    0012 FCFD          POP     R13
    0014 CB00          RET
         ; FUNCTION func1 (END    RMASK = @0x7FFF)
         ; FUNCTION func2 (BEGIN  RMASK = @0x7FFF)
                                              ; SOURCE LINE # 11
    0016 88D0          MOV     [-R0],R13
    0018 88E0          MOV     [-R0],R14
    001A F0D9          MOV     R13,R9
    ;---- Variable 'i2' assigned to Register 'R13' ----
    001C F0E8          MOV     R14,R8
    ;---- Variable 'i1' assigned to Register 'R14' ----
                                              ; SOURCE LINE # 12
    001E CA000000 E    CALLA   cc_UC,func
                                              ; SOURCE LINE # 13
    0022 F04E          MOV     R4,R14
    0024 004D          ADD     R4,R13
                                              ; SOURCE LINE # 14
    0026 98E0          MOV     R14,[R0+]
    0028 98D0          MOV     R13,[R0+]
    002A CB00          RET
         ; FUNCTION func2 (END    RMASK = @0x7FFF)

    In func1, arguments are passed on the system stack and a PUSH instruction is used to put values onto the stack. In func2, arguments are passed on the user stack (which is accessed using R0) and a MOV instruction is used to put values onto the stack.

  • [C166 Compiler]
    Added optimizer level 7 (OPTIMIZE(7)) common tail merging. When this optimization level is enabled, the compiler analyzes the generated code function-by-function, locates common heads and tails, and merges them if possible. If the compiler detects common code sequences (which commonly occur in switch/case statements) it replaces one code sequence with a jump instruction to the other equivalent code sequence. While analyzing the code, the compiler also replaces instruction sequences with shorter instructions. The default optimizer level is still optimizer level 6. You must enable optimizer level 7 using the OPTIMIZE directive or from the µVision2 Project Options Dialog.
  • [L166 Linker]
    Added the CINITTAB directive which allows you to locate the C166 initialization sections ?C_CLRMEMSEC and ?C_INITTAB to a specific address range. For example:
    L166 myfile.obj CINITTAB (0x10000 - 0x18000)

    locates ?C_CLRMEMSEC and ?C_INITTAB to the address range 0x10000-0x18000. L166 issues a warning if this is not possible.

  • [L166 Linker]
    Added the DISABLEWARNING (abbreviation DW) directive which allows you to selectively disable linker warnings. For example:
    L166 myfile.obj DISABLEWARNING (20, 22)

    disables warnings 20 and 22.

  • [L166 Linker]
    Added Warning 22: CLASS RANGE NOT GIVEN IN INVOCATION LINE. When you use a memory class without defining its address range, the L166 Linker now outputs a warning message. Note that this warning is not generated for the following classes: IDATA, IDATA0, BIT, BIT0, BDATA, and BDATA0.

Release Summary

  1. C166 Version 6.17 Release
  2. C166 Version 6.14 Release
  3. C166 Version 6.11 Release
  4. C166 Version 6.10 Release
  5. C166 Version 6.09 Release
  6. C166 Version 6.08 Release
  7. C166 Version 6.06 Release
  8. C166 Version 6.04 Release

Example Programs

Example programs included in the \C166\EXAMPLES folder demonstrate how to use the µVision2 Project Manager and Debugger (see the µVision2 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 µVision2 IDE is the Device Database which contains information about more than 400 supported microcontrollers. When you create a new µVision2 project and select the target chip from the database, µVision2 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.

Peripheral Simulation

The µVision2 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 µVision2 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 the 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 1500 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.

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...

Keil Software, Inc.
1501 10th Street, Suite 110
Plano, TX  75074

800-348-8051 - Sales
972-312-1107 - Support
972-312-1159 - Fax
- Sales E-Mail
- Support E-mail 
In Europe...

Keil Elektronik GmbH
Bretonischer Ring 15
D-85630 Grasbrunn

+49 89 456040-0 - Sales
+49 89 456040-24 - Support
+49 89 468162 - Fax
- Sales E-Mail
- Support E-Mail

Copyright © Keil™, An ARM® Company.
All rights reserved.
Visit our web site at

  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.