- •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 |
383 |
|
|
Glossary
A51
The standard 8051 Macro Assembler.
AX51
The extended 8051 Macro Assembler.
ANSI
American National Standards Institute. The organization responsible for defining the C language standard.
argument
The value that is passed to a macro or function.
arithmetic types
Data types that are integral, floating-point, or enumerations.
array
A set of elements, all of the same data type.
ASCII
American Standard Code for Information Interchange. This is a set of 256 codes used by computers to represent digits, characters, punctuation, and other special symbols. The first 128 characters are standardized. The remaining 128 are defined by the implementation.
batch file
An ASCII text file containing commands and programs that can be invoked from the command line.
Binary-Coded Decimal (BCD)
A BCD (Binary-Coded Decimal) is a system used to encode decimal numbers in binary form. Each decimal digit of a number is encoded as a binary value 4 bits long. A byte can hold 2 BCD digits – one in the upper 4 bits (or nibble) and one in the lower 4 bits (or nibble).
BL51
The standard 8051 linker/locator.
block
A sequence of C statements, including definitions and declarations, enclosed within braces ({ }).
384 |
Glossary |
|
|
C51
The Optimizing C Compiler for classic 8051 and extended 8051 devices.
CX51
The Optimizing C Compiler for Philips 80C51MX architecture and the Dallas 80C390.
constant expression
Any expression that evaluates to a constant non-variable value. Constants may include character and integer constant values.
control
Command line control switch to the compiler, assembler or linker.
declaration
A C construct that associates the attributes of a variable, type, or function with a name.
definition
A C construct that specifies the name, formal parameters, body, and return type of a function or that initializes and allocates storage for a variable.
directive
Instruction or control switch to the compiler, assembler or linker.
escape sequence
A backslash (‘\’) character followed by a single letter or a combination of digits that specifies a particular character value in strings and character constants.
expression
A combination of any number of operators and operands that produces a constant value.
formal parameters
The variables that receive the value of arguments passed to a function.
function
A combination of declarations and statements that can be called by name to perform an operation and/or return a value.
function body
A block containing the declarations and statements that make up a function.
function call
An expression that invokes and possibly passes arguments to a function.
Keil Software — Cx51 Compiler User’s Guide |
385 |
|
|
function declaration
The name and return type of a function that is explicitly defined elsewhere in the program.
function definition
The name, formal parameters, return type, declarations, and statements describing what a function does.
function prototype
A function declaration that includes the list of formal parameters in parentheses following the function name.
in-circuit emulator (ICE)
A hardware device that aids in debugging embedded software by providing hardware-level single-stepping, tracing, and break-pointing. Some ICEs provide a trace buffer that stores the most recent CPU events.
include file
A text file that is incorporated into a source file.
keyword
A reserved word with a predefined meaning for the compiler or assembler.
L51
The old version of the 8051 linker/locator. L51 is replaced with the BL51 linker/locater.
LX51
The extended 8051 linker/locator.
LIB51, LIBX51
The commands to manipulate library files using the Library Manager.
library
A file that stores a number of possibly related object modules. The linker can extract modules from the library to use in building a target object file.
LSB
Least significant bit or byte.
macro
An identifier that represents a series of keystrokes.
manifest constant
A macro that is defined to have a constant value.
386 |
Glossary |
|
|
MCS® 51
The general name applied to the Intel family of 8051 compatible microprocessors.
memory model
Any of the models that specifies which memory areas are used for function arguments and local variables.
mnemonic
An ASCII string that represents a machine language opcode in an assembly language instruction.
MON51
An 8051 program that can be loaded into your target CPU to aid in debugging and rapid product development through rapid software downloading.
MSB
Most significant bit or byte.
newline character
A character used to mark the end of a line in a text file or the escape sequence (‘\n’) to represent the newline character.
null character
ASCII character with the value 0 represented as the escape sequence (‘\0’).
null pointer
A pointer that references nothing. A null pointer has the integer value 0.
object
An area of memory that can be examined. Usually used when referring to the memory area associated with a variable or function.
object file
A file, created by the compiler, that contains the program segment information and relocatable machine code.
OH51, OHX51
The commands to convert absolute object files into Intel HEX file format.
opcode
Also referred to as operation code. An opcode is the first byte of a machine code instruction and is usually represented as a 2–digit hexadecimal number. The opcode indicates the type of machine language instruction and the type of operation to perform.
Keil Software — Cx51 Compiler User’s Guide |
387 |
|
|
operand
A variable or constant that is used in an expression.
operator
A symbol (e.g., +, -, *, /) that specifies how to manipulate the operands of an expression.
parameter
The value that is passed to a macro or function.
PL/M-51
A high-level programming language introduced by Intel at the beginning of the 1980’s.
pointer
A variable containing the address of another variable, function, or memory area.
pragma
A statement that passes an instruction to the compiler at compile time.
preprocessor
The compiler’s first pass text processor that manipulates the contents of a C file. The preprocessor defines and expands macros, reads include files, and passes directives to the compiler.
relocatable
Object code that can be relocated and is not at a fixed address.
RTX51 Full
An 8051 Real-time Executive that provides a multitasking operating system kernel and library of routines for its use.
RTX51 Tiny
A limited version of RTX51.
scalar types
In C, integer, enumerated, floating-point, and pointer types.
scope
Sections of a program where an item (function or variable) can be referenced by name. The scope of an item may be limited to file, function, or block.
Special Function Register (SFR)
An SFR or Special Function Register is a register in the 8051 internal data memory space that is used to read and write to the hardware components of
388 |
Glossary |
|
|
the 8051. This includes the serial port, timers, counters, I/O ports, and other hardware control registers.
source file
A text file containing C program or assembly program code.
stack
An area of memory, indirectly accessed by a stack pointer, that shrinks and expands dynamically as items are pushed onto and popped off of the stack. Items in the stack are removed on a LIFO (last-in first-out) basis.
static
A storage class that, when used with a variable declaration in a function, causes variables to retain their value after exiting the block or function in which they are declared.
stream functions
Routines in the library that read and write characters using the input and output streams.
string
An array of characters that is terminated with a null character (‘\0’).
string literal
A string of characters enclosed within double quotes (“ ”).
structure
A set of elements of possibly different types grouped together under one name.
structure member
One element of a structure.
token
A fundamental symbol that represents a name or entity in a programming language.
two’s complement
A binary notation that is used to represent both positive and negative numbers. Negative values are created by complementing all bits of a positive value and adding 1.
type
A description of the range of values associated with a variable. For example, an int type can have any value within its specified range (-32768 to 32767).
Keil Software — Cx51 Compiler User’s Guide |
389 |
|
|
type cast
An operation in which an operand of one type is converted to another type by specifying the desired type, enclosed within parentheses, immediately preceding the operand.
Vision2
An integrated software development platform that supports the Keil Software development tools. Vision2 combines Project Management, Source Code Editing, and Program Debugging in one environment.
whitespace character
Characters used as delimiters in C programs such as space, tab, and newline.
wild card
One of the characters (? or *) that can be used in place of characters in a filename.
390 |
Glossary |
|
|