2020-06-28 12:01:56 +10:00
|
|
|
BIN( is the addr at which the compiled binary will live. It is
|
|
|
|
often 0.
|
|
|
|
|
|
|
|
ORG is H@ offset at which we begin spitting binary. Used to
|
|
|
|
compute PC. To have a proper PC, call "H@ ORG !" at the
|
|
|
|
beginning of your assembly process. PC is H@ - ORG + BIN(.
|
|
|
|
|
2020-04-28 05:04:37 +10:00
|
|
|
Labels are a convenient way of managing relative jump
|
|
|
|
calculations. Backward labels are easy. It is only a matter or
|
|
|
|
recording "HERE" and do subtractions. Forward labels record the
|
|
|
|
place where we should write the offset, and then when we get to
|
|
|
|
that point later on, the label records the offset there.
|
|
|
|
|
2020-04-20 10:36:13 +10:00
|
|
|
To avoid using dict memory in compilation targets, we
|
|
|
|
pre-declare label variables here, which means we have a limited
|
2020-06-28 12:01:56 +10:00
|
|
|
number of it. For now, 4 ought to be enough. (cont.)
|