Sorry in advance for my web-based email... I'm at work.
What I do (for example) would be:
CREATE FOO 0 ,
Now after the EXE is created, from within SF I would do something like th=
e
following:
\ Get byte distance from name to body
' FOO DUP >BODY SWAP >NAME - .
Now I open up a hex editor on the EXE. Do a search for "FOO" and then mov=
e
down x number of bytes from the name. I plainly see data, followed by 4 0=
bytes, then the next word's link, etc. I just overwrite those 4 bytes wit=
h the
data desired from within the hex editor.
When I launch my program and do a FOO @ I still get 0, though. I'm sure I=
'm
just changing the wrong location. I'll have to try using $1234ABCD or
something instead of 0. But part of my problem, I believe, is a non-thour=
ough
understanding of the SF dictionary. Each word appears to be entered twice=
in
the dictionary. I assume this is because SF is using a hashing function
instead of a linked-list? More info here would be helpful.
I'm glad it works for everyone else, though, at least that lets me know t=
hat
it is possible.
Jeff
"Gene LeFave" <gene_at_tekdata.com> wrote:
Jeff,
Have you tried changing the source, and then looking in the exe, =
just to be sure that you've got the right location.
I was able to change the value of D/Y in sf.exe without a problem.
How exactly, are you changing the value of foo.
Gene
> This is driving me nuts, so hopefully the gurus can help. I'm working
> on a registration system for my product. One of the checks is that in
> the program there is:
> =
> CREATE foo 0 ,
> =
> Now, later on in the code is a check function:
> =
> : is-registered ( -- flag ) foo @ 0<> ;
> =
> Of course it is more complicated than this, but you get the idea. Now,
> on my web server, I directly edit the final EXE file and replace the 0
> with a different value that is specific to the end-user. I'm finding
> the location to put it with a hex editor, searching on "foo" and
> moving 12 bytes downstream of the name (where there is 4 00 bytes).
> =
> However, when executed foo @ still returns 0. I assume that I'm just
> writing the constant into the wrong memory location, but what worries
> me is that perhaps SF is doing something I'm not expecting and that I
> can't do what I want.
> =
> Thanks for any suggestions.
> =
> -- =
> Best regards,
> Jeff mailto:jma_at_mfire.com
> =
> =
> ----------------------------------------------------------------------
> 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
> ----------------------------------------------------------------------
> =
----------------------------------------------------------------------
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
----------------------------------------------------------------------
----------------------------------------------------------------------
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 Fri Dec 12 2003 - 09:13:01 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 09-Feb-2012. Archive updated nightly.