Скачиваний:
47
Добавлен:
21.03.2016
Размер:
985.51 Кб
Скачать

Keil Software — C51 Compiler User’s Guide

317

 

 

 

 

 

 

! Trigraphs

 

 

 

C51 now supports trigraph sequences.

 

 

 

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

 

 

B

Version 3.0 Differences

 

 

 

 

 

!New Control Directive Added for Assembly Source File Output

The SRC control 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.

318 Appendix B. Version Differences

Version 2 Differences

! Absolute Register Addressing

C51 now generates code that performs absolute register addressing. This improves execution speed. The control 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 — C51 Compiler User’s Guide

319

 

 

Using C51 Version 5 with Previous

Versions

You may wish to use the C51 Version 5 with older versions of the 8051 development tools such as BL51, OHS51, or debugging tools and emulators. The new compiler adds object file records for register optimization which makes

the object format incompatible with the old tools. However, you can direct the B compiler and linker to generate object modules that are compatible with the old

tools.

1.Invoke C51 with the control NOAMAKE and do not use REGFILE. or

2.Invoke L51 or BL51 with the control NOAMAKE.

If you are using old debugging tools, you may have problems displaying floating-point numbers and pointers. Make sure that you have current versions of the debugging software.

320

Appendix B. Version Differences

 

 

B

Соседние файлы в папке Лаборатория