* generates instructions to achieve d <- e
* d must be TEMP(t) or REG(r)
*)
- and munch_exp d (T.CONST n) = [X.INSN (X.AL, X.MOVLIT(d, Word.fromLarge n))]
+ and munch_exp d (T.CONST n) = [X.INSN (X.AL, X.MOVLIT(d, Word.fromLarge (Word32.toLarge n)))]
| munch_exp d (T.STRING s) = [X.INSN (X.AL, X.MOVSTR(d, s))]
| munch_exp d (T.NULLPTR) = [X.INSN (X.AL, X.MOVLIT(d, 0w0))]
| munch_exp d (T.TEMP(t)) = [X.INSN (X.AL, X.MOV(d, X.TEMP t))]
(* munch_stm : T.stm -> X.insn list *)
(* munch_stm stm generates code to execute stm *)
and munch_stm (T.MOVE (T.TEMP t1, T.TEMP t2)) = [X.INSN (X.AL, X.MOV(X.TEMP t1, X.TEMP t2))]
- | munch_stm (T.MOVE (T.TEMP t, T.CONST n)) = [X.INSN (X.AL, X.MOVLIT(X.TEMP t, Word.fromLarge n))]
+ | munch_stm (T.MOVE (T.TEMP t, T.CONST n)) = [X.INSN (X.AL, X.MOVLIT(X.TEMP t, Word.fromLarge (Word32.toLarge n)))]
| munch_stm (T.MOVE (T.TEMP t, a as T.ARG (an))) =
let
val i = munch_exp (X.TEMP t) a