SECTION 13

[continue/next section] [MAIN/Introduction] [table of contents]

13. Using the Console and Printer in CP/M 3.0


TABLE OF CONTENTS

13.1 CONTROLLING CONSOLE OUTPUT

13.2 CONTROLLING PRINTER OUTPUT

13.3 CONSOLE LINE EDITING

13.4 USING CONTROL CHARACTERS FOR LINE EDITING

Table 13-1. Banked CP/M 3.0 Line Editing Control Characters.

This section describes how CP/M 3.0 communicates with your console and printer. It tells how to start and stop console and printer output, and edit commands you enter at your console.

13.1 CONTROLLING CONSOLE OUTPUT

Sometimes CP/M 3.0 displays information on your screen too quickly for you to read it. To ask the system to wait while you read the display, hold down the {ctrl} key and press {s}. A CTRL-S keystroke sequence causes the display to pause. When you are ready, press CTRL-Q to resume the display.

Pressing the {no scroll} key will also pause the system and place a pause window on the status line at the bottom of the screen (line 25). To resume the display, press {no scroll} again. If you press any key besides CTRL-Q or {no scroll} during a display pause, CP/M 3.0 sounds the console bell.

Some CP/M 3.0 utilities (like DIR and TYPE) support automatic paging at the console. This means that if the program's output is longer than the screen can display at one time, the display automatically halts when the screen is filled. When this occurs, CP/M 3.0 prompts you to press {return} to continue. This option can be turned on or off using the SETDEF command.

13.2 CONTROLLING PRINTER OUTPUT

You can also use a control command to echo (that is, display) console output to the printer. To start printer echo, press CTRL-P. A beep occurs to tell you that echo is on. To stop, press CTRL-P again. (There is no beep at this point.) While echo is in effect, any characters that appear on your screen are listed at your printer.

You can use printer echo with a DIR command to make a list of files stored on a floppy disk. You can also use CTRL-P with CRTL-S and CTRL-Q to make a hard copy of part of a file. Use a TYPE command to start a display of the file at the console. When the display reaches the part you need to print, press CTRL-S to stop the display, CTRL-P to enable printer echo, and then CTRL-Q to resume the display and start printing. You can use another CTRL-S, CTRL-P, CTRL-Q sequence to terminate printer echo.

13.3 CONSOLE LINE EDITING

As noted previously, you can correct simple typing errors by using the {inst/del} key or CTRL-H. CP/M 3.0 also supports additional line editing functions that you perform with control characters. You can use the control characters to edit command lines or input lines to most programs.

13.4 USING CONTROL CHARACTERS FOR LINE EDITING

Using the line editing control characters listed in Table 13-1, you can move the cursor left and right to insert and delete characters in the middle of a command line. In this way you do not have to retype everything to the right of your correction.

In the following example, the user mistypes PIP, and CP/M 3.0 returns an error message. The user recalls the erroneous command line by pressing CTRL-W and corrects the error.

A>POP A:=B:*.*  (PIP mistyped)
POP?

A>POP A:=B:*.*  (CTRL-W recalls the line)

A>POP A:=B:*.*  (CTRL-B moves the cursor to beginning of line)

A>POP A:=B:*.*  (CTRL-F moves cursor to right)

A>PP A:=B:*.*   (CTRL-G deletes error)

A>PIP A:=B:*.*  (type I corrects the command name)

After the command line is corrected, the user can press {return} even though the cursor is in the middle of the line. A {return} keystroke, (or one of the equivalent control characters) not only executes the command, but also stores the command in a buffer so that you can press CTRL-W to recall it for editing or re-execution.

When you insert a character in the middle of a line, characters to the right of the cursor move to the right. If the line becomes longer than your screen is wide, characters disappear off the right side of the screen. These characters are not lost. They reappear if you delete characters from the line or if you press CTRL-E when the cursor is in the middle of the line. CTRL-E moves all characters to the right of the cursor to the next line on the screen.

Table 13-1 gives a complete list of line editing control characters for the CP/M 3.0 system on the Commodore 128.

Table 13-1. Banked CP/M 3.0 Line Editing Control Characters.

Character

Meaning

CTRL-A

Moves the cursor one character to the left.

CTRL-B

Moves the cursor to the beginning of the command line without having any effect on the contents of the line. If the cursor is at the beginning, CTRL-B moves it to the end of the line.

CTRL-E

Forces a physical carriage return but does not send the command line to CP/M 3.0. Moves the cursor to the beginning of the next line without erasing the previous input.

CTRL-F

Moves the cursor one character to the right.

CTRL-G

Deletes the character above the cursor. The cursor does not move. Characters to the right of the cursor move left one position.

CTRL-H

Deletes the character to the left of the cursor and moves the cursor left one character position. Characters to the right of the cursor move left one position.

CTRL-I

Moves the cursor to the next tab stop. Tab stops are automatically set at each eighth column. Has the same effect as pressing the {tab} key.

CTRL-J

Sends the command line to CP/M 3.0 and returns the cursor to the beginning of a new line. Has the same effect as a {return} or a CTRL-M keystroke.

CTRL-K

Deletes from the cursor to the end of the line.

CTRL-M

Sends the command line to CP/M 3.0 and returns the cursor to the beginning of a new line. Has the same effect as a {return} or a CTRL-J keystroke.

CTRL-R

Retypes the command line. Place a # character at the current cursor location, moves the cursor to the next line, and retypes any partial command you typed so far.

CTRL-U

Discards all the characters in the command line, places a {#} character at the current cursor position, and moves the cursor to the next line. However, you can use CTRL-W to recall any characters that were to the left of the cursor when you pressed CTRL-U.

CTRL-W

Recalls and displays previously entered command line both at the operating system level and within executing programs, if the CTRL-W is the first character entered after the prompt. CTRL-J, CTRL-M, CTRL-U, and {return} define the command line you can recall. If the command line contains characters, CTRL-W moves the cursor to the end of the command line. If you press {return}, CP/M 3.0 executes the recalled command.

CTRL-X

Discards all the characters to the left of the cursor and moves the cursor to the beginning of the current line. CTRL-X saves any characters to the right of the cursor.

[top of document]

page URL: www.bigfoot.com/~c128page/c128sg/sect-13.htm
contact: c128page@bigfoot.com