Ignore:
Timestamp:
Nov 28, 2011, 3:13:14 PM (8 years ago)
Author:
tranquil
Message:
  • corrected previous bug
  • finished propagating immediates
File:
1 edited

Legend:

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

    r1568 r1572  
    207207  st
    208208
    209 let make_addr st r1 r2 = List.map (fun r -> get_reg (Psd r) st) [r1 ; r2]
     209let make_addr st r1 r2 = List.map (fun r -> get_arg r st) [r1 ; r2]
    210210
    211211
     
    318318
    319319    | ERTL.St_push (srcr, lbl) ->
    320       let v = get_reg (Psd srcr) st in
     320      let v = get_arg srcr st in
    321321      let st = push st v in
    322322      next_pc st lbl
     
    343343      let (v, _) =
    344344        Eval.opaccs opaccs
    345           (get_reg (Psd srcr1) st)
    346           (get_reg (Psd srcr2) st) in
     345          (get_arg srcr1 st)
     346          (get_arg srcr2 st) in
    347347      let st = add_reg (Psd destr) v st in
    348348      next_pc st lbl
     
    351351      let (_, v) =
    352352        Eval.opaccs opaccs
    353           (get_reg (Psd srcr1) st)
    354           (get_reg (Psd srcr2) st) in
     353          (get_arg srcr1 st)
     354          (get_arg srcr2 st) in
    355355      let st = add_reg (Psd destr) v st in
    356356      next_pc st lbl
     
    364364      let (v, carry) =
    365365        Eval.op2 st.carry op2
    366           (get_reg (Psd srcr1) st)
     366          (get_arg srcr1 st)
    367367          (get_arg srcr2 st) in
    368368      let st = change_carry st carry in
     
    386386    | ERTL.St_store (addr1, addr2, srcr, lbl) ->
    387387      let addr = make_addr st addr1 addr2 in
    388       let mem = Mem.store st.mem chunk addr (get_reg (Psd srcr) st) in
     388      let mem = Mem.store st.mem chunk addr (get_arg srcr st) in
    389389      let st = change_mem st mem in
    390390      next_pc st lbl
     
    394394
    395395    | ERTL.St_call_ptr (f1, f2, _, lbl) ->
    396       interpret_call lbls_offs st (make_addr st f1 f2) lbl
     396      interpret_call lbls_offs st (make_addr st (RTL.Reg f1) (RTL.Reg f2)) lbl
    397397
    398398    | ERTL.St_cond (srcr, lbl_true, lbl_false) ->
     
    436436
    437437let compute_result st ret_regs =
    438   let vs = List.map (fun r -> get_reg (Psd r) st) ret_regs in
     438  let vs = List.map (fun r -> get_arg r st) ret_regs in
    439439  let f res v = res && (Val.is_int v) in
    440440  let is_int vs = (List.length vs > 0) && (List.fold_left f true vs) in
Note: See TracChangeset for help on using the changeset viewer.