I don't understand : TRISB = ((DCD i) << (ADCChannel*3)) ^255
Check your manual about DCD, logical and bitwise operators. It's all there

Anyone wants to explain it?

Yes I've put some black magic in