Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: How can " dup drop " be anything other than a nop Date: Fri, 02 Oct 2015 22:29:27 -0400 Organization: Aioe.org NNTP Server Lines: 58 Message-ID: References: <25ebdfea-1331-4e72-80a9-8655570855cb@googlegroups.com> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:42332 On Fri, 02 Oct 2015 20:05:39 -0400, Bob Armstrong wrote: > On Thursday, October 1, 2015 at 11:02:07 PM UTC-6, Rod Pemberton wrote: >> On Wed, 30 Sep 2015 22:20:42 -0400, Bob Armstrong wrote: >> > | ... weird issue w simply nested fns remains >> > >> > text> "lf tokcut rho | |>| 1432 | works >> > : tst "lf tokcut ; text> tst rho | works not >> > : tst "lf dup drop tokcut ; text> tst rho | works >> > : tst dup drop "lf tokcut ; text> tst rho | works not >> > >> > Without even knowing anything else , how can a " dup drop " have any effect ? >> >> Is it that "dup drop" is doing something or fixing something, >> or rather is it that _anything_ in between "lf and tokcut fixes >> the issue? ... > > Good point . Seems to be anything that touches the stack . > I first saw the behavior when I stuck in a ' $.s for debugging . > I just tried > > : ts ; > : tst "lf ts tokcut ; text> tst rho | works not . > > So seems dependent on stack action . > also > > : tst tokcut ; text> "lf tst rho | works just to test that . > > [...] > > It occurred to me that maybe an extra copy of the "lf was getting used . > > But > : tst "lf 1 drop tokcut ; text> tst rho |>| 1475 | works > > and a raw 1 would bomb tokcut . Since Reva or Cosy keeps the TOS (top-of-stack) in register, pushing a one (1) to the stack, places one (1) in EAX, and saves EAX's prior value on the stack, which is then restored by DROP, the same as DUP DROP. So, '1 DROP' can't be used to rule out corruption of EAX or modification of it's value. At this point, my suspicions would be: 1) corruption of EAX 2) a saved address on the return stack not accounted for and in the way of needed data 3) something else off-by-one etc Is tokcut a Reva or Cosy word? Rod Pemberton