dos_compilers/Logitech Modula-2 v1.1/DISPLAY.MOD
2024-06-30 15:43:04 -07:00

60 lines
1.9 KiB
Modula-2
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(*$T-*)
(*$R-*)
(****************************************************************)
(* *)
(* MODULA-2/86 Library *)
(* *)
(* LOGITECH SA., CH-1143 Apples (Switzerland) *)
(* *)
(* Module: Display *)
(* Terminal driver for writing to the screen. *)
(* This module is private to the Terminal Sub-System and *)
(* should not be used by application programs. *)
(* *)
(* Version 1.05 (Aug 84) *)
(* Characters are output through MS-DOS. *)
(* The special characters, which are interpreted, *)
(* produce code-sequences, according to ANSI standard. *)
(* *)
(* (C) Copyright 1983, 1984 Logitech, All Rights Reserved *)
(* *)
(* Permission is hereby granted to registered users to use *)
(* or abstract the following program in the implementation *)
(* of customized versions. This permission does not *)
(* include the right to redistribute the source code of *)
(* this program. *)
(****************************************************************)
(*$T-*)
(*$R-*)
IMPLEMENTATION MODULE Display; (* WS *)
FROM SYSTEM IMPORT DOSCALL;
FROM ASCII IMPORT EOL;
PROCEDURE Write (ch: CHAR);
(* the following code are interpreted:
14C = FF, clear page, cursor home
ASCII.EOL, go to beginning of next line (scrolls possibly)
177C = DEL, backspace one char and clear it
*)
BEGIN (* ANSI standard : *)
IF ch = 177C THEN (* Delete *)
DOSCALL (6, 10C); (* BackSpace *)
DOSCALL (6, ' ');
DOSCALL (6, 10C); (* BackSpace *)
ELSIF ch = EOL THEN (* EOL: end of line character in Modula system *)
DOSCALL (6, 15C);
DOSCALL (6, 12C);
ELSIF ch = 14C THEN (* Form Feed: clear screen *)
DOSCALL (6, 33C);
DOSCALL (6, '[');
DOSCALL (6, '2');
DOSCALL (6, 'J');
ELSE DOSCALL (6, ch);
END;
END Write;
END Display.