Your cat has probably injured himself somehow. He may have a slight sprain, or may have stepped on something causing a tiny cut under his paw. He should be better within a couple days, if not see a vet.
It seems possible that your cat may have suffered a stroke, causing it to lose a portion of the sensation in its legs. In this case, the limp may not be painful to the cat.