datatype oper = REG of reg |
TEMP of Temp.temp |
STACKARG of int
- datatype pred = NV | NE | EQ | LT | GT | AL
+ datatype pred = NV | NE | EQ | LT | GT | LE | GE | AL
(* instructions *)
datatype opc =
MOVLIT of oper * word |
datatype oper = REG of reg |
TEMP of Temp.temp |
STACKARG of int
- datatype pred = NV | NE | EQ | LT | GT | AL
+ datatype pred = NV | NE | EQ | LT | GT | LE | GE | AL
(* instructions *)
datatype opc =
MOVLIT of oper * word |
| predname EQ = "eq"
| predname LT = "lt"
| predname GT = "gt"
+ | predname GE = "ge"
+ | predname LE = "le"
| predname AL = ""
(* gives number (color) associated with reg *)
| regtonum R1 = 1
| regtonum R2 = 2
| regtonum R3 = 3
+ | regtonum SP = 4
| regtonum _ = raise ErrorMsg.InternalError ("regtonum: Invalid register")
(* gives reg associated with number (color) *)