2 (** This module translates a [LIN] program into a [ASM] program. *)
4 (** Very few work here:
6 The globals are associated an offset from the bottom of the memory and
7 depending on there size.
9 The instruction that loads the address of a global into a register
10 actually loads the offset associated to the global.
12 In 8051, a program is supposed to run forever. A preamble that contains
13 two instructions is added: the first calls the main, and the second
14 infinitely jumps to itself once the main has returned. *)
16 val translate : LIN.program -> ASM.program