Loading...
 
EMFORTH stacks.

stacks

As well as the usual data and return stacks SAM7 EMforth has a bunch of others.

It has...
An object stack.
A message stack.
A vocabulary stack.
A register stack - for the assembler.
An auxiliary stack - for the assembler to remember immediates which need to be done in a lookup table.

Data, return, object and message use registers as stack pointers for speed.

In future stacks may be defined as objects. This is hard to do for the kernel but easy for higher level code.

There would be one or more class of "Stack" and the individual stack would be instances of that class.

It would avoid have lots of similar words defined for every stack.

Now I have RP! DP! OP! MP! AUX! VP! to reset the various stack.

If they were instances of a class you'd have something like this.

reset AUXstack, reset Vstack etc. where "reset" is a message and AUXstack etc are instance of the class Stack.
The same chuck of code does the work for all stacks so space is saved.
You could still define the old style words by doing something like..
: VP!
   reset Vstack 
;






Created by System Administrator. Last Modification: Saturday 26 of January, 2008 21:53:15 AEDT by eddie.

Main Index

Switch Theme

Shoutbox

eddie, 11:29 AEST, Sat 22 of Jun, 2024: Offline wiki repair is mostly done. It is running on tiki-27-alpha
eddie, 18:14 AEST, Sun 12 of May, 2024: Phase one of wiki repair is to upgrade to V22 (the last version with image galleries). All 150 images in the wiki-up directory are broken and need manual wiki page repairs.
admin2, 19:45 AEST, Sun 28 of Apr, 2024: Tested tiki 26.2 on a raspberry pi. Tiki 26 does not support image galleries so I have to try again after migrating images to file galleries.
eddie, 13:04 AEST, Thu 10 of Aug, 2023: Offline tiki 26 upgrade went badly. Waiting for 26.1. Will limp on.
System Administrator, 18:45 AEST, Wed 26 of Jul, 2023: Recovered from lockout but unable to upgrade to V24

Last-Visited Pages

Online Users

13 online users