- •Chapter 1. Introduction
- •Support for all 8051 Variants
- •Books About the C Language
- •Chapter 2. Compiling with the Cx51 Compiler
- •Environment Variables
- •Running Cx51 from the Command Prompt
- •ERRORLEVEL
- •Cx51 Output Files
- •Control Directives
- •Directive Categories
- •Reference
- •Chapter 3. Language Extensions
- •Keywords
- •Memory Areas
- •Program Memory
- •Internal Data Memory
- •External Data Memory
- •Far Memory
- •Special Function Register Memory
- •Memory Models
- •Small Model
- •Compact Model
- •Large Model
- •Memory Types
- •Explicitly Declared Memory Types
- •Implicit Memory Types
- •Data Types
- •Bit Types
- •Special Function Registers
- •sbit
- •Absolute Variable Location
- •Pointers
- •Generic Pointers
- •Pointer Conversions
- •Abstract Pointers
- •Function Declarations
- •Function Parameters and the Stack
- •Passing Parameters in Registers
- •Function Return Values
- •Specifying the Memory Model for a Function
- •Specifying the Register Bank for a Function
- •Register Bank Access
- •Interrupt Functions
- •Reentrant Functions
- •Chapter 4. Preprocessor
- •Directives
- •Stringize Operator
- •Predefined Macro Constants
- •Chapter 5. 8051 Derivatives
- •Analog Devices MicroConverter B2 Series
- •Atmel 89x8252 and Variants
- •Dallas 80C320, 420, 520, and 530
- •Arithmetic Accelerator
- •Data Pointers
- •Library Routines
- •Philips 8xC750, 8xC751, and 8xC752
- •Philips 80C51MX Architecture
- •Philips and Atmel WM Dual DPTR
- •Customization Files
- •STARTUP.A51
- •INIT.A51
- •XBANKING.A51
- •Basic I/O Functions
- •Memory Allocation Functions
- •Optimizer
- •General Optimizations
- •Options for Code Generation
- •Segment Naming Conventions
- •Data Objects
- •Program Objects
- •Interfacing C Programs to Assembler
- •Function Parameters
- •Parameter Passing in Registers
- •Parameter Passing in Fixed Memory Locations
- •Function Return Values
- •Using the SRC Directive
- •Register Usage
- •Overlaying Segments
- •Example Routines
- •Small Model Example
- •Compact Model Example
- •Large Model Example
- •Data Storage Formats
- •Bit Variables
- •Signed and Unsigned Long Integers
- •Generic and Far Pointers
- •Floating-point Numbers
- •Accessing Absolute Memory Locations
- •Absolute Memory Access Macros
- •Linker Location Controls
- •The _at_ Keyword
- •Debugging
- •Chapter 7. Error Messages
- •Fatal Errors
- •Actions
- •Errors
- •Syntax and Semantic Errors
- •Warnings
- •Chapter 8. Library Reference
- •Intrinsic Routines
- •Library Files
- •Standard Types
- •va_list
- •Absolute Memory Access Macros
- •CBYTE
- •CWORD
- •DBYTE
- •DWORD
- •FARRAY, FCARRAY
- •FVAR, FCVAR,
- •PBYTE
- •PWORD
- •XBYTE
- •XWORD
- •Routines by Category
- •Buffer Manipulation
- •Character Conversion and Classification
- •Data Conversion
- •Math Routines
- •Memory Allocation Routines
- •Stream Input and Output Routines
- •String Manipulation Routines
- •Miscellaneous Routines
- •Include Files
- •8051 Special Function Register Include Files
- •ABSACC.H
- •ASSERT.H
- •CTYPE.H
- •INTRINS.H
- •MATH.H
- •SETJMP.H
- •STDARG.H
- •STDDEF.H
- •STDIO.H
- •STDLIB.H
- •STRING.H
- •Reference
- •Compiler-related Differences
- •Library-related Differences
- •Appendix B. Version Differences
- •Version 6.0 Differences
- •Version 5 Differences
- •Version 4 Differences
- •Version 3.4 Differences
- •Version 3.2 Differences
- •Version 3.0 Differences
- •Version 2 Differences
- •Appendix C. Writing Optimum Code
- •Memory Model
- •Variable Location
- •Variable Size
- •Unsigned Types
- •Local Variables
- •Other Sources
- •Appendix D. Compiler Limits
- •Appendix E. Byte Ordering
- •Recursive Code Reference Error
- •Problems Using the printf Routines
- •Uncalled Functions
- •Using Monitor-51
- •Trouble with the bdata Memory Type
- •Function Pointers
- •Glossary
- •Index
Keil Software — Cx51 Compiler User’s Guide |
357 |
|
|
Appendix B. Version Differences
This appendix lists an overview of major product enhancements and differences between the current version of the Cx51 compiler and previous versions. The current version contains all enhancements listed below:
Version 6.0 Differences B
EXTERNAL and SEGMENT limitations removed
The number of external symbols and segments per module are no longer limited to 256. This historical limitation was imposed by the old Intel Object File format.
First 256 characters of a variable name are significant
Now the first 256 characters of a variable name are significant. Previously, only the first 32 characters were significant.
Support for Philips 80C51MX and Dallas Contiguous Mode
Cx51 provides support for the Philips 80C51MX architecture and the Dallas Contiguous Mode that is available on the Dallas 390 and variants.
OMF2 directive and far memory type support
The OMF2 directive selects a new OMF file format that provides detailed symbol type checking across modules and supports up to 16MB code and xdata memory. This format is required when you use the STRING, VARBANKING, and XCROM directives.
STRING directive
Cx51 allows you to locate constant strings into const xdata or const far space which leaves more code space available for program code.
USERCLASS directive
Assigns user defined class names to compiler generated segments. Class names may be referenced by the LX51 linker to locate all segments with a specific class name.
VARBANING directive and far memory type support
Two new memory types, far and const far, and user configureable access routines provide support for up to 16MB extended code and xdata memory. The VARBANKING directive enables far memory type support.
XCROM directive
The XCROM directive locates constants into xdata ROM which frees code ROM space for program code.
358 |
Appendix B. Version Differences |
|
|
Support for Analog Devices B2 series of MicroConverters
The B2 series of ADuC devices contains dual DPTR and an extended stack.
NOTE
Only the the PK51 Professional Developers Kit supports the OMF2 output file format, Philips 80C51MX, Dallas Contiguous Mode, and VARBANKING. These options are not available in the CA51 and DK51 packages.
B
Version 5 Differences
Optimize Level 7, 8, and 9
C51 offers three new optimizer levels. These new optimizations focus primarily on code density. Refer to “Optimizer” on page 157 for more information.
Directives for the dual DPTR support
C51 provides dual DPTR support for Atmel, Atmel WM, and, Philips with the directives MODA2 and MODP2.
data, pdata, xdata automatic variables overlayable in all memory models
C51 now overlays all data, pdata, and xdata automatic variables regardless of the selected memory model. In previous C51 versions, only automatic variables of the default memory type are overlaid. For example, C51 Version 5 did not overlay pdata or xdata variables if a function where compiled in the SMALL memory model.
The data type enum adjusts automatically 8 or 16 bits.
C51 now uses a char variable to represent an enum, if the enum range allows that.
modf, strtod, strtol, strtoul Library Functions
C51 now includes the ANSI standard library functions modf, strtod, strtol, strtoul
BROWSE, INCDIR, ONEREGBANK, RET_XSTK, and RET_PSTK Directives
C51 supports new directives for generating Browse Information, specifying include directives, optimizing interrupt code, and using the reentrant stack for return addresses. Refer to “Chapter 2. Compiling with the Cx51” on page 17 for more information.
Keil Software — Cx51 Compiler User’s Guide |
359 |
|
|
Version 4 Differences
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 179 for more information.
_chkfloat_ Library Function |
|
|
|
|
|
B |
|||
|
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 245 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 38 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 218 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. |
|
|||||||
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 |
|
|
|
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 |
|
360 |
Appendix B. Version Differences |
|
|
compiler now also checks for unused local variables, labels, and expressions. Refer to “WARNINGLEVEL” on page 85 for more information.
B