[3/4] CP/M for Spectrum-128
ZXNet echo conference «zx.spectrum»
From Michael Markowsky → To All 24 October 1997
Hello, All! with the Health/Zenith terminal and are a subset of the SYSCOC (Sinclair PROFI) console codes. All ESC sequences and
most CTRL console control codes can be used
not only in output statements within programs, but also when working
with the command processor, entering them directly from the keyboard
in response to the system prompt >. Unlike the SP-DOS command processor (Sinclair PROFI MicroDOS), which simply swallows all control codes, the CP/M 2.2 command processor considers them to be an incorrect command and swears at them. But at the same time
it prints out the wrong command with a question mark, and
therefore all control codes go to the console driver and it
performs all the required actions.
Control codes consoles
╔══════І════І═══════І═══════ ═════════════════════════════════╗
║ │code │ │ ║
║symbol│HEX │function│ description║
╠══════╪════╪═══════╪══════════ ══════════════════════════════╣
║ ^A │ 01 │ GRAF │ Pseudo-graphics, the next byte is displayed on the screen ║
║ ║
║ ^G │ 07 │ BELL │ Sound signal ║
║ ^H │ 08 │ BS │ Return one step back ║
║ ^I │ 09 │ TAB │ Tab to a position multiple of eight ║
║ ^J │ 0A │ LF │ Move down a line ║
║ ^K │ 0B │ HOME │ Setting marker to the beginning of the screen ║
║ ^L │ 0C │ FF │ Clearing the screen ║
║ ^M │ 0D │ CR │ Return to the beginning of the line ║
║ ^N │ 0E │ STO0 │ Switch to the Russian alphabet for output ║
║ ^O │ 0F │ STO1 │ Switch to the Latin alphabet for output ║
║ ^V │ 16 │ CLSTR │ Clear the line from the current position ║
║ │ │ │ marker to the right edge of the screen ║
║ ^X │ 18 │ CVP │ Marker for position to the right ║
║ ^Y │ 19 │ CVV │ Marker for position up ║
║ ^Z │ 1A │ CVN │ Marker for position down ║
║ ^[ │ 1B │ ESC │ First character of multibyte control ║
║ │ │ │ sequences ║
╚══════╧════╧═══════╧═════════ ══════════════════════════════╧ CONTROL SEQUENCES (forESC)
╔════І═════І══════════════════ ═══════════════════════════════╗
║ │ code │ ║
║sim.│(HEX)│ description ║
╠════╪═════╪═══════════════════ ══════════════════════════════╣
║ @ │ 40 │ Switch to the Russian alphabet for display ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ A │ 41 │ Position marker up ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ B │ 42 │ Position marker down ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ C │ 43 │ Position marker right ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ D │ 44 │ Position marker left ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ E │ 45 │ Console reset. Performs settings: ║
║ │ │ - erasing from the screen; ║
║ │ │ - coordinates of the current position 0,0 ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ H │ 48 │ Place the marker at the beginning of the screen ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ J │ 4A │ Clearing the screen from the current marker position ║
║ ││ to the end of the screen ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ K │ 4B │ Clear the line from the current marker position ║
║ │ │ to the end of the line ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ L │ 4C │ Insert a blank line above the marker ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ M │ 4D │ Delete the line containing the marker ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ P │ 50 │ Screen color control, D0-D2 of the next ║
║ │ │ byte - color (see table below) ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ V │ 56 │ Inverse or direct output of characters, D0 of the next byte determines the presence of inversion ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ Y │ 59 │ Direct marker positioning. The next ║
║ │ │ byte is position Y+20h, then X+20h. ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ Z │ 5A │ Switch to the Latin alphabet for display ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ [ │ 5B │ Return to ALT encoding║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ \ │ 5C │ Setting the KOI-7 code for display ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ ] │ 5D │ Setting the KOI-8 code for display ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ j │ 6A │ Fast line output. The length of the line is located at ║
║ │ │ address 80h, the line itself is located at address ║
║ │ │ 81h. There are no checks for control characters, and the cursor position does not change. ║
╟────┼─────┼─────────────────── ──────────────────────────────Є
║ │ 7F │ Causes byte inversion at address 80h and reset of bytes at addresses 81h and 82h. Byte inversion ║
║ │ │ at address 80h indicates the presence of fast line output (ESC+'j') ║
╚════╧═════╧══════════════════ ══════════════════════════════╧ Combinations colors:
╔═════════І══════════І══════
║ D0 │ D1 │ D2 │ ║
╠═════════╪══════════╪═════════ ╪═════════════════════════════╣
║ 0 │ 0 │ 0 │ black on white ║
║ 1 │ 0 │ 0 │ blue on yellow ║
║ 0 │ 1 │ 0 │ red onblue ║
║ 1 │ 1 │ 0 │ lilac on green ║
║ 0 │ 0 │ 1 │ green on lilac ║
║ 1 │ 0 │ 1 │ blue on red ║
║ 0 │ 1 │ 1 │ yellow on blue ║
║ 1 │ 1 │ 1 │ white on black ║
╚═════════╧══════════╧════════ ═╧════════════════════════════╧ Additionally, there are 4 combinations of “hot keys”
(hot keys), which can only be entered from the keyboard (if
interrupts are allowed):
^2 - Caps Lock - Turn on/off the mode
fixing capital letters;
^SS (Extended) - RUS/LAT - Switch input of Russian or
Latin letters;
^Enter - NOCONTROL - Cancel/enable processing
of control characters;
^Space (BREAK) - Status Line - Show console status in the top line
.
When canceling processing of control characters, all codes
transmitted to the console are immediately displayed on the screen without
checking for their meaning. This continues until the next
^Enter is entered. This feature was introduced in order to determine
visually what control codes the operating system uses.currently the program.
The presence of several operating modes of the console required
the creation of means for visually determining the current mode.
The Status Line is used for this. When you press ^Space (BREAK)
the top line of the screen is saved in the buffer, and in its place
the console status is displayed. For input (CONIN), the presence or absence of Caps Lock and the input alphabet (RUS/LAT) are fixed.
For output (CONOUT), the current encoding is fixed (Alternative, KOI8, KOI7, RUS) and the presence or absence of control code processing (CONTROLS / NOCONTROLS).
When the Status Line is displayed, interruptions are disabled and
the system waits for any key to be pressed (accessing the
keyboard ports). Thus, pressing ^Space (BREAK) can
be used to pause the program (pause). After
any key is pressed on the keyboard,
the first line of the screen is restored,
interrupts are resolved and the suspended program continues its
work.
It should be noted once again that the internal encoding
CP/M BIOS is alternative, and all input is carried out in this
encoding. However, for display on the screen, the user can
select one of 4 encodings using control codes -
ALT, KOI8, KOI7, KOI7SI/SO. Thus, you can enter text from the keyboard only in alternative encoding
and print it on the screen in any of the 4 encodings.
Michael Markowsky (C) 1992,1993.