Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #48535

Re: Implementation of LEAVE?

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Implementation of LEAVE?
Date 2016-06-26 10:16 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2016Jun26.121629@mips.complang.tuwien.ac.at> (permalink)
References <cf94fe95-4400-43db-8981-0c24d63e0749@googlegroups.com> <nknp7r$12ei$1@gioia.aioe.org>

Show all headers | View raw


"HAA" <someone@microsoft.com> writes:
>It doesn't need to be complicated.  This one is for ITC/DTC.  Compiler security
>checking not shown.
>
>0 value leav
>: DO  postpone (do)  leav  >mark dup to leav  postpone begin ; immediate
>: ?DO  postpone (?do)  leav  >mark  dup to leav  postpone begin ; immediate
>: LEAVE  postpone (leave)  leav , ; immediate
>: LOOP  postpone (loop)  <resolve  postpone then  to leav ; immediate
>: +LOOP  postpone (+loop)  <resolve  postpone then  to leav ; immediate

It looks to me like your LEAVEs point to the DO, and find the target
address there.  This means that (LEAVE) has one indirection more than
BRANCH, which also explains why you have a separate (LEAVE).
Certainly simpler than using BRANCH and filling in the branch target
at compile time, but this simplicity comes at a run-time cost.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2016: http://www.euroforth.org/ef16/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Implementation of LEAVE? alexinbeijing@gmail.com - 2016-06-23 02:01 -0700
  Re: Implementation of LEAVE? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-23 05:45 -0500
    Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-23 11:53 +0000
      Re: Implementation of LEAVE? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-23 12:06 -0500
        Re: Implementation of LEAVE? Paul Rubin <no.email@nospam.invalid> - 2016-06-23 12:19 -0700
          Re: Implementation of LEAVE? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-24 03:05 -0500
            Re: Implementation of LEAVE? JennyB <jennybrien@googlemail.com> - 2016-06-24 02:14 -0700
              Re: Implementation of LEAVE? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-25 04:19 -0500
                Re: Implementation of LEAVE? JennyB <jennybrien@googlemail.com> - 2016-06-25 03:38 -0700
                Re: Implementation of LEAVE? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-25 11:00 -0500
                Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-25 17:34 +0000
                Re: Implementation of LEAVE? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-26 12:14 -0500
                Re: Implementation of LEAVE? hughaguilar96@gmail.com - 2016-06-26 16:36 -0700
                Re: Implementation of LEAVE? hughaguilar96@gmail.com - 2016-06-26 17:57 -0700
                Re: Implementation of LEAVE? Alex McDonald <alex@rivadpm.com> - 2016-06-27 14:16 +0100
                Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-27 16:12 +0000
                Re: Implementation of LEAVE? Alex McDonald <alex@rivadpm.com> - 2016-06-27 22:31 +0100
                Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-27 14:21 +0000
                Re: Implementation of LEAVE? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-06-27 11:05 -0500
              Re: Implementation of LEAVE? JennyB <jennybrien@googlemail.com> - 2016-06-25 03:49 -0700
            Re: Implementation of LEAVE? JennyB <jennybrien@googlemail.com> - 2016-06-24 08:45 -0700
            Re: Implementation of LEAVE? JennyB <jennybrien@googlemail.com> - 2016-06-24 02:33 -0700
        Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-24 16:23 +0000
  Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-23 11:43 +0000
  Re: Implementation of LEAVE? alexinbeijing@gmail.com - 2016-06-24 11:41 -0700
    Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-25 05:18 +0000
      Re: Implementation of LEAVE? Brad Eckert <hwfwguy@gmail.com> - 2016-06-27 17:45 -0700
        Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-28 06:14 +0000
  Re: Implementation of LEAVE? Brad Eckert <hwfwguy@gmail.com> - 2016-06-24 15:30 -0700
  Re: Implementation of LEAVE? minforth@arcor.de - 2016-06-24 04:36 -0700
  Re: Implementation of LEAVE? Mark Wills <markwills1970@gmail.com> - 2016-06-25 07:51 -0700
    Re: Implementation of LEAVE? Coos Haak <chforth@hccnet.nl> - 2016-06-26 00:37 +0200
  Re: Implementation of LEAVE? Mark Wills <markwills1970@gmail.com> - 2016-06-25 08:29 -0700
  Re: Implementation of LEAVE? "HAA" <someone@microsoft.com> - 2016-06-26 15:31 +1000
    Re: Implementation of LEAVE? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-06-26 10:16 +0000
      Re: Implementation of LEAVE? "HAA" <someone@microsoft.com> - 2016-06-27 22:38 +1000
  Re: Implementation of LEAVE? Alex Dowad <alexinbeijing@gmail.com> - 2016-06-26 13:53 -0700

csiph-web