ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
77
Assembler Directives
5.1.1
Code Compressor and the AREA Directive
The Code Compressor looks for duplicate code within the “text” Area. The text area is the default
area in which all C code is placed.
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 Function
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 location.
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
fixed up.
If Sublimation is on, there is another scenario that is problematic. Since Sublimation changes the
UserModules Area, you cannot call routines in this area from a code area created with AREA direc-
tive, using a name other than “text”.
All normal user code that is to be compressed must be in the default text area. If you create code in
other areas (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 be not 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.
For further details on enabling and using code compression, see:
■
PSoC Designer C Language Compiler Guide
■
PSoC Designer IDE Guide
"text"
Area
"non_text"
Area
Function A
Function B
Function Y
Calls
Not Allowed
Function X
Allowed
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...