Ok, after playing with this a little longer, I got further, but I don't know enough to understand the new things I've discovered.
I noticed in the Status Line of Mach3 that it has the error message "Return Called with no Sub in effect...looping". See attached screenshot. It's hung on line 5658.
So I look at line 5658, and it's about a dozen lines BEFORE the line that is highlighted in the Mach3 code window. That line is actually 5667. I think I read somewhere that Mach3 looks ahead a few lines, so that might make sense.
Line 5665 (the next line with content before 5667) reads "N5618 M99 (SUBPROGRAM RETURN)". I looked at Wikipedia, and an M99 is a subprogram end, which matches the text in the line.
I notice that line 5667 (highlighted in the code window), reads "O11 (SUBPROGRAM OF O100)". So I looked up what "O" codes are, and they are program names (e.g. "O11"). I assume that includes SUBprogram names, too.
So, in notepad, I put the cursor at the M99 line (5665) and searched UP the file, for the next "O" line. The next letter "O" above line 5665 occurs on line 47, which reads "O10 (SUBPROGRAM OF O100)". Lines 47-5665 are a solid block of commands, with no blank lines, and there are no other "M" (or "O") codes between those two lines.
I hope that wasn't too confusing to follow.
This leads me to believe that the root issue may lie on line 47, and that Mach3 is never recognizing the "O10" beginning of the subprogram. I see on page 10-9 of the Mach3 user manual (
http://www.machsupport.com/docs/Mach3Mill_1.84.pdf ) that the manual's authors at least know this command exists, and I assume recognize it. And on page 10-10 it gives this info...
10.5.2 Subroutine labels
A subroutine label is the letter O followed by an integer (with no sign) between 0 and
99999 written with no more than five digits (000009 is not permitted, for example).
Subroutine labels may be used in any order but must be unique in a program although
violation of this rule may not be flagged as an error. Nothing else except a comment should
appear on the same line after a subroutine label.
Can anyone help me from this point?