
ARCHITECTURE AND INSTRUCTIONS
statements. Each statement normally occu- pies one line. If succeeding lines are needed, they start with "&". The structure of an
NAME1 SEGMENT statement
statement
NAME1 ENDS
NAME2. SEGMENT statement
statement
NAME2 ENDS
END
OUT program below, the assembler would assemble faster, but the program would be much
Tokens
Before examining the kinds of statements from which
IDENTIFIERS
Identifiers are names that you, the pro- grammer, are free to make up. Identifiers in the sample program are SUM, CYCLE, and PORT _VAL. An identifier is a sequence of letters, numbers, and underscore characters (_), but may not start with a number. An identifier may be up to 31 characters long, which means the length is practically unlim- ited. Examples of identifiers are:
The programs presented here all display a consistent tabular pattern.
Such tabulation is not part of the program structure; it is optional to the assembler, but highly recommended to make programs eas- ier to read and understand.
In the untabulated version of the IN_AND_
X
GAMMA
JACKS
THIS_NODE
THISNODE
The last two examples are indeed different identifiers.
IN_AND_OUT SEGMENT | ;start of segment |
ASSUME CS:IN_AND...OUT | ;that'swhat'sin CS |
CYCLE:IN AX,5 |
|
INCAX |
|
OUT2,AX |
|
JUMP CYCLE |
|
IN_AND_OUT ENDS | ;end of seg ment |
END CYCLE | ;end of assembly |