Cuneiform law
Cuneiform law refers to any of the legal codes written in cuneiform script, that were developed and used throughout the ancient Middle East among the Sumerians, Babylonians, Assyrians, Elamites, Hurrians, Kassites, and Hittites. The Code of Hammurabi is the most well-known of the cuneiform laws, but there were a number of precursor laws.
Cuneiform
The spoken language included many homophones and near-homophones, and in the beginning similar-sounding words such as "life" [til] and "arrow" [ti] were written with the same symbol. After the Semites conquered Southern Mesopotamia, some signs gradually changed from being pictograms to syllabograms, most likely to make things clearer in writing. In that way the sign for the word "arrow" would become the sign for the sound "ti".
Words that sounded alike would have different signs; for instance the syllable "gu" had fourteen different symbols.
When the words had similar meaning but very different sounds they were written with the same symbol. For instance "tooth" [zu], "mouth" [ka] and "voice" [gu] were all written with the symbol for "voice". To be more accurate, scribes started adding to signs or combining two signs to define the meaning. They used either geometrical patterns or another cuneiform sign. 
As time went by, the cuneiform got very complex and the distinction between a pictogram and syllabogram became vague. Several symbols had too many meanings to permit clarity. Therefore, symbols were put together to indicate both the sound and the meaning of a compound. The word "Raven" [UGA] had the same logogram as the word "soap" [NAGA], name of a city [EREŠ] and the patron goddess of Eresh [NISABA]. Two phonetic complements were used to define the word [u] in front of the symbol and [gu] behind. Finally the symbol for "bird" [MUŠEN] was added to ensure proper interpretation.