# The very first code interpreted on boot

The source file at [xcomp/lo.fs] is, in the near totality of the cases, the
very first piece of code interpreted by the booting kernel, regardless of the
CPU. See [doc/boot] for bootstrapping details, this page is about documenting
the contents of this source file, which can't contain comments because we don't
have them yet at this stage of the bootstrapping process.

The purpose of this file is to implement a few mechanisms that are common to
every HAL, before we even have a HAL. Well, we have one, but it's only partly
implemented by the kernel (see [doc/kernel]).

This is mostly about:

1. The HAL bank number API
2. halerr placeholder
3. if/else/then

The rest of the code is either code that's needed to implement the above, or in
some cases sur as "code>" and ":>", words that could be implemented later in
xcompb/boot, but are clearer when implemented in proximity to words needed in
xcomp/lo.

## Number bank

See [doc/hal].

## halerr

We don't have aborts at this stage, this is a simple abort"HAL error" that will
be implemented and realiased in xcomp/boot.

## if/else/then

Implementing a HAL without branching is kind of impossible, so if/else/then
are one of the first words we need to implement. But branching is CPU-specific!

Therefore, we need to resort to forward calling. We define dummy indirect
"IF," "FBR," and "BR!" words. "IF" is the exact implementation of "if", that is,
test for 0, drop the value, then jump forward if value was 0. Without immediate.
The other two are documented in [doc/hal].

These indirect words that are must be implemented by each HAL before the first
"if" is used.
