On Tuesday, Jun 8, 2004, at 18:29 US/Pacific, ToughGuy wrote: > > If (select=='1') offset = 0x08; > If (select=='2') offset = 0x0a; > If (select=='3') offset = 0x0c; > Dport = peek(0x40, offset); > > What are these hexs basis? > Dunno where they got it. > Never mentioned in the samples nor in the book > > Got this programming the parallel port by D.V.G > The IBM PC Bios stores certain information in the low memory address space of the system. In particular, at location 0x408 is stored the base address of "LPT1", at 0x40a the address of LPT2, and so on. The format of the "peek" function seems to be based on the old segmented memory architecture of the early x86 processors, where each address consisted of a "segment" and an "offset", each 16 bits. The hardware would compute (segment<<4)+offset before sending the address to the external memory chips. So a segment of 40 and an offset of 8 gives you address 0x408. There's some more info about the bios addresses here: http://www.extremetech.com/article2/0,1558,1151903,00.asp BillW -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu