Jump to content

360 Assembly/360 Instructions/ORG

From Wikibooks, open books for an open world
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

[edit | edit source]
Name Operation Operands
ORG [expr]
[name] ORG [expr]
[.symbol] ORG [expr]

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

[edit | edit source]

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

[edit | edit source]
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

 
360 Assembler Pseudo Instructions
Address Related ADATACNOPDROPEQULOCTRLTORGORGUSING
Code Related ALIASAMODECATTRCOM CSECTCXDDSECTDXDEND ENTRYEXTRNOPSYNRMODERSECTSTARTWXTRNXATTR
Data Related CCWCCW0CCW1DCDS
Conditional Assembly and Macro related ACTRAGOAIFAINSERTANOPAREADCOPYGBLA / GBLB / GBLCLCLA / LCLB / LCLCMACROMENDMEXITMNOTESETA / SETB / SETC
Listing, output and source related Comments*PROCESSACONTROLEJECTENDEXITCTLICTLISEQPOPPRINTPUNCHPUSHREPROSPACETITLE
 
360 Assembly Language
360 Family Introduction · Basic FAQ · 360 Family · 360 Architecture
360 Instruction Set 360 Instructions · Branch Instructions · Data Transfer Instructions · Control Flow Instructions · Arithmetic Instructions · Logic Instructions · Shift and Rotate Instructions · Priveleged Instructions · Other Instructions
Syntaxes and Assemblers 360 Assemblers· Pseudo Instructions
Instruction Extensions Floating Point · High-Level Languages