Thanks Dave, this is another way to solve my problem.

Indexing the port may be faster in the loop's execution (I need speed).