E VT320 Programming Summary

This appendix is a summary of the control functions and commands described in the VT320 Programmer Reference Manual. If you are a programmer, you can use this appendix as a quick-reference tool to program the VT320.

The appendix is divided into sections that correspond to the chapters of the programmer reference manual. For example, to find out more about 2 Character Encoding, you would go to Chapter 2 of the programmer reference manual.

2 Character Encoding

Character Sets and Codes

Computer systems store characters as a series of bits, usually 7 bits or 8 bits long. A bit is a binary digit. The VT320 can work with 7-bit or 8-bit systems. The VT320 provides the following character sets.

An 8-bit system can use any of these character sets. A 7-bit system can use any set except the supplemental graphic sets.

Each character set has two types of characters, graphic characters and control characters. Graphic characters are the characters you can display on the screen. Control characters make the terminal perform a special function. See "Control Functions" in this appendix.

A code table is a convenient way of showing all the characters in a character set with their codes. Characters appear in rows and columns. One way of finding a character in a character set is by its column/row position. For example, in the ASCII character set the character H is at 4/8 (column 4, row 8).

Each character in a row uses the same binary code for its four least significant bits. This value appears at the left or right of each row. Each character in a column uses the same binary code for its three (or four) most significant bits. This value appears at the top of each column.

Next to each character appears the octal, decimal, and hexadecimal code for the character. Different programmers may prefer using octal, decimal, or hexadecimal values for different purposes.

DEC Multinational Character Set

Left Half -- ASCII Set
ROW COLUMN 0 1 2 3 4 5 6 7
b8 BITS
b7
b6
b5
b4 b3 b2 b1
0  
  0
  0  
  0
 
0  
  0
  0  
  1
 
0  
  0
  1  
  0
 
0  
  0
  1  
  1
 
0  
  1
  0  
  0
 
0  
  1
  0  
  1
 
0  
  1
  1  
  0
 
0  
  1
  1  
  1
 
0
0 0 0 0
NUL 0
0
0
DLE 20
16
10
SP 40
32
20
0 60
48
30
@ 100
64
40
P 120
80
50
` 140
96
60
p 160
112
70
1
0 0 0 1
SOH 1
1
1
DC1
(XON)
21
17
11
! 41
33
21
1 61
49
31
A 101
65
41
Q 121
81
51
a 141
97
61
q 161
113
71
2
0 0 1 0
STX 2
2
2
DC2 22
18
12
" 42
34
22
2 62
50
32
B 102
66
42
R 122
82
52
b 142
98
62
r 162
114
72
3
0 0 1 1
ETX 3
3
3
DC3
(XOFF)
23
19
13
# 43
35
23
3 63
51
33
C 103
67
43
S 123
83
53
c 143
99
63
s 163
115
73
4
0 1 0 0
EOT 4
4
4
DC4 24
20
14
$ 44
36
24
4 64
52
34
D 104
68
44
T 124
84
54
d 144
100
64
t 164
116
74
5
0 1 0 1
ENQ 5
5
5
NAK 25
21
15
% 45
37
25
5 65
53
35
E 105
69
45
U 125
85
55
e 145
101
65
u 165
117
75
6
0 1 1 0
ACK 6
6
6
SYN 26
22
16
& 46
38
26
6 66
54
36
F 106
70
46
V 126
86
56
f 146
102
66
v 166
118
76
7
0 1 1 1
BEL 7
7
7
ETB 27
23
17
' 47
39
27
7 67
55
37
G 107
71
47
W 127
87
57
g 147
103
67
w 167
119
77
8
1 0 0 0
BS 10
8
8
CAN 30
24
18
( 50
40
28
8 70
56
38
H 110
72
48
X 130
88
58
h 150
104
68
x 170
120
78
9
1 0 0 1
HT 11
9
9
EM 31
25
19
) 51
41
29
9 71
57
39
I 111
73
49
Y 131
89
59
i 151
105
69
y 171
121
79
10
1 0 1 0
LF 12
10
A
SUB 32
26
1A
* 52
42
2A
: 72
58
3A
J 112
74
4A
Z 132
90
5A
j 152
106
6A
z 172
122
7A
11
1 0 1 1
VT 13
11
B
ESC 33
27
1B
+ 53
43
2B
; 73
59
3B
K 113
75
4B
[ 133
91
5B
k 153
107
6B
{ 173
123
7B
12
1 1 0 0
FF 14
12
C
FS 34
28
1C
, 54
44
2C
< 74
60
3C
L 114
76
4C
\ 134
92
5C
l 154
108
6C
| 174
124
7C
13
1 1 0 1
CR 15
13
D
GS 35
29
1D
- 55
45
2D
= 75
61
3D
M 115
77
4D
] 135
93
5D
m 155
109
6D
} 175
125
7D
14
1 1 1 0
SO 16
14
E
RS 36
30
1E
. 56
46
2E
> 76
62
3E
N 116
78
4E
^ 136
94
5E
n 156
110
6E
~ 176
126
7E
15
1 1 1 1
SI 17
15
F
US 37
31
1F
/ 57
47
2F
? 77
63
3F
O 117
79
4F
_ 137
95
5F
o 157
111
6F
DEL 177
127
7F
  C0 CODES GL CODES
(ASCII GRAPHICS)
KEY  
CHARACTER 
ESC 33
27
1B
 OCTAL
 DECIMAL
 HEX
Right Half -- DEC Supplemental Graphic Set
8 9 10 11 12 13 14 15 COLUMN ROW
1  
  0
  0  
  0
 
1  
  0
  0  
  1
 
1  
  0
  1  
  0
 
1  
  0
  1  
  1
 
1  
  1
  0  
  0
 
1  
  1
  0  
  1
 
1  
  1
  1  
  0
 
1  
  1
  1  
  1
 
b8 BITS
b7
b6
b5
b4 b3 b2 b1
  200
128
80
DCS 220
144
90
(undef) 240
160
A0
° 260
176
B0
À 300
192
C0
  320
208
D0
à 340
224
E0
  360
240
F0
0 0 0 0
0
  201
129
81
PU1 221
145
91
¡ 241
161
A1
± 261
177
B1
Á 301
193
C1
Ñ 321
209
D1
á 341
225
E1
ñ 361
241
F1
0 0 0 1
1
  202
130
82
PU2 222
146
92
¢ 242
162
A2
² 262
178
B2
 302
194
C2
Ò 322
210
D2
â 342
226
E2
ò 362
242
F2
0 0 1 0
2
  203
131
83
STS 223
147
93
£ 243
163
A3
³ 263
179
B3
à 303
195
C3
Ó 323
211
D3
ã 343
227
E3
ó 363
243
F3
0 0 1 1
3
IND 204
132
84
CCH 224
148
94
  244
164
A4
  264
180
B4
Ä 304
196
C4
Ô 324
212
D4
ä 344
228
E4
ô 364
244
F4
0 1 0 0
4
NEL 205
133
85
MW 225
149
95
¥ 245
165
A5
µ 265
181
B5
Å 305
197
C5
Õ 325
213
D5
å 345
229
E5
õ 365
245
F5
0 1 0 1
5
SSA 206
134
86
SPA 226
150
96
  246
166
A6
266
182
B6
Æ 306
198
C6
Ö 326
214
D6
æ 346
230
E6
ö 366
246
F6
0 1 1 0
6
ESA 207
135
87
EPA 227
151
97
§ 247
167
A7
· 267
183
B7
Ç 307
199
C7
Π327
215
D7
ç 347
231
E7
œ 367
247
F7
0 1 1 1
7
HTS 210
136
88
  230
152
98
¤ 250
168
A8
  270
184
B8
È 310
200
C8
Ø 330
216
D8
è 350
232
E8
ø 370
248
F8
1 0 0 0
8
HTJ 211
137
89
  231
153
99
© 251
169
A9
¹ 271
185
B9
É 311
201
C9
Ù 331
217
D9
é 351
233
E9
ù 371
249
F9
1 0 0 1
9
VTS 212
138
8A
  232
154
9A
ª 252
170
AA
º 272
186
BA
Ê 312
202
CA
Ú 332
218
DA
ê 352
234
EA
ú 372
250
FA
1 0 1 0
10
PLD 213
139
8B
CSI 233
155
9B
« 253
171
AB
» 273
187
BB
Ë 313
203
CB
Û 333
219
DB
ë 353
235
EB
û 373
251
FB
1 0 1 1
11
PLU 214
140
8C
ST 234
156
9C
  254
172
AC
¼ 274
188
BC
Ì 314
204
CC
Ü 334
220
DC
ì 354
236
EC
ü 374
252
FC
1 1 0 0
12
RI 215
141
8D
OSC 235
157
9D
  255
173
AD
½ 275
189
BD
Í 315
205
CD
Ÿ 335
221
DD
í 355
237
ED
ÿ 375
253
FD
1 1 0 1
13
SS2 216
142
8E
PM 236
158
9E
  256
174
AE
  276
190
BE
Î 316
206
CE
  336
222
DE
î 356
238
EE
  376
254
FE
1 1 1 0
14
SS3 217
143
8F
APC 237
159
9F
  257
175
AF
¿ 277
191
BF
Ï 317
207
CF
ß 337
223
DF
ï 357
239
EF
(undef) 377
255
FF
1 1 1 1
15
  C1 CODES GR CODES
(DEC SUPPLEMENTAL GRAPHICS)

National Replacement Character Sets (NRCs)

This table shows the characters in each NRC set that differ from the ASCII set.

National Replacement Character Sets
Character Set 2/3 4/0 5/11 5/12 5/13 5/14 5/15 6/0 7/11 7/12 7/13 7/14
ASCII # @ [ \ ] ^ _ ` { | } ~
United Kingdom £ @ [ \ ] ^ _ ` { | } ~
Dutch £ ¾ ÿ ½ | ^ _ ` ¨ f ¼ '
Finnish # @ Ä Ö Å Ü _ é ä ö å ü
French £ à ° ç § ^ _ ` é ù è ¨
French Canadian # à â ç ê î _ ô é ù è û
German # § Ä Ö Ü ^ _ ` ä ö ¨ ß
Italian £ § ° ç é ^ _ ù à ò è ì
Norwegian/ Danish # @ Æ Ø Å ^ _ ` æ ø å ~
Portuguese # @ Ã Ç Õ ^ _ ` ã ç õ ~
Spanish £ § ¡ Ñ ¿ ^ _ ` ` ° ñ ç
Swedish # É Ä Ö Å Ü _ é ä ö å ü
Swiss ù à é ç ê î è ô ä ö ü û

