Newsgroups: fj.lang.c
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!spinnews!spin-hsd0-tky!inet-tsb!tis2!eecisc!hiro
From: hiro@ams.eec.toshiba.co.jp (Hiroyuki Tsukahara)
Subject: Re: 'volatile' effect
In-Reply-To: kohno@nikongw.nikon.co.jp's message of Tue, 25 Jul 1995
 01:57:27 GMT
Content-Type: text/plain; charset=ISO-2022-JP
Message-ID: <HIRO.95Jul27183013@eecmfi.ams.eec.toshiba.co.jp>
Sender: news@eec.toshiba.co.jp
Nntp-Posting-Host: eecmfi
Organization: SEMICONDUCTOR SYSTEM ENGINEERING CENTER, TOSHIBA Corp., Japan
References: <DC91Fr.BMH@nikongw.nikon.co.jp>
Mime-Version: 1.0
Date: Thu, 27 Jul 1995 09:30:13 GMT
Lines: 37
Xref: galaxy.trc.rwcp.or.jp fj.lang.c:1944
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.c&nb=1944&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.


  $BDM86!wEl<G$G$9!#(B

>>>>> ">" == Y Kohno @ Nikon Co <kohno@nikongw.nikon.co.jp> writes:
In article <DC91Fr.BMH@nikongw.nikon.co.jp> kohno@nikongw.nikon.co.jp (Y.Kohno @ Nikon Co.) writes:

> void wait(void) {
> extern intTimer;
> Timer = 10;
> while (Timer) {};
> }
>  volatile $B$r!VI>2A$7$F$/$l$J$$!W%3%s%Q%$%i>e$G!"(B
> $B>e5-$N$h$&$J8z2L$rHr$1$k$K$O!"$I$N$h$&$K%=!<%9$r=q$/$N$,(B
> $BNI$$$N$G$7$g$&$+!)(B

  $B$3$s$J$b$s$G$$$+$,$G$7$g$&!)(B

void setTime(int t) {
extern int Timer;

Timer = t;
}

void wait(void) {
extern int Timer;

setTime(10);
while(Timer){
}
}

#  $B:GE,2=$G!V(Bwhile(Timer)$B!W$N>r7oH=Dj$,A0$N!V(BTimer=10$B!W$h$j>o$K(Btrue$B$H$J(B
#$B$k$HH=CG$5$lL58B%k!<%W$K$J$k$N$@$H;W$$$^$9!#(B

--
Hiro

