Content deleted Content added
Kdakin3420 (talk | contribs) |
Kdakin3420 (talk | contribs) |
||
Line 14:
==A small example==
The following fragment shows how the logic "
<pre>
CLI SEX,'M' Male?
BNE IS_FEM If not, branch around
L 7,MALES Load current value of MALES into register 7
LA 7,1(,7)
ST 7,MALES
B GO_ON Finished with this portion
IS_FEM
ST 7,FEMALES and store
GO_ON EQU *▼
GO_ON EQU * - rest of program -
*
MALES DC F'0' defines 31 bit memory ___location (initially=0)
FEMALES DC F'0' "" ""
</pre>
The following is the ubiquitous [[Hello world]] program, and would, executing under
<pre>
HELLO CSECT The name of this program is 'HELLO'
*
LR 12,15 Set up base register with programs entry point address
WTO 'Hello World' Write To Operator▼
* -end of housekeeping (similar for most programs) -
▲ WTO 'Hello World' Write To Operator (Operating System macro)
*
LM 14,12,4(13) Restore registers as on entry
BR 14 Return to caller
SAVE DS 18A Define 18 fullwords for calling
END HELLO This is the end of the program
</pre>
Note: "WTO" is an Assembler macro that generates an Operating System call
// EXEC PGM=HELLO
or, alternatively, it can be CALLed as a subroutine from such a program.
CALL HELLO
==Types of instructions==
|