At the trial of any person . . . for an offence, subsections (2) and (3) below apply unless—
but subsection (2) below does not apply if, at the conclusion of the evidence for the prosecution, his legal representative informs the court that the accused will give evidence or, where he is unrepresented, the court ascertains from him that he will give evidence.
Where this subsection applies, the court shall, at the conclusion of the evidence for the prosecution, satisfy itself (in the case of proceedings on indictment with a jury , in the presence of the jury) that the accused is aware that the stage has been reached at which evidence can be given for the defence and that he can, if he wishes, give evidence and that, if he chooses not to give evidence, or having been sworn, without good cause refuses to answer any question, it will be permissible for the court or jury to draw such inferences as appear proper from his failure to give evidence or his refusal, without good cause, to answer any question.
Where this subsection applies, the court or jury, in determining whether the accused is guilty of the offence charged, may draw such inferences as appear proper from the failure of the accused to give evidence or his refusal, without good cause, to answer any question.
This section does not render the accused compellable to give evidence on his own behalf, and he shall accordingly not be guilty of contempt of court by reason of a failure to do so.
For the purposes of this section a person who, having been sworn, refuses to answer any question shall be taken to do so without good cause unless—
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
This section applies—