Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!swrinde!ucsd!ucbvax!hplabs!hpcc05!hp-ptp!marcb From: marcb@hp-ptp.HP.COM (Marc Brandis) Newsgroups: comp.os.msdos.programmer Subject: Re: point to an address above 1M ? Message-ID: <10850001@hp-ptp.HP.COM> Date: 26 Sep 90 16:13:06 GMT References: <14016@hydra.gatech.EDU> Organization: HP Pacific Technology Park - Sunnyvale, Ca. Lines: 39 A clarification to the following postings. >> Picking a nit, to be sure, but the highest address is *not* FFFF:FFFF, >>it is F000:FFFF (or FF00:0FFF, or FFF0:00FF, or FFFF:000F). > >Picking another nit, the highest address *is* FFFF:FFFF, not F000:FFFF >(or its equivalent forms). But in order to access memory above >FFFF:000F, you have to play with the A20 line. Use the HIMEM.SYS >device driver to do this in a manner compatible with other programs. > Just how do you pack your 32 bit address into 21 address lines? Address translation on all Intel processors in real mode works as follows: The CPU shifts the segment part of the address 4 bits to the left (multiplies it by 16) and then adds the offset part to it, resulting in a 20 bit physical address. Of course, when you specify a combination of segment and offset like FFFF:FFFF, the result over- flows into the next higher bit, yielding a 21 bit address. The 8088, 8086, 80188 and 80186 have only 20 address lines, so the highest bit is just ignored, so that all addresses still lie in the first megabyte. However, the 80286, 80386 and 80486 have more than 21 address lines, and there the 21st address bit is set in this case, causing the CPU to access memory above the first megabyte. For compatibility reasons, all systems based on the 286, 386 and 486 include special circuitry, that causes this address line (A20) to be zero. This "feature" can be disabled, so that nearly 64k more memory becomes addressable in real mode. And that is exactly what HIMEM.SYS does. (* I speak only for myself. Marc-Michael Brandis Institut fuer Computersysteme ETH Zentrum CH-8092 Zuerich, Switzerland e-mail: brandis@inf.ethz.ch brandis@iis.ethz.ch Temporarily at HP, marcb@hp-ptp.ptp.hp.com *)