Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!rutgers!att!pacbell!ditka!qiclab!m2xenix!randy
From: randy@m2xenix.UUCP (Randy Bush)
Newsgroups: comp.lang.modula2
Subject: Re: FUNNY Eight Co-Queens
Keywords: coroutines, Logitech 3.0, BUG
Message-ID: <353@m2xenix.UUCP>
Date: 14 Aug 89 18:35:50 GMT
References: <819@eutrc3.urc.tue.nl>
Reply-To: randy@m2xenix.UUCP (Randy Bush)
Organization: Pacific Systems Group, Portland Oregon US
Lines: 26

I played a bit with your Eight Queens program, and believe I can help explain
the anomaly.

First, I would warn that you had two FOR control variables that were not local
to the immediate scope.  Yes, loose compilers seem to allow this, but it is
not legal.  I also had to modernize the code a bit (SIZE is now a pervasive,
and PROCESS has become ADDRESS).

As to the problem, I believe it to be that the value of the global variable
initCol, which is being used as a a FOR control variable, is being assigned to
myCol in the coroutine procedure Placer.  The compiler(s) having problems have
probably stashed the FOR control value in a register and have not noticed the
access within the coroutine as there was no blatant procedure call of Placer.

Credit for detecting this problem should go to the OSI compiler for detecting
a value strange error at the assignment to myCol.  [Conflict of interest note:
Although I no longer work at OSI, I did have just a bit to do with the
implementation.]

Hope this helps.

randy
-- 
uunet!tektronix ----\
sun!nosun --------- qiclab ---- m2xenix!randy    or    randy@m2xenix.uucp
uunet!oresoft ------------------/