Mastercam is a CAD/CAM software that is primarily employed for the purpose of CNC machine programming and design. G code and M code are generated by Mastercam.