I really do not understand why you may need this.
At design time, you decide what you will connect on which ports. Then you proceed to writing the program.
At this stage you have lines that will be defining what your circuit will do, at compile time, and what decisions your code will do at run time. Your electric connection cannot change dynamically!
It just doesn't make sense, to me at least, why move around a LED or Buzzer, or Button from port to port at run time...
Ioannis
Bookmarks