From: "Dahl" Newsgroups: comp.os.msdos.djgpp Subject: Re: Detecting interrupt on printer port Date: Wed, 12 Aug 1998 22:51:49 +0200 Organization: Algonet/Tninet Lines: 27 Message-ID: <6qsv6g$4ip$1@cubacola.tninet.se> References: <35D0BF71 DOT 9FB3EE0B AT unb DOT ca> <625A1.98$Qi3 DOT 473241 AT sapphire DOT mtt DOT net> NNTP-Posting-Host: du212-150.ppp.algonet.se To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Michel Gallant skrev i meddelandet <625A1.98$Qi3 DOT 473241 AT sapphire DOT mtt DOT net>... > >Endlisnis wrote in message <35D0BF71 DOT 9FB3EE0B AT unb DOT ca>... >>Michel Gallant wrote: >> >> >>use: >>volatile int counter = 0; All registers and addresses concerning the parallel-port should be treated as volatile addresses. That should do it >> >>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. >>