(* taille d'un entier : 4 pour MIPS *)
val sint : int

type register = 
  | Zero | A0 | A1 | A2 | V0 | V1 | S0 | RA | SP | FP

type address =
  | Alab of string
  | Areg of int * register

type operand =
  | Oimm of int
  | Oreg of register

type arith = Add | Sub | Mul | Div | Rem

type comp = Ge | Le | Gt | Lt | Eq | Neq

type instruction =
  | Move of register * register
  | Li of register * int
  | La of register * string
  | Lw of register * address
  | Sw of register * address
  | Arith of arith * register * register * operand
  | SComp of comp * register * register * register (* set comparison *)
  | BComp of comp * register * register * string (* branch comparison *)
  | B0Comp of comp * register * string (* branch comparison with 0 *)
  | Neg of register * register
  | B of string
  | Jal of string
  | J of string
  | Jr of register
  | Syscall
  | Label of string

type data = 
  | Asciiz of string * string
  | Word of string * int

type program = {
  text : instruction list;
  data : data list;
}

val print_program : Format.formatter -> program -> unit

