Ignore:
Timestamp:
Nov 25, 2011, 7:43:39 PM (8 years ago)
Author:
tranquil
Message:
  • Immediates introduced (but not fully used yet in RTLabs to RTL pass)
  • translation streamlined
  • BUGGY: interpretation fails in LTL, trying to fetch a function with incorrect address
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/ERTL/ERTLInterpret.ml

    r1542 r1568  
    158158    else error ("Unknown local register " ^ (Register.print r) ^ ".")
    159159
     160let get_arg a st = match a with
     161  | RTL.Imm i -> Val.of_int i
     162  | RTL.Reg r -> get_reg (Psd r) st
     163
    160164let push st v =
    161165  let mem = Mem.store st.mem chunk st.isp v in
     
    282286
    283287    | ERTL.St_set_hdw (destr, srcr, lbl) ->
    284       let st = add_reg (Hdw destr) (get_reg (Psd srcr) st) st in
     288      let st = add_reg (Hdw destr) (get_arg srcr st) st in
    285289      next_pc st lbl
    286290
     
    328332      next_pc st lbl
    329333
    330     | ERTL.St_int (r, i, lbl) ->
     334    | ERTL.St_move (r, RTL.Imm i, lbl) ->
    331335      let st = add_reg (Psd r) (Val.of_int i) st in
    332336      next_pc st lbl
    333337
    334     | ERTL.St_move (destr, srcr, lbl) ->
     338    | ERTL.St_move (destr, RTL.Reg srcr, lbl) ->
    335339      let st = add_reg (Psd destr) (get_reg (Psd srcr) st) st in
    336340      next_pc st lbl
     
    361365        Eval.op2 st.carry op2
    362366          (get_reg (Psd srcr1) st)
    363           (get_reg (Psd srcr2) st) in
     367          (get_arg srcr2 st) in
    364368      let st = change_carry st carry in
    365369      let st = add_reg (Psd destr) v st in
Note: See TracChangeset for help on using the changeset viewer.