We begin by covering the basics of how it is structured. In HCS12 assembly program, each line — excluding certain special constructs — is made up of four distinct fields.
Figure 2.1 A sample program.
The order of these fields are:
For now, don’t worry about what each line of code means, but focus on how it’s structured. Note that some of the fields may be empty or optional.
Labels are used to identify memory locations in the programs and data areas. It is optional. The rules for forming a label are as follows:
A
-Z
, a
-z
), and the letter can be followed by letters, digits, or special symbols (_
or .
).:
.:
.The operation field occurs after the label field and must be preceded by at least one white-space character — i.e. must not start at column one. There are two types of entries: