EmVT52.Mesa
Copyright Ó 1986, 1992 by Xerox Corporation. All rights reserved.
Last Edited by: Spreitzer, January 11, 1986 2:41:33 pm PST
DIRECTORY CharDisplays, DisplayControllers, DisplayControllerSteps, Rope, TermProgs;
Emulates a VT52.
EmVT52: CEDAR PROGRAM
IMPORTS DisplayControllers, DisplayControllerSteps, TermProgs
= {OPEN DisplayControllers, DisplayControllerSteps, TermProgs;
MakeVT52: PROC RETURNS [t: Term] = {
t ¬ NEW [TermRep ¬ [cp: NewControlProgram[] ]];
AddInstruction[t.cp, LIST["\007"], [Beep]];
AddInstruction[t.cp, LIST["\010"], [SkipCursor, $left]];
AddInstruction[t.cp, LIST["\011"], [Tab, $dontTouch]];
AddInstruction[t.cp, LIST["\012"], [SkipCursor, $down]];
AddInstruction[t.cp, LIST["\015"], [CarriageReturn]];
AddInstruction[t.cp, LIST["\033A"], [SkipCursor, $up]];
AddInstruction[t.cp, LIST["\033C"], [SkipCursor, $right]];
AddInstruction[t.cp, LIST["\033H\033J"], [ClearScreen]];
AddInstruction[t.cp, LIST["\033I"], [ScrollBack]];
AddInstruction[t.cp, LIST["\033J"], [ClrTo, $eos]];
AddInstruction[t.cp, LIST["\033K"], [ClrTo, $eol]];
AddInstruction[t.cp,
LIST["\033Y",
NEW [DecodeRep ¬ [reg: line, base: NumChars, org: ' , len: 1]],
NEW [DecodeRep ¬ [reg: col, base: NumChars, org: ' , len: 1]]],
[JumpCursor, $hv]];
};
RegTerm["vt52", MakeVT52[]];
}.