black code (n.)
local or state legal restrictions on black persons, free or slave; attested by 1840, American English, though the thing itself is much older.