Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
50
Добавлен:
14.04.2015
Размер:
1.37 Mб
Скачать

Keil Software — Cx51 Compiler User’s Guide

361

 

 

Version 3.4 Differences

_at_Keyword

C51 supports variable location using the _at_ keyword. This new keyword allows you to specify the address of a variable in a declaration. Refer to “The _at_ Keyword” on page 186 for more information.

NOAMAKE Directive

B

C51 now supports the NOAMAKE directive. This directive causes C51 to

generate object modules without project information and register

optimization records. This is necessary only if you want to use object files

 

with older versions of C51 tools.

 

OH51 Hex File Converter

The OHS51 Object-Hex-Symbol Converter provided with prior versions of C51 has been replaced with OH51.

Optimizer Level 6

C51 now supports optimizer level 6 which provides loop rotation. The resulting code is more efficient and executes faster.

ORDER Directive

When you specify the ORDER directive, C51 locates variables in memory in the order in which they are declared in your source file. Refer to “ORDER” on page 65 for more information.

REGFILE Directive

C51 now supports the REGFILE directive which lets you specify the name of the register definition file generated by the linker. This file contains information that is used to optimize the use of registers between functions in different modules. Refer to “REGFILE” on page 70 for more information.

vprintf and vsprint Library Functions

The vprintf and vsprintf library functions have been added. Refer to “vprintf” on page 349 and “vsprintf” on page 351 for more information.

362

Appendix B. Version Differences

 

 

Version 3.2 Differences

ANSI Standard Automatic Integer Promotion

The latest version of the ANSI C Standard requires that calculations use int values if char or unsigned char values might overflow during the

calculation. This new requirement is based on the premise that int and char operations are similar on 16-bit CPUs. C51 supports this feature as the

B default and provides you with two new directives, INTPROMOTE and NOINTPROMOTE, to enable or disable integer promotion.

There is a big difference between 8-bit and 16-bit operations on the 8-bit 8051 in terms of code size and execution speed. For this reason, you might want to disable integer promotion by using the NOINTPROMOTE directive.

However, if you wish to retain maximum compatibility with other C compilers and platforms, leave integer promotions enabled.

Assembly Source Generation with In-Line Assembly

You may use the new directives ASM and ENDASM to include source text to output to .SRC files generated using the SRC command directive.

New Directives

The directives ASM, ENDASM, INTERVAL, INTPROMOTE, INTVECTOR, MAXARGS, and NOINTPROMOTE have been added or enhanced.

Offset and Interval Can Now Be Specified for Interrupt Vectors

You may now specify the offset and interval for the interrupt vector table. These features provide support for the SIECO-51 derivatives and allow you to specify a different location for the interrupt vector in situations where the interrupt table is not located at address 0000h.

Parameter Passing to Indirectly Called Functions

Function parameters may now be passed to indirectly called functions if all of the parameters can be passed in CPU registers. These functions do not have to be declared with the reentrant attribute.

Source Code Provided For Memory Allocation Functions

C source code for the memory allocation routines is now provided with the C51 compiler. You may now more easily adapt these functions to the hardware architecture of your embedded system.

Trigraphs

C51 now supports trigraph sequences.

Keil Software — Cx51 Compiler User’s Guide

363

 

 

Variable-length Argument Lists for All Functions

Variable-length argument lists are now supported for all function types. Functions with a variable length argument list do not have to be declared using the reentrant attribute. The new command line directive MAXARGS determines the size of the parameter passing area.

Version 3.0 Differences

B

 

New Directive Added for Assembly Source File Output

 

The SRC directive has been added to direct the compiler to generate an

 

 

 

 

assembly language source file instead of an object file.

 

 

New Library Functions

 

 

The library functions calloc, free, init_mempool, malloc, and realloc have

 

 

been added.

 

364 Appendix B. Version Differences

Version 2 Differences

 

 

Absolute Register Addressing

 

 

C51 now generates code that performs absolute register addressing. This

 

 

improves execution speed. The directives AREGS and NOAREGS,

 

 

respectively, enable or disable this feature.

B

 

Bit-addressable Memory Type

 

Variable types of char and int can now be declared to reside in the

 

bit-addressable internal memory area by using the bdata memory specifier.

 

 

Intrinsic Functions

 

 

Intrinsic functions have been added to the library to support some of the

 

 

special instructions built in to the 8051.

 

 

Mixed Memory Models

 

 

Calls to and from functions of different memory models are now supported.

 

 

New Optimizer Levels

 

 

Two new levels of optimization have been added to the C51 compiler. These

 

 

new levels support register variables, local common subexpression

 

 

elimination, loop optimizations, and global common subexpression

 

 

elimination, to name a few.

 

 

New Predefined Macros

 

 

The macros _ _C51_ _ and _ _MODEL_ _ are now defined by the

 

 

preprocessor at compile time.

 

Reentrant and Recursive Functions

 

 

Individual functions may now be defined as being reentrant or recursive by

 

 

using the reentrant function attribute.

 

Registers Used for Parameter Passing

 

 

C51 now passes up to 3 function arguments using registers. The

 

 

REGPARMS and NOREGPARMS directives enable or disable this feature.

 

Support for Memory-specific Pointers

 

 

Pointers may now be defined to reference data in a particular memory area.

 

Support for PL/M-51 Functions

 

 

The alien keyword has been added to support PL/M-51 compatible functions

 

 

and function calls.

 

 

Volatile Type Specifier

 

 

The volatile variable attribute may be used to enforce variable access and to

 

 

prevent optimizations involving that variable.

Keil Software — Cx51 Compiler User’s Guide

365

 

 

B

Соседние файлы в папке HLP