From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: Detecting interrupt on printer port Date: Tue, 11 Aug 1998 19:02:25 -0300 Organization: NBTel Internet Lines: 21 Message-ID: <35D0BF71.9FB3EE0B@unb.ca> References: NNTP-Posting-Host: fctnts06c82.nbnet.nb.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Michel Gallant wrote: > //global counter > int counter = 0; use: volatile int counter = 0; You need to do this because DJGPP will likely move counter into a register during the loop where you print the value in printf. Setting a variable to 'volatile' forces DJGPP to reload 'counter' from memory every time it is used. -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT GeoCities DOT com Endlis AT nbnet DOT nb DOT ca