Com Piller
Com Piller
Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709
Phone (USA): 800.858.1810
Phone (Intnl): 408.943.2600
http://www.cypress.com
[+] Feedback
Copyrights
Copyrights
Copyright © 2005 Cypress Semiconductor Corporation. All rights reserved.
Programmable System on a Chip, PSoC, PSoC Designer and PSoC Express are trademarks of Cypress Semiconductor Cor-
poration (Cypress), along with Cypress® and Cypress Semiconductor™. All other trademarks or registered trademarks refer-
enced herein are the property of their respective owners.
The informationPSoC Designer C Language Compiler User Guide in this document is subject to change without notice and
should not be construed as a commitment by Cypress. While reasonable precautions have been taken, Cypress assumes no
responsibility for any errors that may appear in this document. No part of this document may be copied or reproduced
in any form or by any means without the prior written consent of Cypress. Made in the U.S.A.
Disclaimer
CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PAR-
TICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein.
Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress
does not authorize its products for use as critical components in life-support systems where a malfunction or failure may rea-
sonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems appli-
cation implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.
[+] Feedback
Contents
1. Introduction 9
1.1 Purpose .......................................................................................................................9
1.2 Section Overviews .....................................................................................................10
1.3 Support ......................................................................................................................10
1.3.1 Technical Support...........................................................................................10
1.3.2 Product Upgrades ..........................................................................................10
1.4 Documentation Conventions......................................................................................11
1.4.1 Acronyms .......................................................................................................11
3. Compiler Files 15
3.1 Startup File ................................................................................................................15
3.2 Library Descriptions ...................................................................................................15
4. Compiler Basics 17
4.1 Data Types ................................................................................................................17
4.2 Operators ...................................................................................................................18
4.3 Expressions ...............................................................................................................19
4.4 Statements.................................................................................................................20
4.5 Pointers......................................................................................................................20
4.6 Re-Entrancy ...............................................................................................................20
4.7 Processing Directives ................................................................................................21
4.7.1 Preprocessor Directives .................................................................................21
4.7.2 Pragma Directives..........................................................................................21
5. Functions 23
5.1 Library Functions .......................................................................................................23
5.1.1 String Functions .............................................................................................23
5.1.2 Mathematical Functions .................................................................................28
5.1.3 API Software Library Functions......................................................................29
5.2 Interfacing C and Assembly.......................................................................................30
6. Additional Considerations 31
6.1 Accessing M8C Features...........................................................................................31
6.2 Addressing Absolute Memory Locations ...................................................................31
6.3 Assembly Interface and Calling Conventions ............................................................31
[+] Feedback
Contents
7. Linker 37
7.1 Linker Operations ......................................................................................................37
7.2 Linking Process .........................................................................................................37
7.2.1 Customized Linker Actions ............................................................................37
8. Librarian 39
8.1 Librarian.....................................................................................................................39
8.1.1 Compiling a File into a Library Module...........................................................39
8.1.2 Listing the Contents of a Library ....................................................................41
8.1.3 Adding or Replacing a Library Module...........................................................41
8.1.4 Deleting a Library Module ..............................................................................41
[+] Feedback
Contents
[+] Feedback
Contents
[+] Feedback
List of Tables
Table 1-1. Overview of the C Language Compiler User Guide Sections .....................................10
Table 1-2. Documentation Conventions .......................................................................................11
Table 1-3. Acronyms ....................................................................................................................11
Table 2-1. Compiler Menu and Toolbar Options ..........................................................................14
Table 4-1. Supported Data Types ................................................................................................17
Table 4-2. Supported Operators...................................................................................................18
Table 4-3. Preprocessor Directives ..............................................................................................21
Table 4-4. Pragma Directives.......................................................................................................21
Table 5-1. String Functions ..........................................................................................................24
Table 5-2. Mathematical Functions ..............................................................................................28
Table 5-3. API Software Library Functions...................................................................................29
Table 5-4. Pragma Fastcall16 Conventions for Argument Passing..............................................30
Table 5-5. Pragma Fastcall16 Conventions for Return Value ......................................................30
Table 9-1. Compiler Argument Prefixes .......................................................................................44
Table 9-2. Arguments Affecting the Driver ...................................................................................44
Table 9-3. Preprocessor Arguments ............................................................................................44
Table 9-4. Compiler Arguments ...................................................................................................45
Table 9-5. Linker Arguments ........................................................................................................45
Table A-1. Preprocessor Errors and Warnings.............................................................................51
Table A-2. Preprocessor Command Line Errors...........................................................................52
Table A-3. C Compiler Errors and Warnings ................................................................................53
Table A-4. Assembler Errors and Warnings .................................................................................56
Table A-5. Assembler Command Line Errors ...............................................................................57
Table A-6. Linker Errors and Warnings ........................................................................................57
[+] Feedback
List of Tables
[+] Feedback
1. Introduction
1.1 Purpose
The PSoC Designer C Compiler compiles each .c source file to a PSoC device assembly file. The
PSoC Designer Assembler then translates each assembly file (either those produced by the com-
piler or those that have been added) into a relocatable object file, .o. After all the files have been
translated into object files, the linker combines them together to form an executable file. This .hex file
is then downloaded to the emulator where it is debugged to perfect design functionality.
For comprehensive details on hardware, system use, and assembly language, refer to the following
documents. Together, these documents comprise the PSoC Designer documentation suite.
■ PSoC Designer PSoC Programmer User Guide
■ PSoC Designer C Language Compiler User Guide
■ PSoC Designer Assembly Language User Guide
■ PSoC Designer ICE Connection and Troubleshooting Guide
■ PSoC Designer USB Adapter Installation Guide
■ PSoC Technical Reference Manual
■ Device-specific PSoC Mixed-Signal Array Data Sheet
[+] Feedback
Introduction
1.3 Support
Free support for PSoC Designer and its C Compiler is available online at http://www.cypress.com/.
Resources include Training Seminars, Discussion Forums, Application Notes, PSoC Consultants,
TightLink Technical Support Email/Knowledge Base, and Application Support Technicians.
Before utilitzing the Cypress support services, know the version of PSoC Designer installed on your
system. To quickly determine the version, build, or service pack of your current installation of PSoC
Designer, click Help > About PSoC Designer.
[+] Feedback
Introduction
1.4.1 Acronyms
The following are acronyms used throughout this user guide.
[+] Feedback
Introduction
[+] Feedback
2. Accessing the Compiler
In this chapter you will learn how to enable and access the compiler, and its menu and toolbar
options.
[+] Feedback
Accessing the Compiler
Replace Text Edit > Replace [Ctrl] [H] Replace specified text
Find in Files Edit > Find in Files Find specified text in specified file(s)
[+] Feedback
3. Compiler Files
In this chapter you will learn startup file procedures and how to reference supported library files.
Many functions within PSoC Designer are built upon specifications in this file. Therefore, it
is highly recommended that you do not modify the startup file. If you have a need, first
consult your Cypress Technical Support Representative.
The boot.asm startup file also defines the reset vector. Normally, you do not need to modify the star-
tup file to use other interrupts because PSoC Designer manages all interrupt vectors. If you need to
add a ljmp to a custom interrupt handler, the boot.tpl file can be modified.
Avoid use of the following characters in path and file names (they are problematic):
\ / : * ? " < > | & + , ; = [ ] % $ ` '.
cms.a – This library resides in the …\tools directory. It contains convenient functions that do not
involve user modules. For example, the functions to read and write flash reside here (Flash Block
Programming). C prototypes for using these functions are given in the include file (flashblock.h)
stored in the …\tools \include directory.
[+] Feedback
Compiler Files
[+] Feedback
4. Compiler Basics
In this chapter you can reference PSoC Designer C Compiler data types, operators, expressions,
statements, pointers, re-entrancy, and processing directives.
With one exception, the PSoC Designer C Compiler is a “conforming freestanding implementation” of
the ANSI X3.159-1989 C Standard (C89), or the equivalent ISO/IEC 9899:1990 C Standard. The non-
Standard exception is that floating-point doubles are only 32 bits. Doing 64-bits doubles would be pro-
hibitive on an 8-bit microcontroller.
[+] Feedback
Compiler Basics
The following floating-point operations are supported in the PSoC Designer C Compiler:
compare (= =) add (+)
multiply (*) subtract (-)
divide(/) casting (long to float)
Floats and doubles are in IEEE 754 standard 32-bit format with 8-bit exponent and 23-bit mantissa
with one sign bit.
4.2 Operators
Table 4-2 displays a list of the most common operators supported within the PSoC Designer C Com-
piler. Operators with a higher precedence are applied first. Operators of the same precedence are
applied right to left. Use parentheses where appropriate to prevent ambiguity.
[+] Feedback
Compiler Basics
4.3 Expressions
PSoC Designer supports standard C language expressions.
[+] Feedback
Compiler Basics
4.4 Statements
PSoC Designer C Compiler supports the following standard statements:
■ if else – Decides on an action based on if being true.
■ switch – Compares a single variable to several possible constants. If the variable matches one
of the constants, a jump is made.
■ while – Repeats (iterative loop) a statement until the expression proves false.
■ do – Same as while, except the test runs after execution of a statement, not before.
■ for – Executes a controlled loop.
■ goto – Transfers execution to a label.
■ continue – Used in a loop to skip the rest of the statement.
■ break – Used with a switch or in a loop to terminate the switch or loop.
■ return– Terminates the current function.
■ struct – Used to group common variables together.
■ typedef – Declares a type.
4.5 Pointers
A pointer is a variable that contains an address that points to data. It can point to any data type (i.e.,
int, float, char, etc.). A generic (or unknown) pointer type is declared as void and can be freely cast
between other pointer types. Function pointers are also supported. Note that pointers require two
bytes of memory storage to account for the size of both the data and program memory.
Due to the nature of the Harvard architecture of the M8C microprocessor, a data pointer may point to
data located in either data or program memory. To discern which data is to be accessed, the const
qualifier is used to signify that a data item is located in program memory. See Program Memory as
Related to Constant Data on page 35.
4.6 Re-Entrancy
Currently, there are no pure re-entrant library functions. However, it is possible to create a re-entrant
condition that will compile and build successfully. Due to the constraints that a small stack presents,
re-entrant code is not recommended.
[+] Feedback
Compiler Basics
[+] Feedback
Compiler Basics
[+] Feedback
5. Functions
In this chapter you can reference compiler library functions supported within PSoC Designer and
learn how to interface between the C and assembly languages.
PSoC Designer C Compiler functions use arguments and always return a value. All C programs
must have a function called main(). Each function must be self-contained in that you may not
define a function within another function or extend the definition or a function across more than one
file.
It is important to note that the compiler generates inline code whenever possible. However, for some
C constructs, the compiler generates calls to low level routines. These routines are prefixed with two
underscores and should not be called directly by the user.
[+] Feedback
Functions
[+] Feedback
Functions
[+] Feedback
Functions
memcpy The function copies n characters from the object pointed to by src into the object string.h
pointed to by dest. If copying takes place between objects that overlap, the
behavior is undefined. The function returns the value of dest.
void *memmove(void *dest, CONST void *src, size_t n);
memmove The function copies n characters from the object pointed to by src into the object string.h
pointed to by dest. The function works correctly for overlapping objects. The
function returns the value of dest.
void *memset(void *ptr, int c, size_t n);
memset The function copies the value of c (converted to an unsigned char) into each of string.h
the first n characters of the object pointed to by ptr. The function returns the
value of ptr.
char *strcat(char *dest, CONST char *src);
The function appends a copy of the string pointed to by src (including the termi-
strcat nating null character) to the end of the string pointed to by dest. The initial char- string.h
acter of src overwrites the null character at the end of dest. If copying takes
place between objects that overlap, the behavior is undefined. The function
returns the value of dest.
char *strchr(CONST char *s, int c);
The function locates the first occurrence of c (converted to a char) in the string
strchr pointed to by s. The terminating null character is considered to be part of the string.h
string. The function returns a pointer to the located character, or a null pointer if
the character does not occur in the string.
int strcmp(CONST char *s1, CONST char *s2);
The function compares the string pointed to by s1 to the string pointed to by s2.
strcmp The function returns an integer greater than, equal to, or less than zero, accord- string.h
ingly as the string pointed to by s1 is greater than, equal to, or less than the
string pointed to by s2.
int strcoll(CONST char *s1, CONST char *s2);
The function compares the string pointed to by s1 to the string pointed to by s2
strcoll using the collating convention of the current locale. The function returns an inte-
ger greater than, equal to, or less than zero, accordingly as the string pointed to
by s1 is greater than, equal to, or less than the string pointed to by s2.
char *strcpy(char *dest, CONST char *src);
strcpy The function copies the string pointed to by src (including the terminating null string.h
character) into the array pointed to by dest. The function returns the value of
dest.
size_t strcspn(CONST char *s1, CONST char *s2);
strcspn The function computes the length of the maximum initial segment of the string string.h
pointed to by s1 which consists entirely of characters not from the string pointed
to by s2. The function returns the length of the segment.
[+] Feedback
Functions
[+] Feedback
Functions
[+] Feedback
Functions
[+] Feedback
Functions
Table 5-5 reflects the set of #pragma fastcall16 conventions used for return value register assign-
ments.
[+] Feedback
6. Additional Considerations
In this chapter you will learn additional compiler options to leverage the functionality of your code or
program.
[+] Feedback
Additional Considerations
[+] Feedback
Additional Considerations
The compiler does not account for inline assembly in its generated code. Inline assembly
may modify the behavior of generated C Compiler code.
6.6 Interrupts
Interrupt handlers can be written in C. In order to employ them, you must first inform the compiler
that the function is an interrupt handler. To do this, use the following pragma (in the file where you
define the function, before the function definition):
#pragma interrupt_handler <name> *
For an interrupt function, the compiler generates the reti instruction instead of the ret instruction,
then saves and restores all registers used in the function. For example:
#pragma interrupt_handler timer_handler
...
void timer_handler()
{
...
}
You may place multiple names in a single interrupt_handler pragma, separated by spaces. For
example:
#pragma interrupt_handler timer_ovf sci_ovf
To associate the interrupt handler with an interrupt, add ljmp _name at the interrupt vector in the
boot.tpl file.
Virtual registers are saved only if they are used by the routine. If your interrupt handler calls another
function, then the compiler saves and restores all virtual registers, since it does not know which vir-
tual register the called function uses. In the large memory model, the Page Pointer registers
(CUR_PP, IDX_PP, MVW_PP, and MVR_PP) are saved and restored in addition to Virtual registers.
If the compiler MAC is enabled (Project > Settings > Compiler tab, Enable MAC is
checked by default), the compiler will use the MAC in ISRs, intermittently corrupting the
foreground computations that use the MAC. It is the programmer’s responsibility to use
#pragma nomac at the beginning of each ISR function written in C.
6.7 IO Registers
IO registers are specified using the following #pragma:
#pragma ioport LED:0x04; // ioport is at IO space 0x04
char LED;.... LED must be declared in global scope
LED = 1;
[+] Feedback
Additional Considerations
[+] Feedback
Additional Considerations
If you declare local variables with the const qualifier, they will not be put into Flash and
your program will not compile.
[+] Feedback
Additional Considerations
6.13 Strings
The compiler allocates all literal strings in program memory. Effectively, the type for declaring a lit-
eral string is const char and the type for referencing it is const char*. You must ensure that
function parameters take the appropriate argument type.
[+] Feedback
7. Linker
In this chapter you will learn how the linker operates within PSoC Designer.
[+] Feedback
Linker
could use this feature. If you were developing code in C for the BootLoader AREA you would use the
following pragma in your C source file:
#pragma text:BootLoader // switch the code below from
// AREA text to BootLoader
// ... Add your Code ...
#pragma text:text // switch back to the text AREA
If you were developing code in assembly you would use the AREA directive as follows:
AREA BootLoader(rom,rel)
; ... Add your Code ...
AREA text ; reset the code AREA
Now that you have code that should be located in the BootLoader AREA, you can add your custom
Linker commands to custom.lkp. For this example, you would enter the following line in the cus-
tom.lkp file:
-bBootLoader:0x3800.0x3FFF
You can verify that your custom Linker settings were used by checking the 'Use verbose build mes-
sages' field in the Builder tab under the Tools > Options menu. You can build the project then view
the Linker settings in the Build tab of the Output Status window (or check the location of the Boot-
Loader AREA in the .mp file).
In the large memory model, RAM areas can be fixed to a certain page using -B. For example,
-Bpage3ram:3 puts the area page3ram on page 3.
[+] Feedback
8. Librarian
In this chapter you will learn the librarian functions of PSoC Designer.
8.1 Librarian
A library is a collection of object files in a special form that the linker understands. When your pro-
gram references a library’s component object file directly or indirectly, the linker pulls out the library
code and links it to your program. The library that contains supported C functions is usually located
in the PSoC Designer installation directory at ...\PSoC Designer\tools\libs\SMM (or
LMM\...)\libcm8c.a. (SMM or LMM for small memory model or large memory model paging
support.)
There are times when you need to modify or create libraries. A command line tool called ilibw.exe is
provided for this purpose. Note that a library file must have the .a extension. For more information,
refer to the Linker on page 37.
[+] Feedback
Librarian
The nice thing about having local.dep included at the end of the master Makefile is that the rules
used in the Makefile can be redefined (see the Help > Documentation \Supporting Docu-
ments\make.pdf for detailed information). In this example, it is used as an advantage. The follow-
ing code shows information from example local.dep:
# ----- Cut/Paste to your local.dep File -----
define Add_To_MyCustomLib
$(CRLF)
The rules (e.g., obj/%.o : %.asm project.mk and obj/%.o : %.c project.mk) in the
local.dep file shown above are the same rules found in the master Makefile with one addition each.
The addition in the redefined rules is to add each object (target) to a library called PSoCToolsLib.a:
$(foreach library_file, $(filter-out obj/main.o,
$@), $(Add_To_MyCustomLib))
The MAKE keyword foreach causes one piece of text (the first argument) to be used repeatedly,
each time with a different substitution performed on it. The substitution list comes from the second
foreach argument.
In this second argument, there is another MAKE keyword/function called filter-out. The fil-
ter-out function removes obj/main.o from the list of all targets being built (e.g., obj/%.o). This
was one of the goals for this example.
You can filter out additional files by adding those files to the first argument of filter-out such as
$(filter-out obj/main.o obj/excludeme.o, $@). The MAKE symbol combination $@ is a
shortcut syntax that refers to the list of all the targets (e.g., obj/%.o).
The third argument in the foreach function is expanded into a sequence of commands, for each
substitution, to update or add the object file to the library. This local.dep example is prepared to han-
dle both C and assembly source files and put them in the library, PSoCToolsLib.a. The library is cre-
ated and updated in the project root folder in this example. However, you can provide a full path to
another folder (e.g., $(LIBCMD) -a c:\temp\PSoCToolsLib.a $(library_file)).
[+] Feedback
Librarian
Another goal for this example was to not include the boot.asm file in the library. This is easy given
that the master Makefile contains a separate rule for the boot.asm source file, which will not be rede-
fined in local.dep.
You can cut and paste this example and place it in a local.dep file in the root folder of any project. To
view messages in the Build tab of the Output Status window regarding the behavior of your custom
process, go to Tools > Options > Builder tab and click a check at “Use verbose build messages.“
Use the Project > Settings > Linker tab fields to add the library modules/library path if you want other
PSoC Designer projects to link in your custom library.
[+] Feedback
Librarian
[+] Feedback
9. Command Line Overview
In this chapter you will learn supported compiler command line options for users who want to use the
compiler outside PSoC Designer. PSoC Designer normally sets all options for you. Use the informa-
tion presented in this chapter to alter certain aspects of compiler behavior inside PSoC Designer
using the local.mk file.
[+] Feedback
Command Line Overview
[+] Feedback
Command Line Overview
[+] Feedback
Command Line Overview
[+] Feedback
10. Code Compression
In this chapter you will learn how, why, and when to enable the PSoC Designer Code Compressor.
The Code Compressor will take into account that it may have to start with code that is larger than the
available memory. It assumes that the ROM is 20-25% larger and then attempts to pack the code
into the proper ROM maximum size.
[+] Feedback
Code Compression
Because the Code Compressor only sees bytes, it needs to know which portion of the memory
image has valid instructions. It does this easily if the compiler and you adopt the simple convention
that only instructions go into the default text area. The Code Compressor can handle other instruc-
tion areas, but it needs to know about them.
Since the Code Compressor expects a certain correlation between areas and code it can compress,
any user-defined code areas will not be compressed.
Not Allowed
Function A Function X
Calls
Function B Function Y
Allowed
"text" "non_text"
Area Area
The above diagram shows a scenario that is problematic. Code areas created with the AREA direc-
tive, using a name other than “text,” are not compressed or fixed up following compression. If Func-
[+] Feedback
Code Compression
tion Y calls Function B, there is the potential that the location of Function B will be changed by the
Code Compressor. The call or jump generated in the code for Function Y will go to the wrong loca-
tion.
It is allowable for Function A to call a function in a “non_text” Area. The location for Function B can
change because it is in the text Area. Calls and jumps are fixed up in the text Area only. Following
code compression, the call location to Function B from Function X in the non-text Area will not be
compressed.
All normal user code that is to be compressed must be in the default text Area. If you create code in
other area (for example, in a bootloader), then it must not call any functions in the text Area. How-
ever, it is acceptable for a function in the text Area to call functions in other areas. The exception is
the TOP area where the interrupt vectors and the startup code can call functions in the text Area.
Addresses within the text Area must not be used directly.
If you reference any text area function by address, then it must be done indirectly. Its address must
be put in a word in the area "func_lit." At runtime, you must de-reference the content of this word to
get the correct address of the function. Note that if you are using C to call a function indirectly, the
compiler will take care of all these details for you. The information is useful if you are writing assem-
bly code.
[+] Feedback
Code Compression
[+] Feedback
Appendix A. Errors and Warnings
Messages
This appendix supplies a complete list of preprocessor, preprocessor command line, compiler,
assembler, assembler command line, and linker errors and warnings displayed in the PSoC
Designer Status window.
A.1 Preprocessor
Table A-1. Preprocessor Errors and Warnings
Errors or Warnings
# not followed by macro parameter
## occurs at border of replacement
#defined token can't be redefined
#defined token is not a name
#elif after #else
#elif with no #if
#else after #else
#else with no #if
#endif with no #if
#if too deeply nested
#line specifies number out of range
Bad ?: in #if/endif
Bad syntax for control line
Bad token r produced by ## operator
Character constant taken as not signed
Could not find include file
Disagreement in number of macro arguments
Duplicate macro argument
EOF in macro arglist
EOF in string or char constant
EOF inside comment
Empty character constant
Illegal operator * or & in #if/#elsif
Incorrect syntax for `defined'
Macro redefinition
Multibyte character constant undefined
Sorry, too many macro arguments
[+] Feedback
Appendix A. Errors and Warnings Messages
[+] Feedback
Appendix A. Errors and Warnings Messages
A.3 C Compiler
Table A-3. C Compiler Errors and Warnings
Errors or Warnings
Expecting <character>
Literal too long
IO port <name> cannot be redeclared as local variable
IO port <name> cannot be redeclared as parameter
IO port variable <name> cannot have initializer
<n> is a preprocessing number but an invalid %s constant
<n> is an illegal array size
<n> is an illegal bit-field size
<type> is an illegal bit-field type
<type> is an illegal field type
`sizeof' applied to a bit field
Addressable object required
asm string too long
Assignment to const identifier
Assignment to const location
Cannot initialize undefined
Case label must be a constant integer expression
Cast from <type> to <type> is illegal in constant expressions
Cast from <type> to <type> is illegal
Conflicting argument declarations for function <name>
Declared parameter <name> is missing
Duplicate case label <n>
Duplicate declaration for <name> previously declared at <line>
Duplicate field name <name> in <structure>
Empty declaration
Expecting an enumerator identifier
Expecting an identifier
Extra default label
Extraneous identifier <id>
Extraneous old-style parameter list
Extraneous return value
Field name expected
Field name missing
Found <id> expected a function
Ill-formed hexadecimal escape sequence
Illegal break statement
Illegal case label
Illegal character <c>
Illegal continue statement
[+] Feedback
Appendix A. Errors and Warnings Messages
[+] Feedback
Appendix A. Errors and Warnings Messages
[+] Feedback
Appendix A. Errors and Warnings Messages
A.4 Assembler
Table A-4. Assembler Errors and Warnings
Errors or Warnings
'[' addressing mode must end with ']'
) expected
.if/.else/.endif mismatched
<character> expected
EOF encountered before end of macro definition
No preceding global symbol
Absolute expression expected
Badly formed argument, ( without a matching )
Branch out of range
Cannot add two relocatable items
Cannot perform subtract relocation
Cannot subtract two relocatable items
Cannot use .org in relocatable area
Character expected
Comma expected
equ statement must have a label
Identifier expected, but got character <c>
Illegal addressing mode
Illegal operand
Input expected
Label must start with an alphabet, '.' or '_'
Letter expected but got <c>
Macro <name> already entered
Macro definition cannot be nested
Maximum <#> macro arguments exceeded
Missing macro argument number
Multiple definitions <name>
No such mnemonic <name>
Relocation error
Target too far for instruction
Too many include files
Too many nested .if
Undefined mnemonic <word>
Undefined symbol
Unknown operator
Unmatched .else
Unmatched .endif
[+] Feedback
Appendix A. Errors and Warnings Messages
A.6 Linker
Table A-6. Linker Errors and Warnings
Errors or Warnings
Address <address> already contains a value
Can't find address for symbol <symbol>
Can't open file <file>
Can't open temporary file <file>
Cannot open library file <file>
Cannot write to <file>
Definition of builtin symbol <symbol> ignored
Ill-formed line <%s> in the listing file
Multiple define <name>
No space left in section <area>
Redefinition of symbol <symbol>
Undefined symbol <name>
Unknown output format <format>
[+] Feedback
Appendix A. Errors and Warnings Messages
[+] Feedback
Index
A compiler arguments
compiler 45
absolute memory locations 31
driver 44
accessing linker 45
M8C features 31 prefixes 44
the compiler 13 preprocessor 44
acronyms 11 constant data 35
API software library functions 29 custom.lkp file 37
AREA directive 48
arguments, compiler 44
assembler
command line errors 57 D
errors and warnings 56 data memory
assembly interface and calling conventions 31 areas 34
usage 34
data types supported 17
B documentation
acronyms 11
bit toggling 32 conventions 11
boot.asm file 15, 48 overview 10
boot.tpl file 15 purpose 9
build messages for code compression 49 reference materials 9
suite 9
driver 43
C
C compiler errors and warnings 53
calling conventions and assembly interface 31 E
character type functions 23 enabling the compiler 13
cms.a file 15 error messages 51
code compression expressions, supported 19
AREA directive 48
build messages 49
considerations 50 F
integration of code compressor 48
process 47 fastcall function 30
text area requirement 48 files
theory of operation 47 library descriptions 15
compilation process 43 name conventions 15
compiler files for startup 15
accessing 13 Flash memory areas 34
basics 17 frame layout 36
driver 43 functions
enabling 13 API software library 29
files 15 interfacing C and assembly 30
interrupts 33 library 23
linker operations 37 mathematical 28
processing directives 21 string 23
startup 15
[+] Feedback
Index
H P
help 10 page pointer registers 22
pointers 20
pragma directives 21
I #pragma abs_address 21
#pragma end_abs_address 21
inline assembly 32 #pragma fastcall GetChar 21
integration of code compressor 48 #pragma fastcall16 argument passing 30
interfacing C and assembly (fastcall) 30 #pragma fastcall16 GetChar 21
interrupts 33 #pragma fastcall16 return value 30
IO registers 33 #pragma interrupt_handler 22
#pragma ioport 21
#pragma nomac 22
#pragma text 21
L #pragma usemac 22
libcm8c.a file 15 preprocessor
libpsoc.a file 15 command line errors 52
librarian directives 21
adding or replacing a library module 41 errors and warnings 51
compiling a file into a library module 39 process of code compression 47
deleting a library module 41 processing directives
listing the contents of a library 41 pragma directives 21
library preprocessor directives 21
descriptions 15 program memory usage 34
functions 23 as related to constant data 35
linker purpose of document 9
customized actions 37
errors and warnings 57
process 37
long jump/call 33 R
re-entrancy 20
reference materials 9
M restoring internal registers 36
V
virtual registers 36
[+] Feedback
Revision History
Distribution: External/Public
Posting: None
[+] Feedback
62 PSoC Designer C Language Compiler User Guide, Document # 38-12001 Rev. *E
[+] Feedback