# HAL operand query (and fiddling)

This unit provides some words to query and fiddle with HAL operands.

## API

swappedcond ( cond -- cond )
  Yield the swapped version of "cond", that is, how we must adjust cond if we
  swap the operands and want the same result. "<)" becomes ">)", ">=") becomes
  "<=)" etc.. Noop on =) or <>).

.hal ( op -- )
  Print a human readable representation of specified op. Destination is on the
  left of the "<" or ">" (depending on "dir)") and the rest is the
  source+modifiers.

?be+) ( op -- op )
  If the system is big endian and if "op" is 8b), do a "3 +)". If it's 16b), do
  a "2 +)". The goal is to align an access over 32-bit cells, the canonical
  example being PSP arguments.

  Let's imagine that you implement a word with a ( a b -- ) signature and that
  you want to read "a" as a 8-bit value. On a little-endian system,
  "PSP) 8b) @," will work fine, but on a big-endian one, it will not because
  you'll be reading the most significant byte of the argument.

  If you do "PSP) 8b) ?beswap) @," instead, it's going to work fine on both
  systems.
