|
|
|
|
|
by pwg
1297 days ago
|
|
> by essentially subtracting 64 (which is almost but not quite equivalent to masking out a bit) Subtracting 64 is exactly the same as "masking out a bit". The difference between the control characters and their upper case equivalents is that bit 6 (counting from zero) of the byte is zero for the control characters and is one for the upper case equivalents. On old terminals, the 'control' key more often than not worked by simply forcing bit six of the character mapped to a given key to zero (i.e., it was a direct hardware change). Another seemingly little known fact, for ASCII, the difference between upper case and lower case letters is again a single bit. Letter A is 65, letter a is 97, the difference there is bit 5 (counting from zero) is zero for "A" and one for "a". |
|