ISO Latin Alphabet Nr 1 Supplemental Set

This is the right half of the ISO Latin-1 multinational character set. The left half is the ASCII character set.

8 9 10 11 12 13 14 15 COLUMN ROW
1  
  0
  0  
  0
 
1  
  0
  0  
  1
 
1  
  0
  1  
  0
 
1  
  0
  1  
  1
 
1  
  1
  0  
  0
 
1  
  1
  0  
  1
 
1  
  1
  1  
  0
 
1  
  1
  1  
  1
 
b8 BITS
b7
b6
b5
b4 b3 b2 b1
  200
128
80
DCS 220
144
90
NBSP 240
160
A0
° 260
176
B0
À 300
192
C0
Ð 320
208
D0
à 340
224
E0
ð 360
240
F0
0 0 0 0
0
  201
129
81
PU1 221
145
91
¡ 241
161
A1
± 261
177
B1
Á 301
193
C1
Ñ 321
209
D1
á 341
225
E1
ñ 361
241
F1
0 0 0 1
1
  202
130
82
PU2 222
146
92
¢ 242
162
A2
² 262
178
B2
 302
194
C2
Ò 322
210
D2
â 342
226
E2
ò 362
242
F2
0 0 1 0
2
  203
131
83
STS 223
147
93
£ 243
163
A3
³ 263
179
B3
à 303
195
C3
Ó 323
211
D3
ã 343
227
E3
ó 363
243
F3
0 0 1 1
3
IND 204
132
84
CCH 224
148
94
¤ 244
164
A4
´ 264
180
B4
Ä 304
196
C4
Ô 324
212
D4
ä 344
228
E4
ô 364
244
F4
0 1 0 0
4
NEL 205
133
85
MW 225
149
95
¥ 245
165
A5
µ 265
181
B5
Å 305
197
C5
Õ 325
213
D5
å 345
229
E5
õ 365
245
F5
0 1 0 1
5
SSA 206
134
86
SPA 226
150
96
¦ 246
166
A6
266
182
B6
Æ 306
198
C6
Ö 326
214
D6
æ 346
230
E6
ö 366
246
F6
0 1 1 0
6
ESA 207
135
87
EPA 227
151
97
§ 247
167
A7
· 267
183
B7
Ç 307
199
C7
× 327
215
D7
ç 347
231
E7
÷ 367
247
F7
0 1 1 1
7
HTS 210
136
88
  230
152
98
¨ 250
168
A8
¸ 270
184
B8
È 310
200
C8
Ø 330
216
D8
è 350
232
E8
ø 370
248
F8
1 0 0 0
8
HTJ 211
137
89
  231
153
99
© 251
169
A9
¹ 271
185
B9
É 311
201
C9
Ù 331
217
D9
é 351
233
E9
ù 371
249
F9
1 0 0 1
9
VTS 212
138
8A
  232
154
9A
ª 252
170
AA
º 272
186
BA
Ê 312
202
CA
Ú 332
218
DA
ê 352
234
EA
ú 372
250
FA
1 0 1 0
10
PLD 213
139
8B
CSI 233
155
9B
« 253
171
AB
» 273
187
BB
Ë 313
203
CB
Û 333
219
DB
ë 353
235
EB
û 373
251
FB
1 0 1 1
11
PLU 214
140
8C
ST 234
156
9C
¬ 254
172
AC
¼ 274
188
BC
Ì 314
204
CC
Ü 334
220
DC
ì 354
236
EC
ü 374
252
FC
1 1 0 0
12
RI 215
141
8D
OSC 235
157
9D
- 255
173
AD
½ 275
189
BD
Í 315
205
CD
Ý 335
221
DD
í 355
237
ED
ý 375
253
FD
1 1 0 1
13
SS2 216
142
8E
PM 236
158
9E
® 256
174
AE
¾ 276
190
BE
Î 316
206
CE
Þ 336
222
DE
î 356
238
EE
þ 376
254
FE
1 1 1 0
14
SS3 217
143
8F
APC 237
159
9F
¯ 257
175
AF
¿ 277
191
BF
Ï 317
207
CF
ß 337
223
DF
ï 357
239
EF
ÿ 377
255
FF
1 1 1 1
15
C1 CODES GR CODES
(ISO LATIN-1 SUPPLEMENTAL GRAPHIC)
 

DEC Special Graphic Character Set

ROW COLUMN 0 1 2 3 4 5 6 7
b8 BITS
b7
b6
b5
b4 b3 b2 b1
0  
  0
  0  
  0
 
0  
  0
  0  
  1
 
0  
  0
  1  
  0
 
0  
  0
  1  
  1
 
0  
  1
  0  
  0
 
0  
  1
  0  
  1
 
0  
  1
  1  
  0
 
0  
  1
  1  
  1
 
0
0 0 0 0
NUL 0
0
0
DLE 20
16
10
SP 40
32
20
0 60
48
30
@ 100
64
40
P 120
80
50
140
96
60

SCAN 3
160
112
70
1
0 0 0 1
SOH 1
1
1
DC1
(XON)
21
17
11
! 41
33
21
1 61
49
31
A 101
65
41
Q 121
81
51
141
97
61

SCAN 5
161
113
71
2
0 0 1 0
STX 2
2
2
DC2 22
18
12
" 42
34
22
2 62
50
32
B 102
66
42
R 122
82
52
HT 142
98
62

SCAN 7
162
114
72
3
0 0 1 1
ETX 3
3
3
DC3
(XOFF)
23
19
13
# 43
35
23
3 63
51
33
C 103
67
43
S 123
83
53
FF 143
99
63

