Alt code: Difference between revisions

Content deleted Content added
Windows: Modulo-255 is already discussed in the Unicode section!
MS-DOS: I guess this ref can be here because it is MSDOS and IBMPC specific
Line 6:
==MS-DOS==
 
On [[IBM PC compatible]] [[personal computer]]s from the 1980s, the [[BIOS]] allowed the user to hold down the {{keypress|Alt}} key and type a decimal number on the keypad. It would place the corresponding code into the keyboard buffer so that it would look (almost) as if the code had been entered by a single keystroke. Applications reading keystrokes from the BIOS would behave according to what action they associate with that code. Some would interpret the code as a command, but often it would be interpreted as an 8-bit character from the current [[code page]] that was inserted into the text the user was typing.<ref name="WindowsAltModulo">If the entered value exceeds 255, only the remainder after dividing by 256 (i.e., the value [[modulo]] 256) was used by the BIOS. For example, 520 is interpreted as 520 mod 256 = 8, so it produces the same character as for value 8.</ref> On the original [[IBM PC]] the code page was [[CP437]].
 
Some Eastern European, Arabic and Asian computers used other hardware [[code page]]s, and MS-DOS was able to switch between them at runtime with commands like <code>KEYB</code>, <code>[[List of DOS commands#CHCP|CHCP]]</code> or <code>[[List of DOS commands#MODE|MODE]]</code>. This causes the Alt combinations to produce different characters (as well as changing the display of any previously-entered text in the same manner). A common choice in locales using variants of the Latin alphabet was [[CP850]], which provided more Latin character variants. (There were, however, many more code pages{{Crossreference|text=; for a more complete list, see [[code page]]}}).