There are books (can't think of the name, it's still early) that have the ANSI G and M codes. The best reference is your machine's operations manual, because it will have all the standard G and M codes plus any proprietary codes. Every controler is different, which are you working with? I have worked with Mitsubishi, Fanuc and Charmiles; I maybe able to help.