Carl,
Using one intersection table is violating relational design pricniples. An entity in relational desing is a person, place, thing, or concept about which we must record information. The intersecting table is a concept of one table (A) being related to another (Codes). Whenyou try to make the intersecting table relate more than two tables (a,B to codes) you are overloading the intersecting table.
This does not mean that you can't make it work, it only means that it is not the simplest design for the problem.