Program and/or Return Stack (AREV Specific)
At 07 AUG 1998 03:50:58PM Mike Marling wrote:
Is there any way to gain access to the Return Stack (or the Program Stack) within an RBasic program (not within the Debugger).
I want to limit the number of recursive calls to a specific routine and the easiest and cleanest way would be to look at the Return Stack and see how many times the program name appears.
Thanks…Mike.
At 08 AUG 1998 07:39AM Eric Emu wrote:
As I understand it the program stack only has entries for objects once, ie. each program is cached in string space once. The return stack relies on entries in the descripter array, ie. there are multiple instances of data for each invocation of the program.
The descripter array's structure is harder to understand, as it contains variables, pointers to variables, and other descripters which appear to denote which programs belong to which variables. You'd have to interpret the return stack from these somehow.
You shouldn't be writing recursive functions anyway It's not
recommended by 83% of all code-cutting emus.
Eric
At 08 AUG 1998 08:12AM Gary Gnu wrote:
However, 100% of programming gnus recommend the ARev Developers Series to their patients who chew gum. In one series (the 3rd I think, where Sheridan dies at Xanadun) contains a program that will return the program stack and the return stack to you.
Gary Gnu
At 08 AUG 1998 06:38PM Mike Marling wrote:
I agree with the 83% of all code-cutting emus, but there are times in every emus life that just scream out for recursion. Besides, making ARev look and feel like object-oriented code means that the pesky user might layer on the recursive calls over and over and over and over and over….(you get the picture right??)
At 08 AUG 1998 07:20PM Samuel Taylor Coleridge Emu wrote:
Rime of the Ancient AREV Hacker There was an ancient code scribe Who stoppeth one of three "By thy shoes and orthopaedic socks Wherefore thou stoppest me" He had a tale, a tale of woe A tale of such despair That when he looked in memory For stuff, it wasn't there He sought it far he sought it wide He sought each paragraph And every sixteen bytes he sought It did not make him laugh He sought stuff in RAM far and wide And nearly had a seizure The more he sought in memory The more he had amnesia Oh woe betide the string space Chock full of lazy commons Waxing, waning, yielding nought But Gommorahs and Sodoms He looked for all @variables but some of these were hiddens in binary in memory encrypted for its riddance He spied descripters' table Engorged with ten byte lines Ten byte blocks - some parable - They could make do with nine Lots of little hex FF's append each record there But do we ever use them? No. And what does AREV care? He sought the dreaded $retstack and $progstack and the stack The stack was full of data! (That's a sure sign of attack) He tried collapsing objects And obscure compiler options And then he shot the EXE hot with chkdsk, by adoption The disk moaned here the disk moaned there The disk lost bits and bearings-thus The disk was killed, each table filled With ascii multifarious All his want, to match up clean Descripters, and their boss routine If only he'd not made such queries And instead subscribed to the Developer Series.
At 09 AUG 1998 03:52PM Mike Marling wrote:
Me thinkth they smoketh somethingth!