M97: Local Subprogram Call. Jumps to a new line in the current program.
Example:
M97 P1234 L5
This line tells the machine to move to line N1234 of the current program and run the subprogram five times.
M98: Global Subprogram Call. References an entirely different program.
Example:
M98 P5678 L3
This line tells the machine to call global program O5678 from the machine's memory and run it three times.
M99: End Subprogram
Subprograms can be used to modularize programs via creating Operation subprograms and Toolpath subprograms:
Part Subprograms are the entire collection of code to manufacture a singular part, and are typically made of multiple, nested Operation and Toolpath subprograms. Part subprograms are typically utilized to repeat the manufacturing of a product for multi-part machining setups
Operation Subprograms are typically nested within a Part Subprogram since they are specific to individual parts. An "Operation" can be defined as single or multiple toolpaths that perform a combined function related to manufacturing a part
Examples include: Facing, Cut-Off, Pocket Milling, Profile Milling, etc.
Toolpath Subprograms are typically nested within Operation subprogram(s), for repetitive, singular actions
Examples include hole drilling, tapping, chamfering, etc.