MTB 251

MTB-251 MTB-251

User Manual: MTB-251

Open the PDF directly: View PDF PDF.
Page Count: 10

MULTICS
TECHNICAL
BULLETIN -251
page
1
To!
Distribution
From:
Robert
S.
Coren
Date!
01/22/76
Subject:
Canonicalization
of
Terminal
Input
l~lE.Q.Q.L!.t.llQ~
In
theory,
~erminal
input
to
Multics
is
converted
by
the
ring-zero
typewriter
DIM
to
"canonical
form",
i.
e.,
the
physical
appearance
of
a
line
uniquely
defines'the
form
in
which
it
will
be
stored.
In
addition,
well-defined
meanings
are
attached
to
input
streams
containing
erase,
kill,
and
escape
characters.
In
actual
fact,
the
current
typewriter
DIM
does
not
meet
the
goals
described
in
the
preceding
paragraph.
The
three
basic
types
of
canonicalization
<column
aSSignment,
erase/kill,
and
escape)
are
each
handled
more
or
less
correctly,
but
the
current
design
does
not
lend
itself
to
correct
and
consistent
processing
of
combinations
of
canonicatization
types.
The
trouble
is
that
the
three
types
are
handled
more
or
less
simultaneously.
lhus
the
final
input
resulting
from
strings
such
as
"'0,7",
"'016#1",
" .l.Q.QQ" , "
It
0 2 5
If
,
etc
, i s no t
pre
d i c
tab
l e
un
de
r
the
cur
r e n t
implementation.
A
redesigned,
more
efficient
version
of
tty_read
is
planned
for
Multics
r~lease
4.0;
in
the
course
of
the
new
design,
canonicalization
will
be
cleaned
up
and
made
consistent.
The
details
of
this
n e
wd
e s i 9 n
will
bed
i s c
us
sed
in
a
future
M r
[3
;
the
purpose
of
the
present
document
is
to
set
forth
a
complete
description
of
the
rules
of
canonicalization
that
the
new
tty_read
will
implement.
It
is
proposed
that
the
rules
described
here
be
adopted
as
d
standard
for
all
situations
in
Multics
where
canonicalization
is
required.
The
three
types
of
canonicalization
named
above
must
be
performed
separately
in
a
defined
order,
to
ensure
consistency
and
predictability.
In
particular,
the
canonicalization
process
Multics
Project
internal
working
documentation.
Not
to
be
reproduced
or
distributed
outside
the
Multics
Project.
MULTICS TECHNICAL BULLETIN -251
page
2
is
conceptually
divided
into
the
following
steps:
1.
If
the
terminal
is
in
"can"
mode,
perform
column-assignment
canonicalization
on
the
typed
input.
2.
1ft
he
t e r
min
ali
s j n
"e
r k l "
mode,
per
for
mer
as
elk
i
II
canonicalization
on
the
result
of
step
1.
3.
If
the
terminal
is
in
"esc"
mode,
perform
canonicalization
on
the
result
of
step
2.
escape
Of
course,
the
actual
implementation
does
not
necessarily
have
to
perform
the
three
steps
in
sequence,
provided
that
the
result
is
the
same
as
would
have
been
achieved
by
doing
so.
The
three
types
of
canonicalization
are
discussed
in
more
detail
below.
If
two
or
more
of
the
rules
listed
below
are
applicable
to
a
given
input
string,
they
are
applied
in
the
order
in
which
they
are
presented
here.
COlU~N
ASSIGNMENT
lhis
phase
is
concerned
with
determining
which
printing
graphics,
if
any,
appear
in
each
physical
column
position.
This
is
determined
according
to
the
following
rules.
1.
lhe
leftmost
position
of
the
carriage
is
considered
to
be
column
1.
2.
Each
printing
graphic
or
space
typed
increases
the
column
position
by
1.
3.
E3ch
backspace
typed
decreases
the
column
position
by
unless
the
column
positiOn
;s
1.
4.
A
carriage
return
sets
the
column
position
to
1.
5.
A
horizontal
tab
increases
the
column
position
to
the
next
tdb
stop;
tab
stops
are
defined
to
be
at
columns
11,
Multics
Project
internal
working
documentation.
Not
to
be
reproducpd
or
distributed
outside
the
Multics
Project.
MULTICS
TECHNICAL
BULLETIN -
251
page
3
21,31,
etc.
6.
A
newline,
form
feed,
or
vertical
tab
sets
the
column
position
to
1
and
advances
the
carriage
vertically;
thus
no
character
typed
after
such
a
character
can
share
a
column
position
with
a
character
typed
before
it.
7.
Characters
on
each
line
are
sorted
so
that
their
associated
column
positions
are
monotone
increasing.
8.
No
carriage
return
characters
may
appear
in
the
canonical
string.
9.
A
horizontal
tab
is
preserved
as
typed
unless
a
printing
graphic
appe~rs
in
one
of
the
columns
skipped
by
the
tab,
in
which
case
the
tab
is
replaced
by
an
appropriate
number
of
spaces.
10.
Backspaces
appear
in
the
canonical
string
only
when
two
or
more
printing
graphics
share
a
column
position.
1 1
..
When
two
or
more
di
f
fe
ren
t
printing
graphi
cs
share
a
column
po
sit
i
on,
the
characters
are
sorted
as
fo
II
ow
s :
graPhic
with
lowest
numeric
ASCII
code,
ba
ck
spac
e,
graphic
with
next
lowes
t n
urn
e
ric
ASCII
code,
etc.
12.
If
the
contents
of
a
column
position
consist
of
two
or
more
instances
of
the
same
printing
graphic,
that
column
i~reduced
to
a
single
instance
of
the
graphic.
13.
A
line-ending
char~cter
(newline,
form
feed,
or
vertical
tab)
immedjately
follows
the
last
printing
graphic
in
the
rightmost
column
position
on
the
line.
ERASE
AND
KILL
CHARACTERS
The
placement
of
eraselkill
canonicalization
after
column-assignment
canonicalilation
and
before
escape
canonicalization
is
strategic
in
that
it
causes
erase/kill
processing
to
work
by
,giUmD
QQ~iligO
rather
than
by
~b~[d'l~L.
This
elim.inat~s
ambiyuity
with
respect
to
erase
characters
combined
with
escape
sequences.
(See
the
examples
at
the
pnd
of
this
document.)
MUlTICS
TECHNICAL
BULLETIN
-
251
page
4
The
rules
for
erase
and
kill
canonicali2ation
are
given
below.
14.
An
~rase
character
alone
in
a
column
position
results
in
the
detetion
of
itself
and
of
the
contents
of
the
preceding
column
position.
15.
An
erase
character
alone
in
a
column
position
and
preceded
by
more
than
one
blank
column
results
in
the
deletion
of
~11
immediately
preceding
blank
columns,
as
well
as
of
the
erase
character.
16.
An
erase
character
sharing
a
column
position
with
one
or
more
printing
graphics
results
in
the
deletion
of
the
contents
of
tnat
column
position.
1
7.
A
ki
II
character
r
esu
l
t's
in
the
deletion
of
; t s
Own
column
position
and
all
col
umn
posi
t
ions
to
" i
ts
left,
unless
i t
shares
a
cotumn
po
sit
i on
with
an
erase
character,
in
which
ca's
e
rule
16
a pp
lie
s (
the
kill
character
is
erased).
18.
If
the
terminal
is
in
"esc"
mode,
an
erase
or
ki
II
character
alone
in
a
column
immediately
preceded
by
an
escape
character
alone
in
a
column
is
not
processed
as
an
era
s e 0 r
kill
ch a r
act
e
r.
Note
that
for
rule
18
to
apply,
the
erase
or
ki t l
charact
er
must
actually
have
been
typed
in
the
column
immediately
following
the
esc
ape
c h a r
act
e
r.
The
red
s on
for
t
his
i s t h d
tit
f a c i
lit
ate
s
the
erasing
of
escap"e
sequences,
e.g.,
\001####.
ESCAPE
SEQUENCES
lhe
processing
of
escape
sequences
is
performed
according
to
thp
rules
given
below.
19.
An
escape
sequence
consists
of
an
escape
character
alone
in
its
column
position
followed
by
one
or
more
printing
graphics
each
of
which
is
alone
in
its
column
position.
An
escape
sequence
'is
replaced
by
a
single
character
in
the
canonical
string.
20.
An
escape
sequence
consisting
of
two
successive
escape
c h
'a
r
act
e r
sis
rep
lac
e d by an
esc
ape
c h a
rae
t e r
MUlTICS
TECHNICAL
BULLETIN -251
page
5
21.
An
escape
sequence
consisting
of
an
escape
character
followed
by an
erase
(or
kill)
character
is
replaced
by
an
erase
(or
kilt)
character.
22.
An
escape
sequence
consisting
of
an
escape
Character
followed
by
one,
two,
or
three
octal
digits
is
replaced
by
the
character
whose
AStIl
value
is
represented
by
the
sequence
of
octal
digits.
23.
An
escape
results
character
followed
in
the
deletion
of
by
a
both
newline
character
characters
from
the
canonical
string.
24.
Other
escape
sequences
may
be
defined
on a
per-terminaL-type
basis,
where
such
a
sequence"
consists
of
an
escape
character
and
one
character
following.
I I
25.
If
the
character
following
an
~sc~pe
character
does
not
result
in
an
escape
sequence
as
defined
by
rules
20-24,
the
escape
and
following
characters
are
stored
as
they
appear
on
the
line.
In
the
examples
below,
the
following
conventions
are
used:
<NL>
<CR>
<8S>
<HT>
<SP>
{nnn}
\
@
';'
re
pre
sen
t
san
e w
lin
e
represents
a
carri"age
return
represents
a
backspace
represents
a
horizontal
tab
represents
a
space
represents
a
character
whose
ASCII
nnn
(octal)
is
the
escape
character
is
the
erase
character
is
the
ki
lt
character
value
is
lhe
examples
in
the
first
group
illustrate
how
various
typed
sequences
are
canonicalized
in
terms
of
column
position;
these
are
f 0 1 1 owed b y
ex
amp 1
es
of
era
s e , k
ill
,
and
es
cape
MULTICS
TECHNICAL
BULLETIN -251
page
6
canonicalization.
In
the
second
group,
lines
are
shown
as
they
appear
physically,
with
no
consideration
given
to
the
precise
sequence
of
keystrokes
that
might
have
produced
them.
COLUMN
CANONICALIlATION
EXAMPLES
lyped:
Nothing
special
about
this
line.<NL>
Appearance:
Nothing
special
about
this
line.
Result:
Nothing
special
about
this
tine.<NL>
1 y
oe
d :
Extraneous
white
s<SP><BS>pace
is
ignored.<CR><SP><Nl>
Appearance:
Extraneous
white
space
is
ignored.
Resul
t:
Extraneous
white
space
is
ignored.<NL>
lyped:
lwo
ways
(2<8S>_)
to
overstrike.<CR>
___
<NL>
Appearance:
lWQ
ways
(~)
to
overstrike.
Result:
l<BS>
__
<BS>w_<AS>O
ways
(2<8S>_)
to
overstrike.<NL>
Typed:
Tab +
backspace
is<HT><8S>reduced
to
spaces.<NL>
Appearance:
Tab
+
backspace
is
reduced
to
spaces.
Result:
lab
+
backspace
is<SP><SP><SP><SP>reduced
to
spaces.<NL>
MUL1ICS
TECHNICAL
BULLET
IN
-251
page
7
(See
rule
9.>
ERASE-KlLL
AND
ESCAPE
EXAMPLES
Appearance:
abz#cde
Result:
abcde
Appearance:
ab
IIcde
Result:
abcde
Appearance:
Not@Never
otin
Sunday.
Result:
Never
on
Sunday.
Appearance:
~Q~#~
it's
right.
Result:
~.o.,\;
it's
right.
Appearance!
~Q~~W
it's
right.
Result:
t::!~.!w
it's
right.
(Erase
character
is
overstruck;
see
Rule
16.>
MUlllCS
lECHNlCAl
BUllE1IN
-
251
page
8
Appearance:
dcl
rrs
char
(1)
static
inite=\017#6==j;
Result:
dcl
rrs
char
e1>
static
init("{016)">;
f..'!
~
!!!.Q
.i.e
_11
Appearance:
\023
Result:
{002}J
(Overstruck
3
js
not
part
of
escape
sequence.>
Appearance:
1112
Result:
j 11 2
(Overstruck
\
1S
not
an
escape
character.>
Appearance:
a\##b
Result:
a\b
(First
#
is
not
an
erase
character
by
rule
18;
second
#
erases
itself
and
preceding
#
by
rule
14.>
f!.g!!lgl~_l!t
(similar
to
t:xample
13)
Appearance:
a\@#b
Resul
t:
a\b
MUlTICS
TECHNICAL
BULLETIN -251
page
9
Appearance:
aN@b
Result:
b
(The
\
is
erased
by
the
overstruck
#.)
Appearance:
a\\#b
Result:
a\#b
(Erase
canonicalization
do~s
not
recognize
the
#
by
rule
18;
escape
canonicalization
recognizes
\\
by
rule
20,
and
attaches
no
special
meaning
to
the
#.>
Appearance:
a\\##b
Result:
a\b
(8y
rule
18,
the
first
#
is
not
an
erase
character;
by
rule
14,
the
second
#
erases
itself
and
the
preceding
#;
lbgD
rule
20
reduces
\\
to
\.>
Appearance:
a\\###b
Result:
a\b
(The
first
#
is
not
an
erase;
the
next
two
are,
erasing
the
second
\
and
the
first
#.>
MULTICS
TECHNICAL
BULLETIN -251
pdgt:'
10
Appearance:
a\\####b
Result:
ab
(The
first
#
is
not
an
erase,
and
must
be
erased
before
the
two
\
characters.
Examples
16-19
illustrate
the
difficulty
of
erasing
a
double
\;
the
clearest
method
is
probably
to
overstrike
(aNNb).>
f~~mu1f_2Q
(on
2741-like
terminal>
Appearance:
at<#b
Result:
a\b
(Only
the
<
is
erased;
t
is
translated
to
\.>

Navigation menu