

Task

Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out.

There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implementer decides to change the font or kerning during the display of the temporary screen, then these settings need to be restored prior to exit.




include c:\cxpl\codes;  \intrinsic 'code' declarations
 
proc SetPage(P);        \Select active display page for video screen
int  P;
int  CpuReg;
[CpuReg:= GetReg;       \access CPU registers
CpuReg(0):= $0500 + P;  \call BIOS interrupt $10, function 5
SoftInt($10);
]; \SetPage
 
[SetPage(1);            \enable page 1 text display screen
Clear;                  \clear screen and output something
Text(0, "Hit any key to restore original screen. ");
if ChIn(1) then [];     \wait for keystroke
SetPage(0);             \restore original, default text screen, page 0
]