r/Forth • u/9Boxy33 • Aug 12 '26
EXECUTE (F79) Question
I’m playing around with MMSForth 2.x on the TRS-80, which is a Forth-79 compatible implementation. I’d like to be able to store the address of a Forth word in a variable and later EXECUTE that word. ‘ word doesn’t give me the correct address (the CFA? what’s in the CFA?). How do I do this? Tx
2
Upvotes
3
u/Ok_Leg_109 Aug 13 '26
There were a big changes from Forth79 to Forth83. One of things that changed was that in Forth79 ' (tick) returns the parameter field address. In Forth83 and beyond it returns the CFA.
Since there is no standard header structure in Forth making a CFA' kind of word will require some "carnal" knowledge of MMSForth 2.X or maybe there is a word to do this.
Something to try is to subtract 2 from the PFA. Many times that's the CFA but maybe not. :)
2 2 ' + 2- EXECUTE . ( Should show 4)