System information
3.4.1 The ORG Directive
The ORG statement takes the form:
label ORG expression
where label is an optional program identifier and expression is a 16-bit expression, consisting of
operands that are defined before the ORG statement. The assembler begins machine code
generation at the location specified in the expression. There can be any number of ORG
statements within a particular program, and there are no checks to ensure that the programmer is
not defining overlapping memory areas. Note that most programs written for the CP/M system
begin with an ORG statement of the form:
ORG 100H
which causes machine code generation to begin at the base of the CP/M transient program area. If
a label is specified in the ORG statement, the label is given the value of the expression. This
label can then be used in the operand field of other statements to represent this expression.
3.4.2 The END Directive
The END statement is optional in an assembly-language program, but if it is present it must be
the last statement. All subsequent statements are ignored in the assembly. The END statement
takes the following two forms:
label END
label END expression
where the label is again optional. If the first form is used, the assembly process stops, and the
default starting address of the program is taken as 0000. Otherwise, the expression is evaluated,
and becomes the program starting address. This starting address is included in the last record of
the Intel-formatted machine code hex file that results from the assembly. Thus, most CP/M
assembly-language programs end with the statement:
END 100H
resulting in the default starting address of 100H (beginning of the transient program area).
3.3 Forming the Operand CP/M Operating System Manual
3-11