SCAN 9
163
115
73
4
0 1 0 0
EOT 4
4
4
DC4 24
20
14
$ 44
36
24
4 64
52
34
D 104
68
44
T 124
84
54
CR 144
100
64
164
116
74
5
0 1 0 1
ENQ 5
5
5
NAK 25
21
15
% 45
37
25
5 65
53
35
E 105
69
45
U 125
85
55
LF 145
101
65
165
117
75
6
0 1 1 0
ACK 6
6
6
SYN 26
22
16
& 46
38
26
6 66
54
36
F 106
70
46
V 126
86
56
° 146
102
66
166
118
76
7
0 1 1 1
BEL 7
7
7
ETB 27
23
17
' 47
39
27
7 67
55
37
G 107
71
47
W 127
87
57
± 147
103
67
167
119
77
8
1 0 0 0
BS 10
8
8
CAN 30
24
18
( 50
40
28
8 70
56
38
H 110
72
48
X 130
88
58
NL 150
104
68
170
120
78
9
1 0 0 1
HT 11
9
9
EM 31
25
19
) 51
41
29
9 71
57
39
I 111
73
49
Y 131
89
59
VT 151
105
69
171
121
79
10
1 0 1 0
LF 12
10
A
SUB 32
26
1A
* 52
42
2A
: 72
58
3A
J 112
74
4A
Z 132
90
5A
152
106
6A
172
122
7A
11
1 0 1 1
VT 13
11
B
ESC 33
27
1B
+ 53
43
2B
; 73
59
3B
K 113
75
4B
[ 133
91
5B
153
107
6B
173
123
7B
12
1 1 0 0
FF 14
12
C
FS 34
28
1C
, 54
44
2C
< 74
60
3C
L 114
76
4C
\ 134
92
5C
154
108
6C
174
124
7C
13
1 1 0 1
CR 15
13
D
GS 35
29
1D
- 55
45
2D
= 75
61
3D
M 115
77
4D
] 135
93
5D
155
109
6D
£ 175
125
7D
14
1 1 1 0
SO 16
14
E
RS 36
30
1E
. 56
46
2E
> 76
62
3E
N 116
78
4E
^ 136
94
5E
156
110
6E
· 176
126
7E
15
1 1 1 1
SI 17
15
F
US 37
31
1F
/ 57
47
2F
? 77
63
3F
O 117
79
4F
(blank) 137
95
5F

SCAN 1
157
111
6F
DEL 177
127
7F
  C0 CODES GL CODES
(DEC SPECIAL GRAPHICS)
KEY  
CHARACTER 
ESC 33
27
1B
 OCTAL
 DECIMAL
 HEX

Display Controls Font

You can have the terminal display the characters in your control functions, rather than performing the function. This is useful for debugging programs. To display control characters, you use the Controls feature in the Display Set-Up screen (Chapter 4).

Display Controls Font (Left Half)
ROW COLUMN 0 1 2 3 4 5 6 7
b8 BITS
b7
b6
b5
b4 b3 b2 b1
0  
  0
  0  
  0
 
0  
  0
  0  
  1
 
0  
  0
  1  
  0
 
0  
  0
  1  
  1
 
0  
  1
  0  
  0
 
0  
  1
  0  
  1
 
0  
  1
  1  
  0
 
0  
  1
  1  
  1
 
0
0 0 0 0
NU 0
0
0
DL 20
16
10
  40
