Requiring the compiler to compute these offsets, and select appropriate jump instructions, was seen as needleslly burdensome.

343

344

Introducing labels also had a simplifying effect on the design of the compiler.

345

Instead of jumping to a concrete address, the compiler could `just' jump to a label.

346

In this vein, we introduced pseudoinstructions for both unconditional and conditional jumps to a label.

347

348

Further, we also introduced labels for storing global data in a preamble before the program.

342

Hence compilers that support separate compilation cannot directly compute these offsets and select the appropriate jump instructions. These operations are

343

needleslly burdensome also for compilers that do not do separate compilation

344

and are thus handled by the assemblers, as we decided to do.

345

346

While introducing pseudo instructions we also introduced labels for locations

347

for jumps and for global data.

348

To specify global data via labels, we have introduced the notion of a preamble

349

before the program to hold the association of labels to sizes of reserved space.

349

350

A pseudoinstruction \texttt{Mov} moves (16-bit) data stored at a label into the (16-bit) register \texttt{DPTR}.

350

We believe this facility, of storing global data in a preamble referenced by a label, will also make any future extension considering separate compilation much simpler.

351

352

Our pseudoinstructions and labels induce an assembly language similar to that of SDCC.

353

All pseudoinstructions and labels are `assembled away', prior to program execution, using a preprocessing stage.

354

Jumps are computed in two stages.

355

The first stage builds a map associating memory addresses to labels, with the second stage removing pseudojumps with concrete jumps to the correct address.

351

352

Our pseudoinstructions and labels induce an assembly language similar to that of SDCC. All pseudoinstructions and labels are `assembled away', prior to program execution, using a preprocessing stage. Jumps are computed in two stages.

353

The first stage builds a map associating memory addresses to labels, with the second stage removing pseudojumps with concrete jumps to the correct address. The algorithm currently implemented does not try to minimize the object code size by always picking the shortest possible jump instruction. The choice of an optimal algorithm is currently left as future work.