CASE Statement Limit
Goog
Posts: 65
I'm writing a pretty complicated SPIN program which requires WAAAY more than 64 Cases for a Case statement, but the compiler doesn't want to do more than that.· Any suggestions? Will If...ElseIf... work or is there a limit for that, too?
Thanks,
Goog
Thanks,
Goog
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
Goog
CASE x
· 0..99: dothis
· 100..199: dothisinstead
I love playing with the Propeller, too. I'm having so much fun writing objects for it, that it's hard to work on the next-generation chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
What is the next generation chip going to be ???··
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*.*
Ibsen
" It's nice to be important, but
·· more important to be nice... "
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
Chip Gracey
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Doing my part to keep the Commodore 64 alive!
http://www.commodorestuff.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
Are you, by any chance, writing an interpreter?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Doing my part to keep the Commodore 64 alive!
http://www.commodorestuff.com
·
A switched interpreter may not work as well as you want it to. SPIN gets about 20KIPS@80MHz; figuring 100:1 interpretation penalty for a switched interpreter (particularly considering the RAM access speed), I don't think you're going to keep up with a C64.
You might look into Forth-style threaded interpreters. Googling that phrase will yield results. If SPIN allows indirect function calls (calls through function pointers), you could implement it entirely in SPIN...though I think you'll be happer in assembly in this case, performance-wise.
Neat project; I look forward to seeing what you do.