-
Content Count
288 -
Joined
-
Last visited
Posts posted by DavidC
-
-
On 5/16/2020 at 9:47 AM, TheBF said:Exercises:
1. Write a program (a Forth word) that waits for a KEY and prints "TRUE" if a '1' is pressed and "FALSE" if any other key is pressed. Call your program "ONE?"
2. Write a program that loops and prints "HELP!" continuosly UNTIL any key is pressed. Call your program "HELP"
3. Write a program the loops and prints "PRESS Q" continously until "Q" is pressed. Call your program WAITFORQ.
4. BONUS: Write a program that loops forever waiting for the ascii key you give it as a parameter.
Call the program WAITFOR. Usage: 65 WAITFOR (waits for "A")
Show your work here.
This is a great idea! I will work on these and post my results. Kind of like a interactive tutorial/book exercise where folks can get feedback from the teachers. I will try to come up with some answers within the next few days. When I get some alone time.. :)
-
2
-
-
On 5/16/2020 at 9:47 AM, TheBF said:So if you come BASIC where the system is protecting you from mis-steps at every turn, Forth feels like chaos.
Forth like Assembler lets you shoot yourself in the foot, in the head or anywhere you point the gun.
This sums it up perfectly.
-
1
-
-
It gets confusing. Quickly. The deeper I dig the more confused I get. That says more about me than it does about Forth. I sort of get it, and I have those moments where it all makes sense..but they are fleeting. I think about it in my sleep and it is gone in the morning. It all made sense...and then I forget what I was thinking.
-
2 hours ago, Lee Stewart said:Regarding leaving DO … LOOP early, there are times you may want to leave the loop with other conditions to continue the program without aborting. Enter, LEAVE .
: MYWORD ( n -- ) \ Execute loop n times or until <Enter> hit ( n ) 0 DO <do loop things> ?KEY 13 = IF \ <Enter> hit? <do other things> \ yup LEAVE \ this is the last time through loop THEN LOOP ;...lee
I had to change it to ?KEY 14, because I imagine just like you said, it is so fast that I couldn't release the <enter> key quick enough when I typed MYWORD <enter>. And..just out of pure coinicidence ?KEY 14 is <F5> on my laptop...ALMOST <F4> hahaha!!.
-
1
-
-
All right!! I spent about a hour this afternoon after work, pulling my hair out but I finally am getting somewhere. What I finally figured out was.. : LOOPY BEGIN KEY? 1 AND WHILE ." HELLO WORLD" REPEAT ; ( using turboforth ) this prints HELLO WORLD forever and ever until I press a EVEN numbered key. 2, 4, 6 ect. COOL! It's a start! @Lee Stewart I will try out your example. I didn't want to look at any posts on here today until I figured SOMETHING out on my own, mission accomplished!
-
2
-
-
Classic99 is a gift from Tursi to us. He built it for his use, he allows us to use it. Thanks man. You rock.
-
2
-
1
-
-
Before you can write your own subroutines, you have to know how. This means, to be practical, that you have written it before; which makes it difficult to get started. But give it a try. Mr. Moore quote.
-
1
-
-
Now this is gonna come off as weird, but ....LOGO is a bit like Forth..define definitions of stuff, what was first? LOGO or Forth?
-
Just now, GDMike said:Just back up your screens, as nothing is worse than losing a formula that wasn't easy to come up with.
Paper and pen, old school. I asked about that on stupid facebook page and yes. Notebook full of notes. Just in case..
-
-
1 minute ago, TheBF said:Turbo Forth doesn't have the word ?terminal. It is telling you that in error message.
I think you make it though.
: ?TERMINAL KEY? 2 = ;
Ahhh, yes. Yes. I can make the word a word.....I keep forgetting that. ( plus I don't know what I am doing ).
-
2
-
-
I am so confused......but thats ok, thats why questions need to be asked...
-
1
-
-
32 minutes ago, TheBF said:I suppose it would be wrong to leave out just how configurable Forth is.
You are free to make DO/LOOP yourself in a different way if you really want to dig into how the compiler is built.
Or you could just add ?BREAK to the existing LOOP routine like this.
(tested with FbForth)
COMPILE is used for ordinary (non-immediate) Forth words.
[COMPILE] is used to "compile" IMMEDIATE words.
Now when you use LOOP in a definition it will first COMPILE the address of ?BREAK followed by the address of LOOP ;
In other words you have changed the compiler!
You could do the same thing with AGAIN, UNTIL and REPEAT. If you made a block with these words in it, you could load it first for testing programs. Then all you loops would be "breakable".
Then re-compile without the breakable loops and run at full speed.
\ breakable loop : ?BREAK ?TERMINAL ABORT" *BREAK*" ; : LOOP COMPILE ?BREAK [COMPILE] LOOP ; IMMEDIATE \ test it : STAR 42 EMIT ; : STARS ( n -- ) 0 DO STAR LOOP ; 20000 STARS ( hit fctn 4 when you get tired of it)Note:For ANS Forth like CAMEL99 Forth change LOOP to:
: LOOP POSTPONE ?BREAK POSTPONE LOOP ; IMMEDIATESo.....all that must be in a block? Not immediate mode?
-
-
Questions about Forth and the f4 key on console or classic99..when I make a loop, you know..loop..how do I break the loop? Does it have to be part of the WORD or is it stuck in forever loop until I shut the computer off? Is there a f4 break key on a loop? A simple : TEST DO ." HELLO " LOOP ; it goes forever...how to stop it?
-
Haha..cool.. so did ya hear of the Forrest Fenn Treasure?? Inquiring minds want to know...I think the geniuses on here could figure this out pretty quick..if so inclined..
-
WAYYY of topic i guess but... have any of you heard of this? https://en.wikipedia.org/wiki/Fenn_treasure
I guess the guy buried a bunch of stuff and its like a treasure hunt to find it.. maybe its bullshit, maybe its real...I don't know.
-
Words are powerful tools. Even more powerful when misused.
A harsh lesson, one that will be with you forever. I cant say I never "f*cked up" when dealing with customers, In my business I deal with all kinds all day. I deal with the upper brass as well, my suppliers and sometime I say the wrong thing at the wrong time. Sometimes...who am I kidding, all the time.. but...after 40 years, they know me. Thats just Dave..lol. But, it still happens, it is human nature to speak your mind. consider it as.. Lesson learned.
-
@senior_falcon, Man you have skills! Very nice, they will be over the moon with that cabinet. It is absolutely beautiful! Now, get back to work on that GEM you have been teasing us with...hahaha...please...Sir.
-
I could go off, but I wont. I like this place and I dont wanna get banned.
-
1
-
-
My FG arrived today, and I am blown away by the amount of stuff on the pre-loaded card. (Which I believe is downloadable from whtech) It has just about EVERYTHING!! So cool. RXB, XB 2.6, The different flavors of Fourth...the list goes on and on...THIS IS AWESOME!!!
-
1
-
-
Being in lockdown is a true test of compatability...that is a fact. Nerves are being tested, patience is being tested. Cheryl had a She Shed. Now we are all up in each other all the time...not in a good way...LMAO. Space man..space......
-
2 hours ago, BillO said:Cool. It will be interesting to see what this machine can really do. The basic unit is almost useless, yet very easy on the eye (I'm a gearhead). I don't know what TI were thinking with their base BASIC and the limited RAM. I guess it was meant to be a teaser so you'd part with more money to get the stuff needed to make it useful.
With the CF7 and the FinalGrom you will be surprised at what this machine can do. Especially with the geniuses on this forum. It truly is amazing.
-
3 hours ago, BillO said:Marlin got back to me. It was shipped out on the 9th and is 120 miles away at this time. Should be here soon!
Awesome! Mine should be here in a day or so as well! Can't wait...

Forth Tutorials
in TI-99/4A Development
Posted
You mean...switch TO coffee? LOL...yeah. Good idea...🤣