home .. forth .. colorforth mail list archive ..

Re: [colorforth] How is colorForth different from other Forths?


Hi John, Mark

| > > explain why you shouldn't use them. I'd prefer
| > F-83's >MARK <RESOLVE
|  > approach - to me it's a bit clearer.
|
| Looking at the wordlist link that Mark provided I
| see two words that might handle this.  The words
| are:
|
|  "mark" - Record current dictionary pointers and
|  "empty" - Record current dictionary pointers

If you look at my implementation of DLL procedure import, you'll see that
I'm doing the following:

: console [ 0 ]  import Alloc Console ;
where 'import' is a macro, and Alloc Console are Capitalized comments. I
convert tokens Alloc Console  into acsii string 'AllocConsole'#0 and call
GetProcAddress().

It all compiles into code like this:

console:
        DUP_
        xor    eax, eax        ; I must clear S flag in this ugly manner
        DROP                    ; an alternative would be assembling a short
jump forward
        jns    @f
        db    'AllocConsole', 0
@@:
        DUP_
        call    kelnel32.AllocConsole
        ret

As you can see, the string is needed only at compile time
Now, I'd like to do the following:
- compile the string onto top of dictionary
- call GetProcAddress
- forget the string

I'll try mark/empty, looks like it does the same, thank you for the
suggestion !

2 Mark: I'll reply to your letter later when I have more time.

Thanks,
Roman






---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com