BillW, Would you know certain commands used for accessing parallel and serials? As of now, I know 3: Peek Inportb Outportb Are there other commands? Any tutorial where also definitions and when to used? Thanks -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of William Chops Westfield Sent: Wednesday, June 09, 2004 1:34 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [OT:] Programming Serial and Parallel Port 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 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.698 / Virus Database: 455 - Release Date: 6/2/04 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.698 / Virus Database: 455 - Release Date: 6/2/04 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu