Hammurabi and the Law Code. Hammurabi: 1792-1750 BC. Hammurabi. Sixth king of Babylon, ruled 42 years Conquered most of Mesopotamia Composed a law code of 282 laws to govern society Hammurabi’s Code is one of the oldest surviving codes of law ever written. Hammurabi’s Code Stele.