Chapter 9 Writing Machine Language Instructions and Directive Statements
Writing Directive Statements 163
9.4.7 opt
Syntax
label operation operand
opt on | off
Default settings
If omitted, opt off will be assumed.
Functional description
This directive enables and disables the optimization functions of the assembler and linker.
The optimization applies only to conditional and unconditional branch instructions. The optimization
function evaluates how the source statements are coded, and converts them to the optimal code with the
linker.
While the linker is linking multiple files, it outputs the instructions with the smallest possible code size
for the instructions subject to optimization.
Refer to chapter 4, "Optimization", for details.
NOTE: The -Od assembler option disables the optimization function, however,
optimization will be enabled if opt on is coded in the source file
Operand coding rules
The strings that can be coded for the operand and their meanings are as follows.
opt on Enables optimization.
opt off Disables optimization.
Usage example
Below is an example use of the opt directive.
opt on
opt off