The keyboard buffer is a memory area reserved in the BIOS data area. This certain area stores the ASCII or special key codes pressed from the keyboard. It functions as a circular buffer and two bytes are reserved for every character, 2 bytes are accustomed to store an individual character moreover. The first character shops the ASCII code and the second-byte stores 0 in the event an ASCII crucial is pressed. In the event, an extended key like F1- F12 or arrow essential is pressed the 1st-byte stores a 0 indicating an extended important and the next byte stores its extended crucial code.
The circular keyboard buffer starts at the address 40:1EH possesses 32 bytes. The address 40:1AH shops the head of this circular buffer as the address 40:1CH stores the tail of the buffer. If the buffer is usually empty the top and tail factors at the same area as demonstrated in the diagram above.
The over slide shows how character types are kept in the buffer. If ‘A; is to be stored then your first byte in the buffer will store its ASCII code and the second will shop 0, and if prolonged essential like DEL is usually to be stored the first byte can store 0 and the next byte will stop its scan code we.e 83. The diagram also demonstrates head points to another byte where in fact the next input personality could be stored. Also, observe that head supports the offset from the address 40:00H and not from address 40:1EH. i.e it contains 0x24 which may be the address of another byte to be kept relative to the beginning of BIOS data region rather than the keyboard buffer. As discussed earlier the keyboard buffer is a circular buffer the tail need to be positioned appropriately, therefore. In the given example the input kept in the buffer is consumed ‘A’. On consumption of the character the tail index is usually updated to ensure that it points to another personality in the buffer. In short, the tail would indicate another byte to become consumed in the buffer while mind points to where next character could be stored.
Source: VU-Pakistan
Emoticon Emoticon