programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: forth word dependencies

From: Elizabeth D Rather <erather_at_forth.com>
Date: Wed, 1 Feb 2006 15:17:08 -0800

> -----Original Message-----
> From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On Behalf
> Of Jos'h Fuller
> Sent: Wednesday, February 01, 2006 7:17 AM
> To: sftalk_at_forth.com
> Subject: [sftalk] Re: forth word dependencies
>
>
> Hi,
>
> On Wed, Feb 01, 2006 at 10:07:17AM -0500, Dr. Roger Dube wrote:
> > Content-Type: text/plain;
> > charset="us-ascii"
> > Content-Transfer-Encoding: 7bit
> > Is there a SwiftForth word that creates a dependency map of
> words below it?
> >
> > The idea here would be to create a map of a defined word, and
> then a list of
> > the words that were used to define it, the words used to define
> them, etc.
> > in an iterative fashion.
>
> I'm a little out of the loop in Swift right now, but most full featured
> Forth's have a word (or the equivalent therof) called "SEE", which will
> decompile a target (as in "SEE MYWORD"). I'm certain that SF should have
> such a thing and since you have the source, you could probably bend it
> to your evil ends as you describe.
>
> Be sure to have it stop once it finds the ultimate CODE words though...
>

SEE isn't going to be very helpful, because it shows what was compiled -- in
other words, the optimized machine code. That can be very interesting, but
isn't what Roger was asking for.

I don't actually think SwiftForth has a feature showing all the words
*below* a word of interest, although it does have a cross-reference called
WHERE or WH that shows all the words that call a word of interest. The way
to get this information manually would be to use LOCATE to show the source
for the word, and then successively LOCATE each of the words it calls.

Another strategy would be a combination. If you SEE your word, you'll
probably see a mix of machine code and CALLs. You can then SEE or LOCATE
the words that are CALLed, as you can't go below the code for the in-lined
primitives. It may not be obvious from this strategy how the word of
interest was built, though, because a phrase such as DUP 0< IF is going to
generate just:

EBX EBX OR
46E1BD JNS

so you don't have the information of what high-level words went into that.
It all depends on what Roger is really looking for.

Cheers,
Elizabeth

============================================
Elizabeth D. Rather
FORTH Inc. +1 310-491-3356
5155 W. Rosecrans Ave. Fax: +1 310-978-9454
Suite 1018 (US & Canada) 800-55-FORTH
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time applications since 1973."
============================================

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed Feb 01 2006 - 15:15:38 PST

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:20 PST