TASKING 8051 Toolchain v7.1 r3

Release Note

  • TASKING Developers' Forum
  • TASKING Home Page
  • TASKING 8051 Support Page
  • TASKING 8051 FAQ
  • TASKING 8051 Application Notes



    This release note describes the changes and new features of all TASKING 8051 products since v7.0.

    The main reasons for this release are:

    Debugger/Flash support for Silicon Laboratories JTAG and C2 target boards

    The Crossview Pro debugger now supports the Silicon Laboratories JTAG and C2 boards. This allows you to debug a program directly from EDE. You can select the Silabs debug environment under Projects | Project Options | Crossview Pro | Execution Environment. Also the flasher now supports both the JTAG as well as the C2 communications protocol. The protocol is automatically selected based on the target family, but can be overriden for the Crossview Pro debugger under Projects | Project Options | Crossview Pro | Communication, or under Projects | Project Options | Flasher | Advanced Flasher Settings for the Flasher.

    Remote Evaluation Board Access Server

    The Remote Evaluation Board Access Server has been added to the product. Installing this server allows you to share a RS-232 connected evaluation board over the network. The board is connected to the PC where the Remote Evaluation Board Access Server is running and all CrossView Pro ROM monitor debuggers can connect from any PC in the network to the server. The Remote Evaluation Board Access Server must be installed separately from the tool chain, which allows you to install it on a machine which does not run the tool chain. The installation is started from the Showroom (started by the initial setup.exe). The Remote Evaluation Board Access Server has its own manual.

    This feature is only available for products on Windows. CrossView Pro on other platforms can connect to a server running on Windows.

    New macro preprocessor mpp51

    A new macro preprocessor mpp51 has been introduced. This new macro preprocessor is backwards compatible with the old version but introduces the following new macro commands:

    And introduces the following new command line options:
    -U<mac> undefine a preprocessor macro
    --prompt=<str> set the prompt for the %IN command
    --disable=<nr>[,<nr>]... suppress a warning and/or error
    --max-nesting=<nr> set the maximum include file nesting level (default=31)
    --[no-]skip-asm-comment skip parsing after assembly comment ';'
    --[no-]allow-undefined-macro allow expansion of undefined macros
    --[no-]warn-on-undefined-macro warn on expansion of undefined macros
    --[no-]file-info generate source file line info
    --[no-]info-messages generate info messages
    --[no-]parameters-redefine allow macro parameters to be redefined


    The ERROR command can be used to trigger a user error 'E 100', macro preprocessing will continue after the ERROR command.


    The ERROR command is replaced with the null string.

    (%ERROR(Macro TEMP not defined))FI


    The FATAL command can be used to trigger a user fatal error 'F 101', macro preprocessing will stop directly after the FATAL command, and the program will exit with value 1.


    The FATAL command is replaced with the null string.

    (%FATAL(Macro TEMP not defined))FI


    The UNDEF command can be used to undefine a previously defined macro, and also to undefine one of the predefined macro commands.


    The UNDEF command is replaced with the null string.



    The OPTION command can be used to trigger most of the command line options from within the source file.


    In the following example the OPTION command is used to set the prompt for the %IN command to y/n:
    %OPTION(--prompt=y/n: )


    The __FILE__ macro is equivalent to the ANSI C predefined macro, it translates into the name of the current source file.


    %ERROR(Error in file %__FILE__)


    The __LINE__ macro is equivalent to the ANSI C predefined macro, it translates into the line number of the current source line.


    %ERROR(Error in file %__FILE__, line %__LINE__)


    The contents of the %{} group macro is expanded and the resulting string is then interpreted itselve like a macro command. This allows for definition of complex recursive macros.


    In the following example the contents of the group command TEXT%SELECT expands to TEXTB, which on its turn is expanded like %TEXTB resulting in Text B.

    Example 1:
    %define(TEXTA)(Text A)
    %define(TEXTB)(Text B)
    %define(TEXTC)(Text C)



    Another useful application of the group command is to separate macro identifiers from surrounding, possible valid identifier characters. In the following example the group command is used to ensure the macro op is expanded, without it op_and_move would be seen as the macro identifier.

    Example 2:


    Extended compiler interrupt handling

    The standard 8051 uses the following relation between interrupt vector number and interrupt vector address:
        vector-address = 3 + vector-number*8
    The 8051 C compiler _interrupt function qualifier uses the vector number and converts this to a corresponding vector address. To support devices using a different vector scheme the C compiler now supports a new function qualifier __interrupt (double underscores!). Instead of taking the vector number this qualifier takes the direct vector address of the interrupt, this allows specification of the interrupt vector on any address. For example:
    __interrupt(0x8074) void ISR( void )

    Note: the _interrupt(vector-number) as well as the __interrupt(vector-address) function qualifiers can be used intermixed.

    Accelerated interrupt support for SMSC Wyndham (LPC47N359)

    To support the SMSC Wyndham accelerated interrupt mechanism the 8051 C Compiler now supports a new __interrupt function qualifier. See also Extended compiler interrupt handling

    Improved custom segment naming

    When selecting code bank switching the compiler automatically uses a different segment name convention to allow for proper function distribution over different code banks. It may in some situations be required to still use a different segment name convention, this can now be done through the standard C Compiler -R option, and through EDE under Project | Project Options | C Compiler | Code Generation | Segment names.

    Improved code banking support

    Code banking support has been improved with the additional support of function pointers crossing bank boundaries. To support this a new runtime routine __IICALL has been introduced to take care of switching to the correct code bank. This routine can be found in the library module 'iicall.src' in the 'lib/src' directory of the installed product.

    Also support has been added to the linker to support different bank numbers. By default code bank numbers used in the bankswitch and __IICALL routine will equal the code bank. In some situations different bank ids are required, e.g. the Silicon Laboratories CF12x family uses 0x00, 0x11, 0x22, 0x33 for banks 0, 1, 2 and 3. The linker now supports a -bankids=<list> option to specify alternative bank ids. Under EDE this list can be specified under:
        Project | Project Options | Linker | Bank Switching.

    Since v7.0r5 the OMF51 conversion utility also supports code banks.

    New compiler #pragma message and assembler $MESSAGE control

    The compiler supports a new #pragma message that can be used to show messages during the build process. For example: 
    #pragma message( "Compiling file " __FILE__ )
    #  pragma message( " date: " __DATE__ ", time: " __TIME__ )

    Also the assembler supports the $MESSAGE control for the same purpose. For example: 
    $MSG(Using the abbreviated control)

    Added '-banks' compiler option

    When using code bank switching several limitations holds regarding references and calls between segments located in different code banks. In order to easen the linker process a special segment naming convention can be selected using the '-banks' compiler option. From EDE this option is by default selected when code bank switching is enabled. It can be explicitly disabled in the Project | Project options | Linker | Bank Switching tab: 'Use alternate bank switch segment name convention'

    New linker BANKGRAPH control

    The linker now supports the BANKGRAPH control. You can use this control to include references and calls between different code banks in the linker mapfile (.l51). In EDE this option is enabled by default when code bank switching and map file generation are enabled. It can be explicitly disabled in the Project | Project options | Linker | Bank Switching tab: 'Include references and calls between code banks in the linker map file'

    New assembler BANK operator

    The assembler now supports the BANK operator. You can use this operator to get the code bank in which the variable is located. Example: 
        RSEG RV
        MOV DPL,#LOW(func)
        MOV DPH,#HIGH(func)
        MOV P1,#BANK(func)

        EXTRN CODE(func)

    New Compiler optimizations

    Several new compiler optimizations have been added to the compiler. These optimizations include amongst others: The compiler now recognizes expressions of type '(x << 8)|y' to merge 2 characters into an integer. Using this type of expression will result in highly optimized code. This optimization can also be used to merge 2 byte SFRs into an integer. Below an example how to achieve this, advantage of this method over implementation of an _sfrword language extension is the ability to merge 2 SFRs that are not on adjacent addresses.

    #define SFRWORD(low,high) (volatile unsigned int)((high << 8) | low)

    _sfrbyte CRCL _at(0x85);
    _sfrbyte CRCH _at(0x90);

    _inline volatile unsigned int GetCRC( void )
        return SFRWORD(CRCL,CRCH);

    unsigned int x;

    void main( void )
        x = GetCRC();

    Support for new 8051 derivatives

    Several new 8051 derivatives including complete new families are now supported throughout the toolchain. The following families are now supported:

    Extended OMF51 output format

    The OMF51 formatter tool is now capable of generating several extensions to the original Intel OMF51 output format. Extensions include: These extensions will be accepted by most debuggers/emulators available today. Besides the even more powerful IEEE-695 format is still available.

    TASKING Flash/Load Tools

    This new version supports flash utilities for the Silicon Laboratories 8051 family (through the Silicon Laboratories JTAG wiggler), the Phytec 8051 target boards and for the Winbond 80C51 family. Also a loader utility is supported for the Infineon C868 Starter Kit. Both flash and load utilities can be selected under Project | Project Options... | Flasher. When a flasher/loader is selected the 'flash' button in the 'build' toolbar is enabled. Pressing this button will directly flash an absolute IEEE-695, OMF51, Intel Hex or Motorola S-Records file to the target.

    New pragmas page and nopage

    To be able to align code segments to a 256 byte boundary the assembler already supported the PAGE directive. From C this attribute can now be forced using the new pragma 'page'. To switch off the use of this attribute the pragma 'nopage' can be used.

    In the following example, the rom variable 'rdata' will be placed in a segment with the PAGE attribute.

    #pragma page

    _rom char rdata[] = { 1, 2, 3, 4 };

    #pragma nopage

    Note: In some situations the segment definition may be postponed till later in the code generation process. So it could be generated after a following '#pragma nopage'. In such situations the pragma 'optimize t' (tentative declaration) may be required.

    Copyright 2004-2005 Altium BV