From: "Michel Gallant" Newsgroups: comp.os.msdos.djgpp References: <35D0BF71 DOT 9FB3EE0B AT unb DOT ca> Subject: Re: Detecting interrupt on printer port Lines: 27 Message-ID: <625A1.98$Qi3.473241@sapphire.mtt.net> Date: Wed, 12 Aug 1998 00:08:34 GMT NNTP-Posting-Host: 142.177.38.71 NNTP-Posting-Date: Tue, 11 Aug 1998 21:08:34 ADT Organization: MTT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Endlisnis wrote in message <35D0BF71 DOT 9FB3EE0B AT unb DOT ca>... >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. > Thanks for the suggestion, but the problem lies elsewhere. For starters, this program works fine when it is changed to intercept INT8 (timer tic), and besides that, I tried your recommendation with no effect. Thanks anyway, though. Suggestions, anyone? I'd appreciate any help. Michel Gallant