A20 handler

From Wikipedia, the free encyclopedia

The A20 handler is IBM PC memory manager software controlling access to the High Memory Area. Extended memory managers usually provide this functionality. A20 handlers are named after the 21st address line of the microprocessor, the A20 line.

The Intel 8088 CPU used in the original IBM PC was capable of addressing memory using 20 binary digits ("bits"). But the registers in the 8088 were only 16 bits wide. A 20 bit memory address was created by left shifting the 16 bit Segment Address (in effect multiplying it by 16) and adding the 16 bit offset address to it yielding a 20 bit result.

For example, using hexadecimal values with a Code Segment (CS) of 1000 and an Instruction Pointer (IP) of 2000, the actual memory address of CS:IP is, as follows:

 CS : 1000 shifted left by 4 bits gives 10000
 
 So the result is 10000 + 
                   2000 
                = 12000

In reality, the result can be 21 bits wide since the total of the two registers can be more than FFFFF hexadecimal, e.g. repeating the above example with CS = FF00 and IP = FFFF. It is possible to generate references to slightly less that 64K bytes that are outside the addressing range of the 8088. When the 80286 CPU which had more than 20 address lines was developed, it became necessary to deal with code that referenced the 64K addressable by ordinary addressing but not present in the 8088. As it turned out, it was sometimes desirable to set the 21st address line, and sometimes desirable not to. A logic gate was added on the motherboard to control the 21st address line. Not surprisingly, this was called the "A20 gate".

Controlling the A20 line was an important feature at one stage in the growth of the IBM PC architecture, as it added access to an additional 65520 (64K - 16) bytes of memory in real mode without dramatic software changes.

[edit] See also

[edit] References

[edit] External links

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.