Article View: comp.lang.modula2
Article #2181Re: Generic stack implementation
From: Peter Moylan
Date: Mon, 14 Dec 1992 02:37
Date: Mon, 14 Dec 1992 02:37
27 lines
1508 bytes
1508 bytes
In article <911288c.32.724187845@ace.acadiau.ca>, 911288c@ace.acadiau.ca (HON (EDWIN) KIN CHUNG) writes: >>VAR >> [...] >> location: ADDRESS; >>BEGIN >> [...] >> INC(location, TSIZE(WORD)); > ^^^^^^ > parameter not correct type ?? > > Is this some problem ...??? > I am using TopSpeed Modular-2. TopSpeed Modula-2 won't let you do arithmetic on addresses. And a good thing, too, in my opinion. Address arithmetic is one of the most non-portable things you can do, and I'm a little shocked to see an example of it in a textbook. There's a procedure in one of the TopSpeed libraries called AddAddr or something similar (sorry I can't be more explicit, my TopSpeed manuals are at home) which will be an adequate substitute for the INC in this example. A better solution, though, would be to redesign the algorithm so that it didn't need to do address arithmetic. -- Peter Moylan eepjm@wombat.newcastle.edu.au
Technical Details
Message-ID:
<1992Dec14.133750.1@wombat.newcastle.edu.au>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!sol.deakin.OZ.AU!news.cs.uow.edu.au!seagoon.newcastle.edu.au!wombat.newcastle.edu.au!eepjmReferences:
<9212091316.AA14856@elg> <911288c.32.724187845@ace.acadiau.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2 Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!sol.deakin.OZ.AU!news.cs.uow.edu.au!seagoon.newcastle.edu.au!wombat.newcastle.edu.au!eepjm From: eepjm@wombat.newcastle.edu.au (Peter Moylan) Subject: Re: Generic stack implementation Message-ID: <1992Dec14.133750.1@wombat.newcastle.edu.au> Lines: 27 Sender: news@seagoon.newcastle.edu.au Organization: University of Newcastle, AUSTRALIA References: <9212091316.AA14856@elg> <911288c.32.724187845@ace.acadiau.ca> Date: Mon, 14 Dec 1992 02:37:50 GMT