In a compiled word, is there a way to clear all entries on the data stack simultaneously without using the 'drop' word ?
Thinking of a situation where one passes multiple entries on the data stack when calling a word and exits prematurely without using all the entries on the data stack.
Does it involve adjusting the data Stack Pointer ?
Out of curiosity I see the words SP@ and SP! mentioned in FF quick reference guides but it's not apparent SP! is available when listing 'words sp' from the FF terminal connection.
TIA, Simon.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In a compiled word, is there a way to clear all entries on the data stack simultaneously without using the 'drop' word ?
Thinking of a situation where one passes multiple entries on the data stack when calling a word and exits prematurely without using all the entries on the data stack.
Does it involve adjusting the data Stack Pointer ?
Out of curiosity I see the words SP@ and SP! mentioned in FF quick reference guides but it's not apparent SP! is available when listing 'words sp' from the FF terminal connection.
TIA, Simon.
Normally you would use drop. It adjusts the stack pointer.
You could use also SP!.
For some reason I removed it from the wordlist.
I guess I thought it is not needed in practice by application code.
So SP! is not available in the current version of FF ?
SP! is not recognised by my FF either interactively or compiled.
It is not available. I will put it back when I get back to maintaining FF.
If you are in a hurry you can modify the FF source and recompile.