Shulhan Aruch Even HaEzer 23:1
שולחן ערוך, אבן העזר, כג:א
אסור להוציא שכבת זרע לבטלה ועון זה חמור מכל עבירות שבתורה.
It is forbidden to spill seed. This sin is more grievous than any other sin in the Torah. [Translation by Rabbi Steve Greenberg]
Time Period: Medieval (Geonim through the 16th Century)