Ignore:
Timestamp:
Nov 25, 2011, 7:43:39 PM (9 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
Location:
Deliverables/D2.2/8051/src/LTL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/LTL/LTL.mli

    r1542 r1568  
    77    algorithm. Actually, this coloring algorithm relies on the result of a
    88    liveness analysis that will also allow to remove dead code. *)
     9
     10type argument =
     11  | Reg of I8051.register
     12  | Imm of int
    913
    1014type statement =
     
    5862
    5963  (* Apply a binary operation on the A accumulator. Parameters are the
    60      operation, the other source register, and the label of the next
     64     operation, the other argument, and the label of the next
    6165     statement. *)
    62   | St_op2 of I8051.op2 * I8051.register * Label.t
     66  | St_op2 of I8051.op2 * argument * Label.t
    6367
    6468  (* Set the carry flag to zero. Parameter is the label of the next
  • Deliverables/D2.2/8051/src/LTL/LTLInterpret.ml

    r1542 r1568  
    123123  else error ("Unknown hardware register " ^ (I8051.print_register r) ^ ".")
    124124
     125let get_arg a st = match a with
     126  | LTL.Imm i -> Val.of_int i
     127  | LTL.Reg r -> get_reg r st
     128
    125129let push st v =
    126130  let mem = Mem.store st.mem chunk st.isp v in
     
    294298        Eval.op2 st.carry op2
    295299          (get_reg I8051.a st)
    296           (get_reg srcr st) in
     300          (get_arg srcr st) in
    297301      let st = change_carry st carry in
    298302      let st = add_reg I8051.a v st in
  • Deliverables/D2.2/8051/src/LTL/LTLPrinter.ml

    r1542 r1568  
    1818
    1919let print_a = print_reg I8051.a
     20
     21let print_arg = function
     22  | LTL.Imm i -> string_of_int i
     23  | LTL.Reg r -> print_reg r
    2024
    2125
     
    5054  | LTL.St_op2 (op2, srcr, lbl) ->
    5155    Printf.sprintf "%s %s, %s --> %s"
    52       (I8051.print_op2 op2) print_a (print_reg srcr) lbl
     56      (I8051.print_op2 op2) print_a (print_arg srcr) lbl
    5357  | LTL.St_clear_carry lbl ->
    5458    Printf.sprintf "clear CARRY --> %s" lbl
Note: See TracChangeset for help on using the changeset viewer.