Next: , Previous: , Up: Programming Tools   [Contents][Index]


5.24.6 Examining data and code

The following words inspect the stack non-destructively:

... ( unknown  ) varargs “(programmable)”
.s ( ) tools “dot-s”

Display the number of items on the data stack, followed by a list of the items (but not more than specified by maxdepth-.s; TOS is the right-most item.

f.s ( ) gforth-1.0 “f-dot-s”

Display the number of items on the floating-point stack, followed by a list of the items (but not more than specified by maxdepth-.s; TOS is the right-most item.

maxdepth-.s ( – addr  ) gforth-1.0 “maxdepth-dot-s”

A variable containing 9 by default. .s and f.s display at most that many stack items.

There is a word .r but it does not display the return stack! It is used for formatted numeric output (see Simple numeric output).

Depth ( unknown  ) unknown “Depth”
fdepth ( – +n  ) float “f-depth”

+n is the current number of (floating-point) values on the floating-point stack.

clearstack ( ... –  ) gforth-1.0 “clear-stack”

remove and discard all/any items from the data stack.

clearstacks ( ... –  ) gforth-1.0 “clear-stacks”

empty data and FP stack

The following words inspect memory.

? ( a-addr –  ) tools “question”

Display the contents of address a-addr in the current number base.

dump ( addr u –  ) unknown “dump”

Next: , Previous: , Up: Programming Tools   [Contents][Index]