32
20
0 60
48
30
@ 100
64
40
P 120
80
50
` 140
96
60
p 160
112
70
1
0 0 0 1
SH 1
1
1
D1 21
17
11
! 41
33
21
1 61
49
31
A 101
65
41
Q 121
81
51
a 141
97
61
q 161
113
71
2
0 0 1 0
SX 2
2
2
D2 22
18
12
" 42
34
22
2 62
50
32
B 102
66
42
R 122
82
52
b 142
98
62
r 162
114
72
3
0 0 1 1
EX 3
3
3
D3 23
19
13
# 43
35
23
3 63
51
33
C 103
67
43
S 123
83
53
c 143
99
63
s 163
115
73
4
0 1 0 0
ET 4
4
4
D4 24
20
14
$ 44
36
24
4 64
52
34
D 104
68
44
T 124
84
54
d 144
100
64
t 164
116
74
5
0 1 0 1
EQ 5
5
5
NK 25
21
15
% 45
37
25
5 65
53
35
E 105
69
45
U 125
85
55
e 145
101
65
u 165
117
75
6
0 1 1 0
AK 6
6
6
SY 26
22
16
& 46
38
26
6 66
54
36
F 106
70
46
V 126
86
56
f 146
102
66
v 166
118
76
7
0 1 1 1
BL 7
7
7
EB 27
23
17
' 47
39
27
7 67
55
37
G 107
71
47
W 127
87
57
g 147
103
67
w 167
119
77
8
1 0 0 0
BS 10
8
8
CN 30
24
18
( 50
40
28
8 70
56
38
H 110
72
48
X 130
88
58
h 150
104
68
x 170
120
78
9
1 0 0 1
HT 11
9
9
EM 31
25
19
) 51
41
29
9 71
57
39
I 111
73
49
Y 131
89
59
i 151
105
69
y 171
121
79
10
1 0 1 0
LF 12
10
A
reverse question mark 32
26
1A
* 52
42
2A
: 72
58
3A
J 112
74
4A
Z 132
90
5A
j 152
106
6A
z 172
122
7A
11
1 0 1 1
VT 13
11
B
EC 33
27
1B
+ 53
43
2B
; 73
59
3B
K 113
75
4B
[ 133
91
5B
k 153
107
6B
{ 173
123
7B
12
1 1 0 0
FF 14
12
C
FS 34
28
1C
, 54
44
2C
< 74
60
3C
L 114
76
4C
\ 134
92
5C
l 154
108
6C
| 174
124
7C
13
1 1 0 1
CR 15
13
D
GS 35
29
1D
- 55
45
2D
= 75
61
3D
M 115
77
4D
] 135
93
5D
m 155
109
6D
} 175
125
7D
14
1 1 1 0
SO 16
14
E
RS 36
30
1E
. 56
46
2E
> 76
62
3E
N 116
78
4E
^ 136
94
5E
n 156
110
6E
~ 176
126
7E
15
1 1 1 1
SI 17
15
F
US 37
31
1F
/ 57
47
2F
? 77
63
3F
O 117
79
4F
_ 137
95
5F
o 157
111
6F
DT 177
127
7F
  C0 CODES GL CODES
(ASCII GRAPHICS)
KEY  
CHARACTER 
ESC 33
27
1B
 OCTAL
 DECIMAL
 HEX
Display Controls Font (Right Half)
8 9 10 11 12 13 14 15 COLUMN ROW
1  
  0
  0  
  0
 
1  
  0
  0  
  1
 
1  
  0
  1  
  0
 
1  
  0
  1  
  1
 
1  
  1
  0  
  0
 
1  
  1
  0  
  1
 
1  
  1
  1  
  0
 
1  
  1
  1  
  1
 
b8 BITS
b7
b6
b5
b4 b3 b2 b1
80 200
128
80
DC 220
144
90
A0 240
160
A0
° 260
176
B0
À 300
192
C0
Ð 320
208
D0
à 340
224
E0
ð 360
240
F0
0 0 0 0
0
81 201
129
81
P1 221
145
91
¡ 241
161
A1
± 261
177
B1
Á 301
193
C1
Ñ 321
209
D1
á 341
225
E1
ñ 361
241
F1
0 0 0 1
1
82 202
130
82
P2 222
146
92
¢ 242
162
A2
² 262
178
B2
 302
194
C2
Ò 322
210
D2
â 342
226
E2
ò 362
242
F2
0 0 1 0
2
83 203
131
83
SE 223
147
93
£ 243
163
A3
³ 263
179
B3
à 303
195
C3
Ó 323
211
D3
ã 343
227
E3
ó 363
243
F3
0 0 1 1
3
IN 204
132
84
CC 224
148
94
¤ 244
164
A4
´ 264
180
B4
Ä 304
196
C4
Ô 324
212
D4
ä 344
228
E4
ô 364
244
F4
0 1 0 0
4
NL 205
133
85
MW 225
149
95
¥ 245
165
A5
µ 265
181
B5
Å 305
197
C5
Õ 325
213
D5
å 345
229
E5
õ 365
245
F5
0 1 0 1
5
SS 206
134
86
SP 226
150
96
¦ 246
166
A6
266
182
B6
Æ 306
198
C6
Ö 326
214
D6
æ 346
230
E6
ö 366
246
F6
0 1 1 0
6
ES 207
135
87
EP 227
151
97
§ 247
167
A7
· 267
183
B7
Ç 307
199
C7
× 327
215
D7
ç 347
231
E7
÷ 367
247
F7
0 1 1 1
7
HS 210
136
88
98 230
152
98
¨ 250
168
A8
¸ 270
184
B8
È 310
200
C8
Ø 330
216
D8
è 350
232
E8
ø 370
248
F8
1 0 0 0
8
HJ 211
137
89
99 231
153
99
© 251
169
A9
¹ 271
185
B9
É 311
201
C9
Ù 331
217
D9
é 351
233
E9
ù 371
249
F9
1 0 0 1
9
VS 212
138
8A
9A 232
154
9A
ª 252
170
AA
º 272
186
BA
Ê 312
202
CA
Ú 332
218
DA
ê 352
234
EA
ú 372
250
FA
1 0 1 0
10
PD 213
139
8B
CS 233
155
9B
« 253
171
AB
» 273
187
BB
Ë 313
203
CB
Û 333
219
DB
ë 353
235
EB
û 373
251
FB
1 0 1 1
11
PU 214
140
8C
ST 234
156
9C
¬ 254
172
AC
¼ 274
188
BC
Ì 314
204
CC
Ü 334
220
DC
ì 354
236
EC
ü 374
252
FC
1 1 0 0
12
RI 215
141
8D
OS 235
157
9D
- 255
173
AD
½ 275
189
BD
Í 315
205
CD
Ý 335
221
DD
í 355
237
ED
ý 375
253
FD
1 1 0 1
13
S2 216
142
8E
PM 236
158
9E
® 256
174
AE
¾ 276
190
BE
Î 316
206
CE
Þ 336
222
DE
î 356
238
EE
þ 376
254
FE
1 1 1 0
14
S3 217
143
8F
AP 237
159
9F
¯ 257
175
AF
¿ 277
191
BF
Ï 317
207
CF
ß 337
223
DF
ï 357
239
EF
ÿ 377
255
FF
1 1 1 1
15
C1 CODES GR CODES
(ISO LATIN-1 SUPPLEMENTAL GRAPHIC)
 

Control Functions

Programmers use control functions to make the VT320 perform a range of special actions, from the simple (moving the cursor) to the complex (emulating another terminal). The way you enter control functions in an application depends on two factors: your computing system and the programming language you use.

There are two types of control functions, single-character and multiple-character. Single-character functions, called control characters, perform simpler functions. There are two groups of control characters, C0 and C1. C0 characters appear in columns 0 and 1 of the code tables. C1 characters appear in columns 8 and 9. C1 characters are not available in 7-bit systems. The next section lists the function of each control character.

Control functions can perform more complex functions. There are three types of multiple-character control functions: escape sequences, control sequences, and device control strings. Each type begins with a certain control character.

Escape Sequences

An escape sequence begins with the C0 character ESC, followed by one or more graphic characters from the ASCII set. The ESC character tells the system that the graphic characters are part of a control function, not characters to be displayed. For example,

ESC # 6

is an escape sequence that changes the current line of text to double-width characters. Escape sequences use only 7-bit characters, and can be used in 7-bit or 8-bit systems.

Control Sequences

A control sequence begins with the C1 character CSI, followed by one or more ASCII graphic characters. You can also express CSI as two 7-bit characters, ESC [. So you can express control sequences as escape sequences. For example, the following two sequences perform the same function -- they change the display from 80 to 132 columns per line.

CSI ? 3 h

ESC [ ? 3 h

Whenever possible use CSI instead of ESC [ to introduce a control sequence. You can only use CSI in 8-bit systems.

Device Control Strings

A device control string begins with the C1 character DCS, followed by one or more ASCII graphic characters, a data string, and the C1 character ST (string terminator). For an example of a device control string, see "Down-Line-Loading a Soft Character Set" in this appendix.

For 7-bit systems, you can express DCS as ESC P. You can express ST as ESC \.

C0 (7-Bit) Control Characters Recognized

Name Mnemonic Function
Null NUL Ignored.
Enquiry ENQ Sends the answerback message.
Bell BEL Sounds the bell tone if the bell is enabled in set-up.
Backspace BS Moves the cursor one character position to the left. If the cursor is at the left margin, no action occurs.
Horizontal tab HT Moves the cursor to the next tab stop. If there are no more tab stops, the cursor moves to the right margin. HT does not cause text to auto wrap.
Line feed LF Causes a line feed or a new line operation, depending on the setting of line feed/new line mode.
Vertical tab VT Treated as LF.
Form feed FF Treated as LF.
Carriage return CR Moves the cursor to the left margin on the current line.
Shift out
(Locking shift 1)
SO (LS1) Maps the G1 character set into GL. You designate G1 by using a select character set (SCS) sequence. See the VT320 Programmer Reference Manual, Chapter 5.
Shift in
(Locking shift 0)
SI (LS0) Maps the G0 character set into GL. You designate G0 by using a select character set (SCS) sequence. See the VT320 Programmer Reference Manual, Chapter 5.
Device control 1
(XON)
DC1 Also known as XON. If XON/XOFF flow control is enabled in set-up, DC1 clears DC3 (XOFF). This action causes the VT320 to continue sending characters.
Device control 3
(XOFF)
DC3 Also known as XOFF. If XON/XOFF flow control is enabled in set-up, DC3 causes the VT320 to stop sending characters. The terminal cannot resume sending characters until it receives a DC1 control character.
Cancel CAN Immediately cancels an escape sequence or control sequence in progress. The VT320 does not display any error characters.
Substitute SUB Immediately cancels an escape sequence or control sequence in progress. The VT320 displays a reverse question mark for an error character.
Escape ESC Introduces an escape sequence. ESC also cancels any escape sequence or control sequence in progress.
Delete DEL Ignored when received. DEL is not used as a fill character. Digital does not recommend using DEL as a fill character. Use NUL instead.

C1 (8-Bit) Control Characters Recognized

Name Mnemonic Function
* The VT320 ignores all following characters, until it receives an ST control character. ESC, CAN, and SUB no longer cancel device control strings.
Index IND Moves the cursor down one line in the same column. If the cursor is at the bottom margin, data on the screen scrolls up.
Next line NEL Moves the cursor to the first position on the next line. If the cursor is at the bottom margin, data on the screen scrolls up.
Horizontal tab set HTS Sets a horizontal tab stop at the column where the cursor is.
Reverse index RI Moves the cursor up one line in the same column. If the cursor is at the top margin, data on the screen scrolls down.
Single shift 2 SS2 Temporarily maps the G2 character set into GL, for the next graphic character. You designate the G2 set by using a select character set (SCS) sequence. See the VT320 Programmer Reference Manual, Chapter 5.
Single shift 3 SS3 Temporarily maps the G3 character set into GL, for the next graphic character. You designate the G3 set by using a select character set (SCS) sequence. See the VT320 Programmer Reference Manual, Chapter 5.
Device control string DCS Introduces a device control string.
Control sequence introducer CSI Introduces a control sequence.
String terminator ST Ends a control string. You use ST in combination with DCS, APC, OSC, PM, or SOS control strings.
Operating system command OSC Introduces an operating system command.*
Privacy message PM Introduces a privacy message string.*
Application program command APC Introduces an application program command.*

8-Bit Control Characters and Their 7-Bit Equivalents

Name 8-Bit Character 7-Bit Sequence
Index IND ESC D
Next line NEL ESC E
Horizontal tab set HTS ESC H
Reverse index RI ESC M
Single shift 2 SS2 ESC N
Single shift 3 SS3 ESC O
Device control string DCS ESC P
Control sequence introducer CSI ESC [
String terminator ST ESC \
Operating system command OSC ESC ]
Privacy message PM ESC ^
Application program command APC ESC _

3 Keyboard Codes

Codes Sent by Editing Keys

Key Code Sent
VT300 Mode VT100, VT52 Modes
Find CSI 1 ~ The editing keys do not send codes in these two modes.
Insert Here CSI 2 ~
Remove CSI 3 ~
Select CSI 4 ~
Prev Screen CSI 5 ~
Next Screen CSI 6 ~

Codes Sent by Arrow Keys

Key Cursor Key Mode Setting (DECCKM)
ANSI Mode* VT52 Mode*
Cursor Application Cursor or Application
* ANSI mode applies to VT300 and VT100 modes. VT52 mode is not compatible with ANSI mode.
Up CSI A SS3 A ESC A
Down CSI B SS3 B ESC B
Right CSI C SS3 C ESC C
Left CSI D SS3 D ESC D

Codes Sent by Numeric Keypad Keys

Key ANSI Mode* VT52 Mode*
Numeric Application Numeric Application
* ANSI mode applies to VT300 and VT100 modes. VT52 mode is not compatible with ANSI standards.
† The last character in the sequence is a lowercase L.
‡ You cannot use these sequences on a VT52 terminal.
§ Keypad numeric mode. Enter sends the same codes as Return. You can use line feed/new line mode (LNM) to change the code sent by Return. When LNM is reset, pressing Return sends one control character (CR). When LNM is set, pressing Return sends two control characters (CR, LF).
0 0 SS3 p 0 ESC ? p
1 1 SS3 q 1 ESC ? q
2 2 SS3 r 2 ESC ? r
3 3 SS3 s 3 ESC ? s
4 4 SS3 t 4 ESC ? t
5 5 SS3 u 5 ESC ? u
6 6 SS3 v 6 ESC ? v
7 7 SS3 w 7 ESC ? w
8 8 SS3 x 8 ESC ? x
9 9 SS3 y 9 ESC ? y
- (minus) - SS3 m - ESC ? m
, (comma) , SS3 l , ESC ? l†‡
. (period) . SS3 n . ESC ? n
Enter CR or CR LF§ SS3 M CR or CR LF§ ESC ? M
PF1 SS3 P SS3 P ESC P ESC P
PF2 SS3 Q SS3 Q ESC Q ESC Q
PF3 SS3 R SS3 R ESC R ESC R
PF4 SS3 S SS3 S ESC S ESC S

Codes Sent by the Top-Row Function Keys

Name on Legend Strip Key Number Code Sent
VT300 Modes VT100, VT52 modes
* These keys do not send codes. They are local function keys.
Hold Screen (F1)* -- --
Print Screen (F2)* -- --
Set-Up (F3)* -- --
F4 (F4)* -- --
Break (F5)* -- --
F6 F6 CSI 1 7 ~ --
F7 F7 CSI 1 8 ~ --
F8 F8 CSI 1 9 ~ --
F9 F9 CSI 2 0 ~ --
F10 F10 CSI 2 1 ~ --
F11 (ESC) F11 CSI 2 3 ~ ESC
F12 (BS) F12 CSI 2 4 ~ BS
F13 (LF) F13 CSI 2 5 ~ LF
F14 F14 CSI 2 6 ~ --
Help F15 CSI 2 8 ~ --
Do F16 CSI 2 9 ~ --
F17 F17 CSI 3 1 ~ --
F18 F18 CSI 3 2 ~ --
F19 F19 CSI 3 3 ~ --
F20 F20 CSI 3 4 ~ --

Keys Used to Send 7-Bit Control Characters

Control Character Mnemonic Code Table Position Key Pressed With Ctrl (All Modes) Dedicated Function Key
* 7-bit control characters sent in VT100 and VT52 modes only.
† 7-bit control codes sent only when XON/XOFF support is off.
NUL 0/00 2 or space bar --
SOH 0/01 A --
STX 0/02 B --
ETX 0/03 C --
EOT 0/04 D --
ENQ 0/05 E --
ACK 0/06 F --
BEL 0/07 G --
BS 0/08 H F12 (BS)*
HT 0/09 I Tab
LF 0/10 J F13 (LF)*
VT 0/11 K --
FF 0/12 L --
CR 0/13 M Return
SO 0/14 N --
SI 0/15 O --
DLE 1/00 P --
DC1 1/01 Q† --
DC2 1/02 R --
DC3 1/03 S† --
DC4 1/04 T --
NAK 1/05 U --
SYN 1/06 V --
ETB 1/07 W --
CAN 1/08 X --
EM 1/09 Y --
SUB 1/10 Z --
ESC 1/11 3 or [ F11 (ESC)*
FS 1/12 4 or / --
GS 1/13 5 or ] --
RS 1/14 6 or ~ --
US 1/15 7 or ? --
DEL 7/15 8 Delete

4 Emulating VT Series Terminals

Selecting an Operating Level (DECSCL)

NOTE: Select VT300 mode to run all VT200 applications.

Sequence Level Selected
(D) = default
Level 1
CSI 6 1 " p VT100 mode
Level 2 or 3
CSI 6 3 " p VT300 mode, 8-bit controls
CSI 6 3 ; 0 " p VT300 mode, 8-bit controls
CSI 6 3 ; 2 " p VT300 mode, 8-bit controls
CSI 6 2 " p VT300 mode, 8-bit controls
CSI 6 2 ; 0 " p VT300 mode, 8-bit controls
CSI 6 2 ; 2 " p VT300 mode, 8-bit controls
CSI 6 3 ; 1 " p VT300 mode, 7-bit controls (D)
CSI 6 2 ; 1 " p VT300 mode, 7-bit controls

Sending C1 Controls to the Host

ESC sp F Select 7-bit C1 controls.
ESC sp G Select 8-bit C1 controls.

National Replacement Character Set Mode (DECNRCM)

Default: Multinational

Mode Sequence Function
* The last character in the sequence is a lowercase L.
Set
(national)
CSI ? 4 2 h The terminal uses 7-bit characters from an NRC set.
Reset
(multinational)
CSI ? 4 2 l* The terminal uses 7-bit and 8-bit characters from the DEC Multinational or ISO Latin-1 set.

5 Using Character Sets

Selecting Graphic Character Sets

  1. Designate the set as G0, G1, G2, or G3.
  2. Map the designated set into the in-use table.

Designating Character Sets (SCS Sequences)

ESC Intermediate Final

To Select Use
* Only one NRC set is available at a time. You must select national mode to use NRC sets. See "National Replacement Character Set Mode" in Section 4.
† Digital recommends using the first code shown.
Intermediate
94-Character Sets
G0 (
G1 )
G2 *
G3 +
96-Character Sets
G1 -
G2 .
G3 /
Final
ASCII B
DEC Supplemental Graphic % 5
ISO Latin-1 supplemental A
User-preferred supplemental <
DEC Special Graphic 0
NRC Sets*
British A
Dutch 4
Finnish† 5 or C
French R
French Canadian Q
German K
Italian Y
Norwegian/Danish† ` or E or 6
Portuguese % 6
Spanish Z
Swedish† 7 or H
Swiss =

