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/RTL/RTLInterpret.ml

    r1542 r1568  
    8989  if Register.Map.mem r lenv then Register.Map.find r lenv
    9090  else error ("Unknown local register \"" ^ (Register.print r) ^ "\".")
     91
     92let get_local_arg_value (lenv : local_env) : RTL.argument -> Val.t = function
     93  | RTL.Reg r -> get_local_value lenv r
     94  | RTL.Imm i -> Val.of_int i
     95
    9196let get_arg_values lenv args = List.map (get_local_value lenv) args
    9297
     
    159164        assign_state sfrs graph lbl sp lenv carry mem inds trace [r1 ; r2] sp
    160165
    161       | RTL.St_int (r, i, lbl) ->
    162         assign_state sfrs graph lbl sp lenv carry mem inds trace [r] [Val.of_int i]
     166      (* | RTL.St_int (r, i, lbl) -> *)
     167      (*   assign_state sfrs graph lbl sp lenv carry mem inds trace [r] [Val.of_int i] *)
    163168
    164169      | RTL.St_move (destr, srcr, lbl) ->
    165170        assign_state sfrs graph lbl sp lenv carry mem inds trace [destr]
    166           [get_local_value lenv srcr]
     171          [get_local_arg_value lenv srcr]
    167172
    168173      | RTL.St_opaccs (opaccs, destr1, destr2, srcr1, srcr2, lbl) ->
     
    182187          Eval.op2 carry op2
    183188            (get_local_value lenv srcr1)
    184             (get_local_value lenv srcr2) in
     189            (get_local_arg_value lenv srcr2) in
    185190        assign_state sfrs graph lbl sp lenv carry mem inds trace [destr] [v]
    186191
Note: See TracChangeset for help on using the changeset viewer.