On a side note, when inside CAS in the UK it is advised to NOT change transponder code to A7700 unless directed by ATC. There are certain situations where this is not practical/possible hence the advisory not mandatory. It isn't much of a problem anymore as most radars retain the a/c ident as well as displaying the emergency code, however this wasn't always the case hence this advisory.