360 Assembly/360 Instructions/ORG


 * ORG Pseudo instruction - Set value of program counter

The ORG pseudo instruction tells the assembler to set the value of the location counter to the specified address, or to reset the location counter if altered by a prior ORG.

Format
where
 * name is an optional defined symbol
 * or
 * .symbol is an optional conditional assembly label
 * and
 * expr is an optional relocatable address within the current control section

Description
The ORG pseudo instruction alters the location counter of this control section (the current CSECT, DSECT, or START). If name is specified, the address is adjusted to the value of the previously defined symbolname. If expr is specified, it must not be lower than the lowest address defined for this control section. An ORG statement without an expr value resets the location counter to the highest address used in the current control section.

Examples
PRNTLINE DS  CL131     CREATE A PRINT BUFFER ORG PRNTLINE CTLCHR  DS   C         THIS OCCUPIES THE SAME ADDRESS AS *                       THE FIRST BYTE OF PRNTLINE LASTNAME DS  CL15      OCCUPIES THE SAME ADDRESS AS BYTES 2-16 OF PRNTLINE DS  C FRSTNAME DS   CL10 DS  C ACCOUNT  DS   CL8 ORG         , RESET TO NEXT BYTE AFTER PRNTLINE

The comma on the last line is used to be sure the assembler does not presume the first word of the comment is interpreted as an argument to that ORG statement