The defendant in any criminal prosecution may plead as many several matters, whether of law or fact, as he shall think necessary, and he may file pleas in bar at the same time with pleas in abatement, or within a reasonable time thereafter; but the issues on the pleas in abatement shall be first tried.
Va. Code § 19.2-255