How to tristate output digital pin on a pic 16 series microcontroller?
Page 29 of the Microchip 41213D.pdf document has figure 6-1:


The D FF labelled (TRIS LATCH) means that is the TRS-state latch.  It controls (Gates) the signals from the data latch to turn off the P AND N transistors.  The input to the TRSI Latch is the W Reg.