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


Groups > comp.lang.forth > #45442

Re: NAME! and NAME@ versus !NAME and @NAME

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: NAME! and NAME@ versus !NAME and @NAME
Date 2016-02-11 10:51 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2016Feb11.115159@mips.complang.tuwien.ac.at> (permalink)
References <8660xvzkm2.fsf@molnjunk.nocrew.org>

Show all headers | View raw


Lars Brinkhoff <lars.spam@nocrew.org> writes:
>Leo Brodie's Forth style guide says:
>
>  save value of (to stack)          @name
>  restore value of                  !name
>  store into                        name!
>  fetch from                        name@
>
>I don't understand when it's appropriate to use @name or !name, and
>when to use name@ or name!.
>
>My research so far: The Standard use the latter a lot: C!, 2! R@, F!,
>DEFER@, etc.  But the former seems to be rare.  I found !CSP and !BITS
>in some traditional Forths.  Machine Forth use A!/A@ to access the
>contents of the A register, and !A/@A to access memory.
>
>Any insights?

The guide you cite above is at odds with the practice in the standard
and elsewhere.  The practice I have experienced is to use the type as
prefix (c@ d@ f@), and to use postfixes for variants; e.g., if you
want to have an unaligned load, you might have @u d@u f@u.

- 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 2015: http://www.rigwit.co.uk/EuroForth2015/

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


Thread

NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-11 10:01 +0100
  Re: NAME! and NAME@ versus !NAME and @NAME Mark Wills <markwills1970@gmail.com> - 2016-02-11 01:56 -0800
    Re: NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-11 12:04 +0100
    Re: NAME! and NAME@ versus !NAME and @NAME "HAA" <someone@microsoft.com> - 2016-02-14 09:28 +1100
      Re: NAME! and NAME@ versus !NAME and @NAME hughaguilar96@gmail.com - 2016-02-13 21:45 -0800
  Re: NAME! and NAME@ versus !NAME and @NAME Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-02-11 05:02 -0500
  Re: NAME! and NAME@ versus !NAME and @NAME lehs <skydda.barnen@gmail.com> - 2016-02-11 02:40 -0800
    Re: NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-11 12:10 +0100
      Re: NAME! and NAME@ versus !NAME and @NAME lehs <skydda.barnen@gmail.com> - 2016-02-11 03:37 -0800
        Re: NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-11 13:04 +0100
  Re: NAME! and NAME@ versus !NAME and @NAME anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-11 10:51 +0000
    Re: NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-11 12:33 +0100
      Re: NAME! and NAME@ versus !NAME and @NAME Coos Haak <chforth@hccnet.nl> - 2016-02-11 13:01 +0100
        Re: NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-11 13:11 +0100
        Re: NAME! and NAME@ versus !NAME and @NAME Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-02-11 13:30 +0000
      Re: NAME! and NAME@ versus !NAME and @NAME anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-11 12:15 +0000
        Re: NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-11 13:35 +0100
          Re: NAME! and NAME@ versus !NAME and @NAME Mark Wills <markwills1970@gmail.com> - 2016-02-11 05:06 -0800
            Re: NAME! and NAME@ versus !NAME and @NAME Chris Curl <ccurl609@gmail.com> - 2016-02-11 05:18 -0800
    Re: NAME! and NAME@ versus !NAME and @NAME Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-02-11 13:27 +0000
  Re: NAME! and NAME@ versus !NAME and @NAME stephen@mpeforth.com (Stephen Pelc) - 2016-02-11 12:35 +0000
  Re: NAME! and NAME@ versus !NAME and @NAME "HAA" <someone@microsoft.com> - 2016-02-12 16:58 +1100
    Re: NAME! and NAME@ versus !NAME and @NAME "HAA" <someone@microsoft.com> - 2016-02-12 17:41 +1100
      Re: NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-12 08:56 +0100
    Re: NAME! and NAME@ versus !NAME and @NAME Lars Brinkhoff <lars.spam@nocrew.org> - 2016-02-12 08:13 +0100
      Re: NAME! and NAME@ versus !NAME and @NAME "HAA" <someone@microsoft.com> - 2016-02-13 01:36 +1100
        Re: NAME! and NAME@ versus !NAME and @NAME Coos Haak <chforth@hccnet.nl> - 2016-02-12 22:46 +0100

csiph-web