Here you go Anon. FIBA rules state:
"When judging a charge/block situation involving a player with the ball, an official shall use the following principles:
• The defensive player must establish an initial legal guarding position by facing the player with the ball and having both feet on the floor.
• The defensive player may remain stationary, jump vertically, move laterally or backwards in order to maintain the initial legal guarding position.
• When moving to maintain the initial legal guarding position, one foot or both feet may be off the floor for an instant, as long as the movement is lateral or backwards, but not towards the player with the ball.
• Contact must occur on the torso, in which case the defensive player would be considered as having been at the place of contact first.
• Having established a legal guarding position, the defensive player may turn within his cylinder to avoid injury.
In any of the above situations, the contact shall be considered as having been caused by the player with the ball."
The case of the moving defender is dealt with in the second principle above.