Below is an example of simple subroutine based parameterized Mach compatible macro I use.
(Filename: DrillSimple.tap)
(Drills a continuous hole at the current X, Y location to the specified depth)
(Z must be set at zero on top of workpiece)
(If desired depth can be compensated for tip length)
G20 (Units: Inches)
G40 G90 G94
(Set Editable Parameters)
#1=1.0 (Set Depth)
#2=2500 (Set RPM)
#3=3.0 (Set Feed Rate)
#4=0.1 (Set Rapid Height)
#5=0.0 (Set to 1.0 to add tip length comp, 0.0 not to)
#6=0.250 (Drill diameter, required for tip length comp)
(Internal Parameters)
#10=[[#1/-1] - #5 * #6 * 0.3] (Drilling Depth)
S#2 F#3
G0 Z#4 (Raise to Rapid Height)
M3 (Spindle On)
(Make any required X,Y move)
(G0 X1 Y1)
M98 P1024 L1 (Call Simple Drill subroutine)
M5 M9 (Spindle, Coolant Off)
M30 (Program End)
O1024 (Subroutine to Simple Drill)
G90 (Set Absolute)
G0 Z0.02 (Rapid to just above workpiece)
M8 (Coolant On)
G1 Z#10 (Drill)
G0 Z#4 (Raise to Rapid Height)
M9 (Coolant off)
M99 (Subroutine Return)