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

Keil Software — C51 Compiler User’s Guide

313

 

 

Appendix B. Version Differences

This following appendix lists an overview of major product enhancements and differences between Version 5 and previous versions. The current version of the C51 compiler contains all enhancements listed below:

Version 4 Differences B

!Byte Order of Floating-point Numbers

Floating-point numbers are now stored in the big endian order. Previous releases of the C51 compiler stored floating-point numbers in little endian format. Refer to “Floating-point Numbers” on page 147 for more information.

!_chkfloat_ Library Function

The intrinsic function _chkfloat_ allows for fast testing of floating-point numbers for error (NaN), ±INF, zero and normal numbers. Refer to “_chkfloat_” on page 208 for more information.

!FLOATFUZZY Directive

C51 now supports the FLOATFUZZY directive. This directive controls the number of bits ignored during the execution of a floating-point compare. Refer to “FLOATFUZZY” on page 23 for more information.

!Floating-point Arithmetic is Fully Reentrant

Intrinsic floating-point arithmetic operations (add, subtract, multiply, divide, and compare) are now fully reentrant. The C library routines fpsave and fprestore are no longer needed. Several library routines are also reentrant. Refer to “Routines by Category” on page 182 for more information.

!Long and Floating-point Operations no Longer use an Arithmetic Stack

The long and floating-point arithmetic is more efficient; the code generated is now totally register-based and does not use a simulated arithmetic stack. This also reduces the memory needs of the generated code.

!Memory Types

The memory types have been changed to achieve better performance in the run-time library and to reflect the memory map of the MCS® 251 architecture.

314

Appendix B. Version Differences

 

 

!Memory Type Bytes for Generic Pointers

The memory type bytes used in generic pointers have changed. The following table contains the memory type byte values and their associated memory type.

 

Memory Type

idata

data

bdata

xdata

pdata

code

 

 

 

 

 

 

 

 

 

C51 V5 Value

0x00

0x00

0x00

0x01

0xFE

0xFF

B

C51 V4 Value

0x01

0x04

0x04

0x02

0x03

0x05

 

 

 

 

 

 

 

 

 

! WARNINGLEVEL Directive

C51 now supports the WARNINGLEVEL directive which lets you specify the strength of the warning detection for the C51 compiler. The C51 compiler now also checks for unused local variables, labels, and expressions. Refer to “WARNINGLEVEL” on page 55 for more information.

Keil Software — C51 Compiler User’s Guide

315

 

 

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 152 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. Refer to “NOAMAKE” on page 35 for

 

more information.

 

!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. Refer to “OPTIMIZE” on page 39 for more information.

!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 42 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 47 for more information.

!vprintf and vsprint Library Functions

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

316 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

 

B

operations are similar on 16-bit CPUs. C51 supports this feature as the

default and provides you with two new control 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 control

 

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 control directives ASM and ENDASM to include source text to output to .SRC files generated using the SRC command directive.

!New Control Directives

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

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