Wouldn't the beginnings of a moral code start when humans became aware that they were conscious individual beings? This awareness would be then be applied to offspring (to give nourishment and protection etc).
As family units came together for protection and ease of finding food, wouldn't social codes be the first thing sorted out? Being aware of our individual consciousness brings personal responsibility in our thoughts and actions with one another in the social realm.