You are trying to compare apples to oranges, but here you go:
Black codes denied blacks the right to testify against whites, to serve on juries or in state militias, or to vote, and express legal concern publicly.
Similarity: Immigrants cannot serve on juries or serve in militia nor have the right to vote. Arizona's current immigration laws follow this agenda as do every state in the union.
Difference: Blacks were/are citizens of the country, immigrants are not.

