-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular stacks #71
Comments
@massung I've never worked with any of Chuck's hardware and actually this is the first time I've ever heard of anyone using a Forth with a circular stack. Is there any literature out there about this? I'd like to learn more. |
http://www.greenarraychips.com/ Most of Chuck's chips have used circular stacks - for both parameter and return stacks - for quite some time. The F18A is a personal favorite as far as the spec goes (I haven't actually had the pleasure of working with one): http://www.greenarraychips.com/home/documents/index.html#F18A |
I've used the circular stacks on an F18A quite a bit and I'm completely sold on the idea. If you need to keep track you can. If you don't need to, don't bother. Also you can fill up the circular stack(s) and pop values repeatedly to save code and time. I think they're a great idea. |
Definite use them! Doing tricks with the circular stacks is one of the fun parts of programming the f18/ga144, but really I think it's often more about saving memory than it is about saving cycles. Remember each f18 computer has only 64 words of memory. Filling the circular stacks like Charley mentioned is super cool! An example of this is their code to find the resonant frequency of a watch crystal and continuously pump it to maintain oscillation. It's often used as a low duty cycle signal source for low powered applications. Once the code is done initializing oscillation and setting up the stack it can just spin in a tight loop writing values from the stack to the io port. you can read about it and see the code on page 8 of this application note |
@RickCarlino Greenarray's download index has just about everything on the f18 and ga144. Chuck's site colorforth.com was another resource and also had a bunch of interesting info about the tools and process of designing the chips. It's down now but I have a mirrored version hosted on github pages here and collected some links to the pages relevant to programming the ga144 here. |
One nifty 'feature' of a circular stack is that it makes it more attractive for a processor's ISA to include all 16 dyadic bitwise boolean operators (implemented as a Word-Width x 4-1 mux). For example The following snippet is actually from a byte-coded (i.e. token threaded) Forth virtual machine rather than a real processor, but it should illustrate the concept.
|
For those of you who have had the pleasure of working with some of Chuck's hardware, I'm generally curious: did/do you still actively work to keep the parameter stack balanced or did you just ignore it to save cycles?
Specifically, I'm thinking of instructions like
if
and-if
that don't popS
intoT
. Unless there was a specific reason to do so, would you waste the memory+cycles todrop
? Did you ever run into situations where the circular stack came back to haunt you if you weren't careful about balancing your work (and perhaps even would have preferred the hardware halt)?The text was updated successfully, but these errors were encountered: