IO Port Addressing

The IA32 processor family is restricted to the 64K + 3 range of IO addresses from 0000h through 10002h. The programmer uses one of two instruction forms to identify the target IO location of a read or write operation. If the IO address is within the range from 0000h through 00FFh, the following form may be used:

in al, nn     ;read data from io port 00nnh into al
mov al, xx    ;set up data in al
              ;and another example...
out nn, al    ;write data in al to io port 00nnh

where nn = the target IO address. When the IO address is within the range from 0100h through FFFFh, the following form must be used:

mov dx, nnnn     ;set up the io address in dx
in al, dx        ;read data from address   in dx into al

mov dx, nnnn ;set up the io address in dx mov ...

Get The Unabridged Pentium 4 IA32 Processor Genealogy now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.