Slave codes were set of rules for establishing and regulating slavery. They were used to define who could be enslaved, how slaves could be punished, to defined how the owner could free his slaves. According these laws slaves were property, and, as such, they had few or no legal rights. The slave codes were forerunners of the black codes of the mid-19th century.