G, M, and other codes outside of the normal generic codes are normally machine specific and issued in the post processor for that machine. That really means that you can do anything that will work for your system. M codes for instance that are numbered greater than 100 are user (machine builder) defined and could be defined to do anything. Many machines have special codes that are only applicable to that machine.