94
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
Assembler Directives
5.18
Section for Dead-Code Elimination
.SECTION, .ENDSECTION
Allows the removal of code specified between the
.SECTION
and
.ENDSECTION
directives. The
.SECTION
directive must be followed by an exported global label. If there is no call to the global
label, the code will be eliminated and call offsets will be adjusted appropriately. The
.ENDSECTION
directive ends the dead-code section. Note that use of this directive is not limited to removing dead
code.
PSoC Designer takes care of dead code. Check the “Enable Elimination of un-used User Modules
(area) APIs” field under the Project > Settings > Compiler tab. If you check this field upon a build, the
system will go in and remove all dead code from the APIs in an effort to free up space.
5.19
Suspend/Resume Code Compressor
OR F,0; ADD SP,0
Used to prevent code compression of the code between the
OR F,0
and
ADD SP,0
instructions.
The code compressor may need to be suspended for timing loops and jump tables. If the
JACC
instruction is used to access fixed offset boundaries in a jump table, any
LJMP
and/or
LCALL
instruc-
tion entries in the table may be optimized to relative jumps or calls, changing the proper offset value
for the
JACC
. A
RET
or
RETI
instruction will resume code compression if it is encountered before an
ADD SP,0
instruction. These instructions are defined as the macros
Suspend_CodeCompressor
and
Resume_CodeCompressor
in the file
m8c.inc
.
Directive
Arguments
.SECTION
.ENDSECTION
< none >
Example:
The section of code is designated as possible dead code.
Export Counter8_1_WriteCompareValue
.SECTION
Counter8_1_WriteCompareValue:
MOV reg[Counter8_1_COMPARE_REG], A
RET
.ENDSECTION
Directive
Arguments
OR F,0
ADD SP,0
< none >
Example:
Code compression is suspended for the jump table.
OR F,0
MOV A, [State]
JACC StateTable
StateTable:
LJMP State1
LJMP State2
LJMP State3
ADD SP,0
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 ...