I need some code translated for me.

TX_PORT could be any port register, I'm guessing, because it looks like the code is just, doing bit-banging.