https://programesecure.com/ascii-values-table-generator-in-c...
Unfortunately if you just see the character codes with the decimal, hex, and octal next to them this logic is obscured. Remember, it had to be implementable in (mechanical!) hardware.
https://programesecure.com/ascii-values-table-generator-in-c...
Unfortunately if you just see the character codes with the decimal, hex, and octal next to them this logic is obscured. Remember, it had to be implementable in (mechanical!) hardware.
Could you elaborate on what does the bit pattern reveal?
For example, I understand that Ctrl-C generates 0x30, which stands for ETX (end of transmission), but what is it there in 011?
Older terminals (like the VT05) used bit-pairing also with shift. They just flipped some bits depending on the upper two bits. Compare column 2 with 3 in the linked graphic, and 4,5 with 6,7.
#define CTRL(x) ((x) ^ 0100)
// e.g. 'C' ^ 0100 is 3
// e.g. '@' ^ 0100 is 0
// e.g. 'M' ^ 0100 is 13 a.k.a. \r a.k.a. enter
I like this explanation better. It also explains what notation like ^C means. It's shorthand for 0100^C.Crtl-C is shorthand for 0100 xor ‘C’
Also, the 0 prefix means this is a base-8 (octal) number
eh, the article linked does a very poor job of an explanation of ASCII
And no wonder, it's a deep subject - if you want answers the you want to watch this talk: https://m.youtube.com/watch?v=_mZBa3sqTrI