We experimentally investigate the use of DC-balanced line coding in a wavelength-shared bidirectional wavelength-division-multiplexed passive optical network using 10-Gb/s directly modulated lasers (DMLs) for downlink and 2.5-Gb/s reflective semiconductor optical amplifiers for uplink. We show that the line coding not only allows us to utilize the flat frequency response of the DML but it also alleviates the downlink-to-uplink crosstalk induced by remodulation.