Look at Genesis 4.
Genesis 4:3-8 3 So it came about in the course of time that Cain brought an offering to the LORD of the fruit of the ground. 4 Abel, on his part also brought of the firstlings of his flock and of their fat portions. And the LORD had regard for Abel and for his offering; 5 but for Cain and for his offering He had no regard. So Cain became very angry and his countenance fell. 6 Then the LORD said to Cain, "Why are you angry? And why has your countenance fallen? 7 "If you do well, will not your countenance be lifted up? And if you do not do well, sin is crouching at the door; and its desire is for you, but you must master it." 8 Cain told Abel his brother. And it came about when they were in the field, that Cain rose up against Abel his brother and killed him.
We see a number of pre-codified commandments at work:
The first commandment by obeying sin rather than God.
Third commandment by making an obviously deficient offering (in vain).
Fourth commandment by practicing deficient worship.
Fifth commandment by abandoning the instruction of his parents.
Six commandment by murdering his brother.
Tenth commandment by coveting through jealousy.
God's moral law has existed even before the codified law of Moses. Paul tells us that God's moral law is known since the time of Christ.
Romans 1:19 19 because that which is known about God is evident within them; for God made it evident to them.
Romans 2:14-15 14 For when Gentiles who do not have the Law do instinctively the things of the Law, these, not having the Law, are a law to themselves, 15 in that they show the work of the Law written in their hearts, their conscience bearing witness and their thoughts alternately accusing or else defending them,