# The "low" part of the HAL

The file xcomp/hallo.fs contains HAL implementation logic that is common to all
CPUs and that are needed for further HAL implementation (that is, they can't
simply go in xcomp/boot.fs) and can't go in xcomp/lo.fs either because they need
some CPU-specific words.

xcomp/hallo.fs implements these words, documented in [doc/hal]:

  (&? -&) dir) (dir? -dir) signed) (signed? -signed) (slot slot) (bank bank)
  A) S) PSP) RSP) W>) A>) S>) (W? (sz

or [doc/dict]:

  if then else ahead begin while repeat again (

## CPU-specific layer

The first role of xcomp/<arch>/hallo.fs is to define some "HAL flag" constants,
that is, constants that yield a binary mask corresponding to HAL operand fields:

  HALDIRECT  --> &)
  HALINV     --> dir)
  HALSIGNED  --> signed)

Another role is to implement these words, documented in [doc/hal]:

  bbr br! (R R) (R> R>) W) (8b? (16b?

they also need to implement these "private" words:

ifW, ( -- )
  The equivalent of "if" without the immediate flag, that is, drop PS top and
  branch if that dropped value was 0.

  It is the functional equivalent of "dropz, ifnz,", but on some CPUs such as
  RISC-V, generating it all at once allows us to generate tighter code and since
  this is what generates all the "if" jumps of the system, it's worth the
  troubles of defining a separate word.
