Dr Jefyll wrote:
IamRob wrote:
Or how do I force it to do that.
To do it within a colon definition I think what you need is something like this. Notice how the nasty bit is bookended by
[ and
] (to suspend then resume compilation).
BTW, welcome, IamRob !
Thanks, I was trying to slip under the radar and look like I have been here all along.
I actually got bored of programming in assembly and when I got a taste of Forth, I was hooked.
: PRINT-A-ZERO ( --- )
[ 0 ' CLIT CFA , C, ]
Yep that works, but slightly modified for real numbers that are not words, but your example shows how I can do it for 0, 1, 2, 3 as well. Thanks.
: TEST CLIT [ 80 C, ] OUT C! ;
It took a little bit to wrap my head around DOES>, and the LBRACKET and RBRACKET were on my to-do list. Now that I got an example of that, just got one more mis-understood word, ";CODE".
I understand what it does, I just don't understand how to enter it, and the code that follows, from the keyboard.
POSTPONE was a common word used a lot to make other words on other platforms, and was finally able to duplicate it in ProForth.
Things are slowly coming together and I enjoy reading everyone's posts here on efficient programming and ideas for words. I look forward to adapting some of your words to the ProForth model I am working on.
And one last thing, is there a resource for source listings of any applications that were written in Forth?
So far I have collected 2 games, 2 applications and 1 demo written in forth and am greedy for more.
I will probably stay mostly in the background since I am no where near your levels of expertise and will pop in with a question now and again. But thanks! Great group of people.