Chapter 9 Writing Machine Language Instructions and Directive Statements
Writing Directive Statements 155
Operand coding rules
Only specific strings can be defined for definition1 and definition2. If some other string is defined, the
assembler will generate an error and ignore this directive.
The value of expression must be a power of 2 between 1 and 32768, or 0. If its value is outside this
range, the assembler will assume the closest valid value instead.
The attribute, link type, and location boundary of sections with the same name must be either identical
or omitted. If a different attribute, link type, or location boundary is defined, actual value will be
inherited from the setting of the very first section.
If there is the same section name in a file with a different attribute, link type, or location boundary, the
linker warns.
Directive coding rules
The section directive has no restrictions on where in the source file it can be defined.
Usage example
Below is an example use of the section directive.
NOTE: Assembler instructions and dc, dw, ds and dd directives must be coded after a
section has been defined. If used before a section has been defined, the
assembler will generate an error and ignore that assembler instruction or
directive.
NOTE: The value for the section name will be the starting address in the same section
after link. If separating the sections, the starting address of the lowest section
will be used.
_CODE section CODE, PUBLIC, 2
main jsr INIT
.
.
.