www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/11/22:00:39

From: "Michel Gallant" <mgallant AT NOSPAM DOT grassroots DOT ns DOT ca>
Newsgroups: comp.os.msdos.djgpp
References: <C22A1.62$Qi3 DOT 325552 AT sapphire DOT mtt DOT net> <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

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019