
3. CREATING A C PROGRAM
B–61863E–1/06
APPLICATION
PROGRAMMING GUIDE
400
CAUTION
4 See Appendix B for information on stack usage by standard
functions.
5 Screen control codes (see Section 3.2.1) and escape sequences
(see Section 3.2.2) can be used when using I/O function printf to
display characters on the CRT display.
ASCII control codes
ASCII name Code Function
BS 08H Moves the cursor one column to the left.
LF 0AH Moves the cursor one line down.
VT 0BH Moves the cursor one line up.
FF 0CH Moves the cursor one column to the right.
CR 0DH Moves the cursor to the beginning of the current line.
SUB 1AH Clears the CRT display and moves the cursor to the
top-left corner of the screen (HOME position).
ESC 1BH See Section 3.2.2 Escape sequences.
RS 1EH Moves the cursor to the top-left corner of the screen
(HOME position).
Pc, Pl, Pn, and Ps are decimal parameters. All other symbols and
characters are as shown.
Escape sequence Function
ESC[P1;PcH
ESC[P1;Pcf
Moves the cursor to line Pl, column Pc.
Note) Coordinates are specified from an origin of 0.
ESC=P1Pc Moves the cursor to line Pl, column Pc.
Note) Pl and Pc are specified with a character code calculated by
adding 1FH to the coordinates. Coordinates are specified
from an origin of 1.
ESC[PnA Moves the cursor up Pn lines in the current column.
ESC[PnB Moves the cursor down Pn lines in the current column.
ESC[PnC Moves the cursor Pn columns to the right in the current line.
ESC[PnD Moves the cursor Pn columns to the left in the current line.
ESC[0J Clears the area from the cursor to the end of the last line The cursor
remains in its current position.
ESC[1J Clears the area from the top-left corner (HOME position) to the cur-
sor. The cursor remains in its current position.
ESC[2J
ESC*
Clears the CRT display and moves the cursor to the top-left corner
of the screen (HOME position).
ESC[0K Clears the area from the cursor to the end of the current line. The
cursor remains in its current position.
ESC[1K Clears the area from the beginning of the current line to the cursor.
The cursor remains in its current position.
ESC[2K Clears the entire current line of the cursor. The cursor remains in
its current position.
ESC D Moves the cursor one line down in the current column.
ESC E Moves the cursor to the beginning of the next line.
ESC M Moves the cursor up one line in the current column.
3.2.1
Screen Control Codes
3.2.2
Escape Sequences