# Diagnostic tools

The unit at /lib/diag.fs provides word for system introspection.

## API

spit[] ( a u -- ) *B*
  Print data in range "a u" in chunks of 4/2/1 bytes (depending on binary width
  modulator) separated by spaces.

psdump ( -- )
  Print the contents of PS.

scnt ( -- n )
  Yields the number of elements in PS (not counting "n").

rcnt ( -- n )
  Yields the number of elements in RS.

.S ( -- )
  Prints a formatted line with scnt, rcnt and psdump in it.

dump ( a -- )
  Print a nicely formatted representation of the contents of address "a" in 8
  lines of contents with 16 bytes per line. Each line begins with the address of
  the line, followed by the contents in 2 bytes chunks. The representation is
  endianness independent (or, we could say, big endian). The first byte being
  displayed really is the content of the first byte of the line.
