M3 should be spindle forward.
M4 should be spindle reverse.
M5 should be spindle stop.
M2 should be program end, commonly M30 does the same thing.
I'm doubting that these industry standard conventions would be mixed up in Mach, but I don't know it for a fact. Maybe you can mess with them yourself?