During a king's reign, he must write a Torah scroll for himself in addition to the scroll which was left to him by his ancestors. A court of 71 elders should check this scroll by comparing it to the Torah scroll kept in the Temple Courtyard.
If his ancestors did not leave him a Torah scroll or that scroll was lost, he must write two Torah scrolls:
one, in whose writing, he is obligated as is every individual Israelite, and which he places in his treasury;
the second, which should not move from his presence except when he enters a lavatory, the baths, or other places in which it is not fit to read the words of Torah.
When he goes to war, this scroll should accompany him. When he returns, it should accompany him. When he sits in judgement, it should be with him. When he dines, it should be opposite him, as Deuteronomy 17:19 states: 'It should accompany him and he should read it all the days of his life.'