write display control code