ICAO PANS-OPS says
Except as specified in 1.4, 1.5 and 1.6 in respect of emergency, communication failure or unlawful
interference, the pilot shall:
a) operate the transponder and select Mode A codes as
individually directed by the ATC unit with which contact is being made; or
b) operate the tansponder on Mode A codes as prescribed on the basis of regional air navigation agreements; or
c) in the absence of any ATC directions or regional air agreements, operate the transponder on Mode A Code 2000.