Sub calls can be a simple path, or complex macro commands. It all depends on the creativity of the programmer.
The main reason for simple subs is you only need to change code in 1 place to change every use of the sub.
Macros (fancy subs) allow the use of the same code to do varied operations. Again easily changed in the sub, or by the sub call parameters.
Two samples might be:
Simple g-code that is executed where ever the sub is called
Code:
o123 call (1 x 1 square)
o123 sub (1" square sub)
G91
G1 X1.0 F10.0
Y1.0
X0.0
Y0.0
G90
o123 subend
A more advanced example that uses the two numbers in the call line to change the lengths of the rectangle each time it is called.
Code:
o123 call [2.0] [1.5] (2 x 1.5 rectangle)
o123 call [1.0] [2.5] (1 x 2.5 rectangle)
o123 sub (rectangle macro)
G91
G1 X#1 F10.0
Y#2
X0.0
Y0.0
G90
o123 subend
Remember EMC2 needs the sub to be BEFORE the call, or in a separate file like ArcEye's attachements