Mapping Character Sets

With Locking Shifts (LS)

Locking Shift Code Function
LS0 (locking shift 0) SI Map G0 into GL. (D)
LS1 (locking shift 1) SO Map G1 into GL.

NOTE: The following locking shift functions are available only in VT300 mode.

LS1R (locking shift 1, right) ESC ~ Map G1 into GR.
LS2 (locking shift 2) ESC n Map G2 into GL.
LS2R (locking shift 2, right) ESC } Map G2 into GR.
LS3 (locking shift 3) ESC o Map G3 into GL.
LS3R (locking shift 3, right) ESC | Map G3 into GR.

With Single Shifts (SS)

SS2 (single shift 2) ESC N Maps G2 into GL for the next character.
SS3 (single shift 3) ESC O Maps G3 into GL for the next character.

Assign User-Preferred Supplemental Set (DECAUPSS)

Default: DEC Supplemental Graphic

Sequence Function
DCS 0 ! u % 5 ST Assigns the DEC Supplemental Graphic set as the preferred supplemental set.
DCS 1 ! u A ST Assigns the ISO Latin-1 Supplemental set as the preferred supplemental set.

Soft Character Sets

You can only load soft character sets in VT300 mode.

Guidelines for Designing Soft Characters

Character Dimension 80-Column Font 132-Column Font
Cell width 15 pixels 9 pixels
Cell height 12 12
Body width 12 7
Body height 7 7
Ascender height 3 3
Descender height 2 2
Spacing before character 2 1
Spacing after character 1 1

