Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #1651
| From | "Rod Pemberton" <do_not_have@noavailemail.cmm> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: STATE |
| Date | 2011-04-29 13:56 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <ipetrr$vjv$1@speranza.aioe.org> (permalink) |
| References | <496ffa3f-5ac9-45a9-9190-bb3875e8b44e@m40g2000vbt.googlegroups.com> <ipciin$gie$1@speranza.aioe.org> <d78fa1a4-efa0-435f-8d3a-d97cc3a439fd@24g2000yqk.googlegroups.com> |
"MarkWills" <markrobertwills@yahoo.co.uk> wrote in message
news:d78fa1a4-efa0-435f-8d3a-d97cc3a439fd@24g2000yqk.googlegroups.com...
>
> I guess I should have said VALUE rather than
> VARIABLE. The point being, STATE would return its value, rather than
> its address, since there is rarely (if ever) a need to directly write
> to STATE, especially in a user program. I accept its largely a moot
> point; clearly there are thousands of lines of legacy code that would
> break if it were to be changed now.
>
I don't know if it's moot. E.g., the version of the fig-Forth spec. that's
available as text, says TIB returns an address:
"
TIB --- addr U
A user variable containing the address of the terminal
input buffer.
"
DP is stated to be implemented the same way as TIB. The fig-Forth memory
map shows the same thing. I.e., both should be variables that place the
address on the stack:
"
DP --- addr U,L
A user variable, the dictionary pointer, which contains
the address of the next free memory above the dictionary.
The value may be read by HERE and altered by ALLOT.
"
When working on my interpreter, I implemented TIB that needed to be fetched,
just like DP. However, much example code using TIB just didn't work! So, I
checked some Forths on their use of TIB and DP. Many didn't have, or don't
allow, access to TIB or DP. When present, TIB is not fetched. The one
exception being 8088 fig-Forth. When present, DP is fetched. So, I'm only
aware of one Forth interpreter that follows the fig-Forth spec. in regards
to TIB being a variable. I.e., almost no Forths, that use TIB, correctly
implement TIB as a variable. Yes? They both should work the same way, and
user variable's return the variable's address, not the variable's content
which are addresses in this case. Correct?
I tried both of these sequences to see if TIB is fetched:
TIB @ 5 TYPE
TIB 5 TYPE
I used this sequence to determine if DP is fetched:
HERE . 1 ALLOT HERE . DP . DP @ .
BTW, I saw someone say in post here that TIB needed to be 80 per user. If
you follow the fig-Forth spec., it's 82, for EOL...
Rod Pemberton
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
STATE MarkWills <markrobertwills@yahoo.co.uk> - 2011-04-27 12:41 -0700
Re: STATE Alex McDonald <blog@rivadpm.com> - 2011-04-27 13:04 -0700
Re: STATE MarkWills <markrobertwills@yahoo.co.uk> - 2011-04-27 13:13 -0700
Re: STATE Alex McDonald <blog@rivadpm.com> - 2011-04-27 13:45 -0700
Re: STATE "P.M.Lawrence" <pml540114@gmail.com> - 2011-04-28 03:00 -0700
Re: STATE Alex McDonald <blog@rivadpm.com> - 2011-04-28 04:09 -0700
Re: STATE Alex McDonald <blog@rivadpm.com> - 2011-04-28 04:10 -0700
Re: STATE Micke <oh2aun@gmail.com> - 2011-04-27 13:20 -0700
Re: STATE MarkWills <markrobertwills@yahoo.co.uk> - 2011-04-27 13:26 -0700
Re: STATE MarkWills <markrobertwills@yahoo.co.uk> - 2011-04-27 13:30 -0700
Re: STATE Elizabeth D Rather <erather@forth.com> - 2011-04-27 11:13 -1000
Re: STATE Elizabeth D Rather <erather@forth.com> - 2011-04-27 17:17 -1000
Re: STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-04-29 06:14 -0500
Re: STATE Elizabeth D Rather <erather@forth.com> - 2011-04-29 08:47 -1000
Re: STATE MarkWills <markrobertwills@yahoo.co.uk> - 2011-04-29 14:07 -0700
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-27 19:22 -0700
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-30 08:18 -0700
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-30 08:26 -0700
Re: STATE "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-04-30 03:24 -0400
Re: STATE stephenXXX@mpeforth.com (Stephen Pelc) - 2011-04-30 11:41 +0000
Re: STATE stephenXXX@mpeforth.com (Stephen Pelc) - 2011-04-30 11:53 +0000
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-30 08:48 -0700
Re: STATE anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-28 08:59 +0000
Re: STATE Brad <hwfwguy@gmail.com> - 2011-04-28 08:01 -0700
Re: STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-04-28 12:16 -0500
Re: STATE Elizabeth D Rather <erather@forth.com> - 2011-04-28 09:47 -1000
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-28 15:56 -0700
Re: STATE Brad <hwfwguy@gmail.com> - 2011-04-29 07:49 -0700
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-29 11:47 -0700
Re: STATE anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-29 17:30 +0000
Re: STATE Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-04-28 17:47 +0000
Re: STATE Elizabeth D Rather <erather@forth.com> - 2011-04-28 09:50 -1000
Re: STATE "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-04-28 16:32 -0400
Re: STATE MarkWills <markrobertwills@yahoo.co.uk> - 2011-04-29 02:11 -0700
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-29 07:24 -0700
Re: STATE "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-04-29 13:56 -0400
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-29 11:44 -0700
Re: STATE "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-04-29 15:45 -0400
Re: STATE Elizabeth D Rather <erather@forth.com> - 2011-04-29 10:22 -1000
Re: STATE BruceMcF <agila61@netscape.net> - 2011-04-29 13:31 -0700
Re: STATE Elizabeth D Rather <erather@forth.com> - 2011-04-29 09:07 -1000
csiph-web