Chapter 9 Writing Machine Language Instructions and Directive Statements

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.

_CODE

section

CODE, PUBLIC, 2

main

jsr

INIT

 

 

.

 

 

.

 

 

.

 

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.

 

 

 

Writing Directive Statements 155

Page 167
Image 167
Panasonic MN1030 user manual Operand coding rules, Directive coding rules, Usage example, Main Jsr