code could be soemething like this
%
G21 G40 G00 G99 G17
G0 Z10 (lift z-up)
G0 X10 Y10 (go to drill position)
M3 S1000 (spindle on with higher speed for the drilling)
G1 Z-5 F100 (drill the hole)
M3 S100 (Slow spindle down to tap speed)
G84 X10 Y10 Z-10 R10 L1 F50 (tap and debur)
all S an F Parameter Need to be calculated to your pitch.
and you will Need a spindle Feedback.