
- •Chapter 1. Introduction
- •Books About the C Language
- •Chapter 2. Compiling with C51
- •Environment Settings
- •Running C51
- •DOS ERRORLEVEL
- •C51 Output Files
- •Control Directives
- •Directive Categories
- •Reference
- •Chapter 3. Language Extensions
- •Keywords
- •8051 Memory Areas
- •Program Memory
- •Internal Data Memory
- •External Data 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
- •Dallas 80C320, 80C520, and 80C530
- •Siemens 80C517 and 80C537
- •Data Pointers
- •Library Routines
- •Philips/Signetics 8xC750, 8xC751, and 8xC752
- •Customization Files
- •STARTUP.A51
- •START751.A51
- •INIT.A51
- •INIT751.A51
- •PUTCHAR.C
- •GETKEY.C
- •CALLOC.C
- •FREE.C
- •INIT_MEM.C
- •MALLOC.C
- •REALLOC.C
- •Optimizer
- •General Optimizations
- •8051 Specific 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 Pointers
- •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
- •PBYTE
- •PWORD
- •XBYTE
- •XWORD
- •Routines by Category
- •Buffer Manipulation
- •Character Conversion and Classification
- •Data Conversion
- •Math
- •Memory Allocation
- •Stream Input and Output
- •String Manipulation
- •Miscellaneous
- •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
- •Appendix A. Differences from ANSI C
- •Compiler-related Differences
- •Library-related Differences
- •Appendix B. Version 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
- •Trouble with the bdata Memory Type
- •Using Monitor-51
- •Function Pointers
- •Glossary
- •Index

Keil Software — C51 Compiler User’s Guide |
105 |
|
|
Chapter 5. 8051 Derivatives
A number of 8051 derivatives are available that provide enhanced performance while remaining compatible with the 8051 core. These derivatives provide additional data pointers, very fast math operations, and reduced instruction sets.
The C51 compiler directly supports the enhanced features of the following 8051-based microcontrollers:
!AMD 80C321, 80C521, and 80C541 (2 data pointers).
!Dallas 80C320, 80C520, and 80C530 (2 data pointers).
!Phillips/Signetics 8xC750, 8xC751, and 8xC752 (maximum code space of 2 KBytes, no LCALL or LJMP instructions, 64 bytes internal, no external data memory).
!Siemens 80C517 and 80C537 (high-speed 32-bit and 16-bit binary arithmetic operations, 8 data pointers).
The C51 compiler provides you with support for these CPUs through the use of special libraries, library routines, and the command-line directives MODDP2 and MOD517. These directives enable C51 to generate object code that takes
advantage of the enhancements mentioned above. Refer to “Chapter 3. 5 Language Extensions” on page 57 for more information about these directives.

106 Chapter 5. 8051 Derivatives
AMD 80C321, 80C521, and 80C541
The AMD 80C321, 80C521, and 80C541 provide 2 data pointers which can be used for memory access. Using multiple data pointers can improve the speed of library functions like memcpy, memmove, memcmp, strcpy, and strcmp.
The MODDP2 control directive instructs the C51 compiler to generate code that uses both data pointers in your program.
The C51 compiler uses at least one data pointer in an interrupt function. If an interrupt function is compiled using the MODDP2 directive, both data pointers are saved on the stack. This happens even if the interrupt function uses only one data pointer.
To conserve stack space, you may compile interrupt functions with the NOMODDP2 directive. The C51 compiler does not use the second data pointer when this directive is used.
|
Dallas 80C320, 80C520, and 80C530 |
5 |
The Dallas Semiconductor 80C320, 80C520, and 80C530 provide 2 data pointers |
which can be used for memory access. Using multiple data pointers can improve |
the speed of library functions like memcpy, memmove, memcmp, strcpy, and strcmp.
The MODDP2 control directive instructs the C51 compiler to generate code that uses both data pointers in your program.
The C51 compiler uses at least one data pointer in an interrupt function. If an interrupt function is compiled using the MODDP2 directive, both data pointers are saved on the stack. This happens even if the interrupt function uses only one data pointer.
To conserve stack space, you may compile interrupt functions with the NOMODDP2 directive. The C51 compiler does not use the second data pointer when this directive is used.