Converting Binary Code to an ASCII Character

Binary
Value
Hex
Value
Hex Value
+ 3F Offset
Character
Equivalent
000000  00 3F ?
000001 01 40 @
000010 02 41 A
000011 03 42 B
000100 04 43 C
 
000101 05 44 D
000110 06 45 E
000111 07 46 F
001000 08 47 G
001001 09 48 H
 
001010 0A 49 I
001011 0B 4A J
001100 0C 4B K
001101 0D 4C L
001110 0E 4D M
 
001111 0F 4E N
010000 10 4F O
010001 11 50 P
010010 12 51 Q
010011 13 52 R
 
010100 14 53 S
010101 15 54 T
010110 16 55 U
010111 17 56 V
011000 18 57 W
 
011001 19 58 X
011010 1A 59 Y
011011 1B 5A Z
011100 1C 5B [
011101 1D 5C \
 
011110 1E 5D ]
011111 1F 5E ^
100000 20 5F _
100001 21 60 `
100010 22 61 a
 
100011 23 62 b
100100 24 63 c
100101 25 64 d
100110 26 65 e
100111 27 66 f
 
101000 28 67 g
101001 29 68 h
101010 2A 69 i
101011 2B 6A j
101100 2C 6B k
 
101101 2D 6C l
101110 2E 6D m
101111 2F 6E n
110000 30 6F o
110001 31 70 p
 
110010 32 71 q
110011 33 72 r
110100 34 73 s
110101 35 74 t
110110 36 75 u
 
110111 37 76 v
111000 38 77 w
111001 39 78 x
111010 3A 79 y
111011 3B 7A z
 
111100 3C 7B {
111101 3D 7C |
111110 3E 7D }
111111 3F 7E ~

Down-Line-Loading a Soft Character Set (DECDLD)

DCS Pfn ; Pcn ; Pe ; Pcmw ; Pw ; Pt ; Pcmh ; Pcss { Dscs Sxbp1 ; Sxbp2 ; ... ; Sxbpn ST

DECDLD Parameter Characters

Parameter Name Description
Pfn Font number

Selects the DRCS font buffer to load.

The VT320 has one DRCS font buffer. Pfn has two valid values, 0 and 1. Both values refer to the same DRCS buffer.

Pcn Starting character

Selects where to load the first character in the DRCS font buffer. The location corresponds to a location in the ASCII code table (Section 2).

Pcn is affected by the character set size. (See Pcss below.) In a 94-character set, a Pcn value of 0 or 1 means that the first soft character is loaded into position 2/1 of the character table. In a 96-character set, a Pcn value of 0 means the first character is loaded into position 2/0 of the character table. The greatest Pcn value is 95 (position 7/15).

Pe Erase control

Selects which characters to erase from the DRCS buffer before loading the new font.

0 = erase all characters in the DRCS buffer with this number, width and rendition.
1 = erase only characters in locations being reloaded.
2 = erase all renditions of the soft character set (normal, bold, 80-column, 132-column).
Pcmw Character matrix width

Selects the maximum character cell width.

VT300 modes
0 = 15 pixels wide for 80 columns, 9 pixels wide for 132 columns. (D)
1 = illegal.
2 = 5 × 10 pixel cell | VT220 compatible
3 = 6 × 10 pixel cell |
4 = 7 × 10 pixel cell |
5 = 5 pixels wide.
6 = 6 pixels wide.
.
.
15 = 15 pixels wide.

If you omit a Pcmw value, the terminal uses the default character width. Any Pcmw value over 15 is illegal.

Use Pcmw values 2 through 4 with VT220 compatible software. Remember that VT220 fonts appear different on the VT320. Fonts designed specifically for the VT320 should use values 5 through 15.

Pw Font width Selects the number of columns per line (font set size).
0 = 80 columns. (Default)
1 = 80 columns.
2 = 132 columns.
Pt Text or full-cell Defines the font as a text font or full-cell font.
0 = text. (Default)
1 = text.
2 = full cell.

Full-cell fonts can individually address all pixels in a cell.

Text fonts cannot individually address all pixels. If you specify a text cell, the terminal automatically performs spacing and centering of the characters.

Pcmh Character matrix height Selects the maximum character cell height.
0 or omitted = 12 pixels high. (Default)
1 = 1 pixel high.
2 = 2 pixels high.
3 = 3 pixels high.
.
.
12 = 12 pixels high.

Pcmh values over 12 are illegal. If the value of Pcmw is 2, 3 or 4, Pcmh is ignored.

Pcss Character set size Defines the character set as a 94- or 96-character graphic set.
0 = 94-character set. (Default)
1 = 96-character set.

The value of Pcss changes the meaning of the Pcn (starting character) parameter above.

If Pcss = 0 (94-character set)

The terminal ignores any attempt to load characters into the 2/0 or 7/15 table positions.

Pcn Specifies
1 column 2/row 1
.
.
94 column 7/row 14
If Pcss = 1 (96-character set)
Pcn Specifies
0 column 2/row 0
.
.
95 column 7/row 15

Dscs defines the character set name. You use this name in the select character set (SCS) escape sequence. You use the following format for the Dscs name

I I F

where

Sxbp1 ; Sxbp2 ; ... ; Sxbpn are the sixel bit patterns for individual characters, separated by semicolons (3/11). Your character set can have 1 to 94 patterns or 1 to 96 patterns, depending on the setting of the character set size parameter (Pcss). Each sixel bit pattern is in the following format:

S...S/S...S

where

Valid DECDLD Parameter Combinations

Pcmw Pt Pcmh Pw
80-Column Fonts
0 to 12 0, 1 0 to 12 0, 1
0 to 15 2 0 to 12 0, 1
132-Column Fonts
0 to 7 0, 1 0 to 12 2
0 to 9 2 0 to 12 2

Clearing a Soft Character Set

You can clear a soft character set that you loaded into the terminal by using the following DECDLD control string.

DCS 1;1;2 { sp @ ST

Any of the following actions also clear the soft character set:

6 Screen Display Commands

Display Control Functions

Name Mnemonic Sequence
(D) = default.
* The last character in the sequence in a lowercase L.
† Available in VT300 mode only.
Send/receive mode SRM Set: CSI 12 h
Local echo off.
Reset: CSI 12 l*
Local echo on. (D)
Screen mode DECSCNM Set: CSI ? 5 h
Light background.
Reset: CSI ? 5 l*
Dark background. (D)
Scrolling mode DECSCLM Set: CSI ? 4 h
Smooth scroll. (D)
Reset: CSI ? 4 l*
Jump scroll.
Select active status display† DECSASD CSI Ps $ }
Ps = 0, main display.
Ps = 1, status line.
Select status line type† DECSSDT CSI Ps $ ~
Ps = 0, none.
Ps = 1, indicator.
Ps = 2, host-writable.

Format Sequences

Name Mnemonic Sequence
(D) = default.
* The last character in the sequence in a lowercase L.
Column mode DECCOLM Set: CSI ? 3 h
132 columns.
Reset: CSI ? 3 l*
80 columns. (D)
Set top and bottom margins DECSTBM CSI Pt ; Pb r
Pt = top line.
Pb = bottom line.
Origin mode DECOM Set: CSI ? 6 h
Move within margins.
Reset: CSI ? 6 l*
Move outside margins. (D)

7 Visual Character and Line Attributes

Character and Line Attribute Sequences

Name Mnemonic Sequence
Select graphic rendition SGR CSI Ps...Ps m
Ps = character attribute value(s).
(See list below.)
Single-width, single-height line DECSWL ESC # 5
Double-width, single-height line DECDWL ESC # 6
Double-width, double-height line DECDHL ESC # 3 (top half)
ESC # 4 (bottom half)

Visual Character Attribute Values

Ps Attribute
VT300 and VT100 Modes
0 All attributes off
1 Bold
4 Underline
5 Blinking
7 Reverse video
VT300 Mode Only
22 Bold off
24 Underline off
25 Blinking off
27 Reverse video off

8 Editing

Inserting and Deleting Text

Name Mnemonic Sequence
(D) = default
* The last character in the sequence in a lowercase L.
† Available in VT300 mode only.
Insert/replace mode IRM Set: CSI 4 h
Insert characters.
Reset: CSI 4 l*
Replace characters.
Delete line DL CSI Pn M
Pn lines.
Insert line IL CSI Pn L
Pn lines.
Delete character DCH CSI Pn P
Pn characters.
Insert character† ICH CSI Pn @
Pn characters.

Erasing Text

Name Mnemonic Sequence
(D) = default
* Available in VT300 mode only.
Erase in display ED CSI Ps J
Ps = 0, cursor to end. (D)
Ps = 1, beginning to cursor.
Ps = 2, complete display.
Erase in line EL CSI Ps K
Ps = 0, cursor to end. (D)
Ps = 1, beginning to cursor.
Ps = 2, complete line.
Erase character† ECH CSI Pn X
Pn characters.

Selectively Erasing Text

Name Mnemonic Sequence
(D) = default
* Available in VT300 mode only.
Select character attribute* DECSCA CSI Ps " q
Ps = 0 or 2, erasable
Ps = 1, not erasable
Selective erase in display* DECSED CSI ? Ps J
Ps = 0, cursor to end. (D)
Ps = 1, beginning to cursor.
Ps = 2, complete display.
Selective erase in line* DECSEL CSI ? Ps K
Ps = 0, cursor to end. (D)
Ps = 1, beginning to cursor.
Ps = 2, complete line.

9 Controlling the Cursor

Enabling the Cursor

Name Mnemonic Sequence
(D) = default.
* The last character in the sequence is a lowercase L.
Text cursor enable mode DECTCEM Set: CSI ? 25 h
Visible cursor. (D)
Reset: CSI ? 25 l*
Invisible cursor.

Moving the Cursor*

Name Mnemonic Sequence
(D) = default.
* In these sequences, the default value for Pn, Pl, and Pc is 1.
Cursor position CUP CSI Pl ; Pc H
Line Pl, column Pc.
Horizontal and vertical position HVP CSI Pl ; Pc f
Line Pl, column Pc.
Cursor forward CUF CSI Pn C
Pn columns right.
Cursor backward CUB CSI Pn D
Pn columns left.
Cursor up CUU CSI Pn A
Pn lines up.
Cursor down CUD CSI Pn B
Pn lines down.

10 Keyboard and Printing Commands

Keyboard Control Sequences

Mode Mnemonic Sequence
Set Reset
(D) = default.
* The last character in the sequence is a lowercase L.
Keyboard action mode KAM CSI 2 h
Locked.
CSI 2 l*
Unlocked. (D)
Line feed/ new line mode LNM CSI 20 h
New line.
CSI 20 l*
Line feed. (D)
Autorepeat mode DECARM CSI ? 8 h
Repeat. (D)
CSI ? 8 l*
No repeat.
Autowrap mode DECAWM CSI ? 7 h
Autowrap.
CSI ? 7 l*
No autowrap. (D)
Cursor keys mode DECCKM CSI ? 1 h
Application.
CSI ? 1 l*
Cursor. (D)
Keypad application/ numeric modes DECKPAM
DECKPNM
ESC =
Application.
ESC >
Numeric. (D)
Keyboard usage mode DECKBUM CSI ? 68 h
Data processing.
CSI ? 68 l*
Typewriter. (D)

Programming UDKs

Definable Keys

DECUDK Device Control String Format

DCS Pc ; Pl | Ky1/St1; ... Kyn/Stn ST

Pc is the clear parameter.
0 or none = Clear all keys before loading new values (default).
1 = Clear one key at a time, before loading a new value.
Pl is the lock parameter.
0 or none = Lock the keys.
1 = Do not lock the keys. (D)

Ky1/St1;...Kyn/Stn are the key definition strings.

The key selector number (Kyn) indicates which key you are defining.

Key Value Key Value Key Value
F6 17 F11 23 Do 29
F7 18 F12 24 F17 31
F8 19 F13 25 F18 32
F9 20 F14 26 F19 33
F10 21 Help 28 F20 34

The string parameters (Stn) are the key definitions, encoded as pairs of hex codes.

3/0 through 3/9 (0 through 9)

4/1 through 4/6 (A through F)

6/1 through 6/6 (a through f)

Printing Control Sequences

Name Mnemonic Sequence
(D) = default.
* The last character in the sequence is a lowercase L.
Printer extent mode DECPEX Set: CSI ? 19 h
Screen.
Reset: CSI ? 19 l
Scrolling region. (D)
Print form feed mode DECPFF Set: CSI ? 18 h
Form feed.
Reset: CSI ? 18 l*
No form feed. (D)
Auto print mode MC On: CSI ? 5 i
Off: CSI ? 4 i
Printer controller mode MC On: CSI 5 i
Off: CSI 4 i
Print screen MC CSI i or CSI 0 i
Print cursor line MC CSI ? 1 i

11 Reports

Sequences for VT320 Reports

Name Mnemonic Sequence
Primary Device Attributes
Primary DA request
(Host to VT320)
DA CSI c or CSI 0 c
Primary DA response
(VT320 to Host)
DA CSI ? Psc; Ps1; ... Psn c
Psc = operating level.
61 = level 1 (VT100 mode).
62,63 = level 3 (VT300 mode).
Ps1...Psn = extensions.
1 = 132 columns.
2 = printer port.
6 = selective erase.
7 = soft character set.
8 = user-defined keys.
9 = NRC sets.
See Table 1 in this section.
Secondary Device Attributes
Secondary DA request
(Host to VT320)
DA CSI > c or CSI > 0 c
Secondary DA response
(VT320 to Host)
DA CSI > Pp ; Pv ; Po c
Pp = identification code.
24 = VT320 terminal.
Pv = firmware version.
Po = hardware options.
0 = no options.
Device Status Reports
VT320 Operating Status
Request
(Host to VT320)
DSR CSI 5 n
Report
(VT320 to Host)
DSR CSI 0 n
No malfunction.
CSI 3 n
Malfunction.
Cursor Position Report
Request
(Host to V3420)
DSR CSI 6 n
Report
(VT320 to Host)
CPR CSI Pl; Pc R
Pl = line number.
Pc = column number.
Printer Status
Request
(Host to VT320)
DSR CSI ? 15 n
Report
(VT320 to host)
DSR CSI ? 13 n
No printer.
CSI ? 10 n
Printer ready.
CSI ? 11 n
Printer not ready.
UDK Status (VT300 Mode Only)
Request
(Host to VT320)
DSR CSI ? 25 n
Report
(VT320 to host)
DSR CSI ? 20 n
UDKs unlocked.
CSI ? 21 n
UDKs locked.
Keyboard Dialect
Request
(Host to VT320)
DSR CSI ? 26 n
Report
(VT320 to host)
DSR CSI ? 27; Pd n
Pd = keyboard dialect.
1 = North American.
2 = British.
3 = Flemish.
4 = French Canadian.
5 = Danish.
6 = Finnish.
7 = German.
8 = Dutch.
9 = Italian.
10 = Swiss (French).
11 = Swiss (German).
12 = Swedish.
13 = Norwegian.
14 = French/Belgian.
15 = Spanish.
16 = Portuguese.
Terminal State Reports (VT300 Mode Only)
Request (Host to VT320) DECRQTSR CSI Ps $ u
Ps = report requested.
0 = ignored.
1 = terminal state report.
Terminal state report
(VT320 to host)
DECTSR DCS 1 $ s D...D <checksums 1 and 2> ST
D...D = report data.
Restore terminal state DECRSTS DCS Ps $ p D...D ST
Ps = data string format.
0 = error.
1 = terminal state report.
D...D = restored data.
Presentation State Reports (VT300 Mode Only)
Request
(Host to VT320)
DECRQPSR CSI Ps $ w
Ps = report requested.
0 = error.
1 = cursor information report.
2 = tab stop report.
Cursor information report
(VT320 to Host)
DECCIR DCS 1 $ u D...D ST

D...D = data string. See text for description.

Tab stop report
(VT320 to host)
DECTABSR DCS 2 $ u D...D ST
D...D = tab stops.
Restore presentation state DECRSPS DCS Ps $ t D...D ST
Ps = data string format.
0 = error.
1 = cursor information report.
2 = tab stop report.
D...D = data string.
* The last character in the sequence is a lowercase L.
Mode Settings (VT300 Mode Only)
Request mode
(Host to VT320)
DECRQM CSI Pa $ p
Pa = ANSI mode. (Table 2)
CSI ? Pd $ p
Pd = DEC private mode. (Table 3)
Report mode
(VT320 to host)
DECRPM CSI Pa; Ps $ y
Pa = ANSI mode. (Table 2)
Ps = mode state.
0 = unknown mode.
1 = set.
2 = reset.
3 = permanently set.
4 = permanently reset.
Set mode SM CSI Pa; ... Pa h
Pa = ANSI mode(s). (Table 2)
CSI ? Pd; ... Pd h
Pd = DEC private mode(s). (Table 3)
Reset mode RM CSI Pa; ... Pa l*
Pa = ANSI mode(s). (Table 2)
CSI ? Pd; ... Pd l*
Pd = DEC private mode(s). (Table 3)
Control Function Settings (VT300 Mode Only)
Request
(Host to VT320)
DECRQSS DCS $ q D...D ST
D...D = intermediate and/or final characters of function. (Table 4)
Report
(VT320 to host)
DECRPSS DCS Ps $ r D...D ST
Ps = 0, valid request.
Ps = 1, invalid request.
D...D = intermediate and/or final characters of function. (Table 4)
Saving and Restoring the Cursor State
Save cursor state DECSC ESC 7
Restore cursor state DECRC ESC 8
User-Preferred Supplemental Set (VT300 Mode)
Request
(Host to VT320)
DECRQUPSS CSI & u
Report
(VT320 to host)
DECAUPSS DCS 0 ! u % 5 ST
DEC Supplemental Graphic
DCS 1 ! u A ST
ISO Latin-1 Supplemental
Table 1 Alias Primary DA Responses from the VT320*
Terminal Identification Sequence Meaning
* To change these alias responses, you must use the General Set-Up screen. See Chapter 4 of Installing and Using the VT320 Video Terminal.
VT100 DA ESC [ ? 1; 2 c VT100 terminal
VT101 DA ESC [ ? 1; 0 c VT101 terminal
VT102 DA ESC [ ? 6 c VT102 terminal
VT220 DA ESC [ ? 62; 1; 2; 6; 7; 8; 9; 11; 14 c VT220 terminal
Table 2 ANSI Modes for DECRQM, DECRPM, SM, and RM
Mode Mnemonic Pa
* The host cannot change the setting of CRM. You can only change CRM from set-up. If CRM is set, the terminal ignores DECRQM and most other control functions.
† The HEM control function is permanently reset.
Keyboard action KAM 2
Control representation CRM* 3
Insert/replace IRM 4
Horizontal editing HEM† 10
Send/receive SRM 12
Line feed/new line LNM 20
Table 3 DEC Private Modes for DECRQM, DECRPM, SM, and RM
Mode Mnemonic Pd
Cursor keys DECCKM 1
ANSI DECANM 2
Column DECCOLM 3
Scrolling DECSCLM 4
Screen DECSCNM 5
Origin DECOM 6
Autowrap DECAWM 7
Autorepeat DECARM 8
Print form feed DECPFF 18
Printer extent DECPEX 19
Text cursor enable DECTCEM 25
National replacement character set DECNRCM 42
Numeric keypad DECNKM 66
Keyboard usage DECKBUM 68
Table 4 Control Functions for DECRQSS Requests
Control Function Mnemonic Intermediate and Final Character(s)
Select active status display DECSASD $ }
Set character attribute DECSCA " q
Set conformance level DECSCL " p
Set status line type DECSSDT $ ~
Set top and bottom margins DECSTBM r
Select graphic rendition SGR m

12 Resetting and Testing

Resetting and Testing Sequences

Name Mnemonic Sequence
* Available in VT300 mode only.
Resetting the Terminal
Soft terminal reset* DECSTR CSI ! p
Hard terminal reset RIS ESC c
Not recommended.
Tabulation clear TBC CSI 0 g
Clear tab at cursor position.
CSI 3 g
Clear all tabs.
Testing the Terminal
Invoke confidence test DECTST CSI 4; Ps; Ps; ... y
Power-up self-test.
Screen alignment pattern DECALN ESC # 8

Soft Terminal Reset (DECSTR) States

Mode Mnemonic State After DECSTR
Text cursor enable DECTCEM Cursor enabled.
Insert/replace IRM Replace.
Origin DECOM Absolute (cursor origin at upper-left of screen).
Autowrap DECAWM No autowrap.
National replacement character set DECNRCM Multinational set.
Keyboard action KAM Unlocked.
Numeric keypad DECKPNM Numeric characters.
Cursor keys DECCKM Normal (arrow keys).
Set top and bottom margins DECSTBM Top margin = 1.
Bottom margin = 24.
All character sets G0, G1, G2, G3, GL, GR VT320 default settings.
Select graphic rendition SGR Normal rendition.
Selective erase attribute DECSCA Normal (erasable by DECSEL and DECSED).
Save cursor state DECSC Home position with VT320 defaults.
Assign user-preferred supplemental set DECAUPSS Set selected in set-up.
Select active display DECSASD Main display (first 24 lines).

Effects of a Hard Terminal Reset (RIS)

Invoke Confidence Test (DECTST) -- Power Up Self-Test

CSI 4 ; Ps; ... Ps y

where Ps indicates a particular test to run.

Ps Test to Run
0 All tests (1, 2, 3, 6)
1 Power-up self-test
2 RS232 port data loopback test
3 Printer port loopback test
6 RS232 port control line loopback test
7 DEC-423 port loopback test
9 Repeat other tests in the string

Screen Alignment Pattern (DECALN)

ESC # 8
1/11 2/3 3/8

A. VT52 Mode Control Codes

Entering VT52 Mode

CSI ? 2 l*

* The last character in the sequence is a lowercase L.

Exiting VT52 Mode

ESC <

VT52 Escape Sequences

Sequence Action
ESC A Cursor up.
ESC B Cursor down.
ESC C Cursor right.
ESC D Cursor left.
ESC F Enter graphics mode.
ESC G Exit graphics mode.
ESC H Cursor to home position.
ESC I Reverse line feed.
ESC J Erase from cursor to end of screen.
ESC K Erase from cursor to end of line.
ESC Y Pl Pc Move cursor to line Pl and column Pc.
ESC Z Identify. (host to terminal)
ESC / Z Report. (terminal to host)
ESC = Enter alternate keypad mode.
ESC > Exit alternate keypad mode.
ESC < Exit VT52 mode. (Enter VT100 mode.)
ESC ^ Enter autoprint mode.
ESC _ Exit autoprint mode.
ESC W Enter printer controller mode.
ESC X Exit printer controller mode.
ESC ] Print screen.
ESC V Print the line with the cursor.