MOVLIT of oper * word |
MOVSYM of oper * Symbol.symbol |
MOVLBL of oper * Label.label |
+ MOVSTR of oper * Stringref.stringref |
LDR of oper * oper |
STO of oper * oper |
MOV of oper * oper |
MOVLIT of oper * word |
MOVSYM of oper * Symbol.symbol |
MOVLBL of oper * Label.label |
+ MOVSTR of oper * Stringref.stringref |
LDR of oper * oper |
STO of oper * oper |
MOV of oper * oper |
| regtonum R10 = 10
| regtonum R11 = 11
| regtonum R12 = 12
- | regtonum SP = 4
- | regtonum _ = raise ErrorMsg.InternalError ("regtonum: Invalid register")
+ | regtonum FR = 13
+ | regtonum SP = 14
+ | regtonum PC = 15
(* gives reg associated with number (color) *)
fun numtoreg 0 = R0
fun pp_insn pr (MOVLIT (d, w)) = "\tmov"^pr^" "^(pp_oper d)^", #0x"^(Word.toString w)^"\n"
| pp_insn pr (MOVSYM (d, s)) = "\tmov"^pr^" "^(pp_oper d)^", #"^(Symbol.name s)^"\n"
| pp_insn pr (MOVLBL (d, l)) = "\tmov"^pr^" "^(pp_oper d)^", #"^(Label.name l)^"\n"
+ | pp_insn pr (MOVSTR (d, s)) = "\tmov"^pr^" "^(pp_oper d)^", #"^(Stringref.name s)^"\n"
| pp_insn pr (LDR (d, s)) = "\tldr"^pr^" "^(pp_oper d)^", ["^(pp_oper s)^"]\n"
| pp_insn pr (STO (d, s)) = "\tsto"^pr^" ["^(pp_oper d)^"], "^(pp_oper s)^"\n"
| pp_insn pr (MOV (d, s)) = "\tmov"^pr^" "^(pp_oper d)^", "^(pp_oper s)^"\n"