What is the difference between G65 and M98?+−
M98 jumps to a subprogram without passing it any information: the subprogram always does the same thing. G65 calls a macro and passes it values through the letters in the block, which are read inside as variables. If what you repeat is identical code, M98 is enough; if what changes is numbers, G65 saves you from having ten nearly identical subprograms.
Do I need an option to use G65?+−
Yes, user macros are a control option, although they come standard on many machines today. If your control does not have them, the G65 block gives an invalid code alarm. You can check by seeing whether the control lets you write and read variables on the macro screen.
Which letters can I use as arguments?+−
Nearly the whole alphabet except the ones the block needs for something else: G, L, N, O and P are out. Each accepted letter has its local variable assigned by the control, and the table is in the user macro manual. The practical approach is to use A, B, C, D and carry on from there, and document the mapping in the macro header.
How does a macro return a result to the main program?+−
Local variables die on return, so to hand something back you use common variables, which are shared between programs. That is the normal way to pass a probing measurement or a calculation to the main program. Be careful not to overwrite common variables used by another routine in the shop.
Can macro calls be nested?+−
Yes, up to the number of levels the control allows, which is usually four. Each level has its own set of local variables, so one macro can call another without the arguments overwriting each other. What is worth avoiding is overdoing it: a chain of four levels is very hard to debug on a machine screen.