( .S                             print the values on the stack )

need depth
: .s                              ( --- )
  cr depth                        ( find depth of stack)
  if                              ( depth > 0)
    sp@ 2+                        ( top stack addr)
    s0 @                          ( bottom stack addr)
    do
      i @ 0 d.                    ( fetch and print stack item)
      2                           ( each item is two bytes)
    +loop                         ( loop through the stack)
  else                            ( depth = 0)
    ." empty stack"               ( stack is empty)
  endif cr
;
