Ignore:
Timestamp:
Nov 4, 2011, 12:22:17 PM (9 years ago)
Author:
ayache
Message:

Function pointers in D2.2/8051. Bugged for now.

Location:
Deliverables/D2.2/8051/src/LTL
Files:
6 edited

Legend:

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

    r1462 r1488  
    7575  | St_call_id of AST.ident * Label.t
    7676
    77   (* Call to a function given its address. Parameters are the registers holding
    78      the address of the function, and the label of the next statement. *)
    79   | St_call_ptr of I8051.register * I8051.register * Label.t
     77  (* Call to a function given its address in DPTR. Parameter is the label of the
     78     next statement. *)
     79  | St_call_ptr of Label.t
    8080
    8181  (* Branch on A accumulator. Parameters are the label to go to when the A
  • Deliverables/D2.2/8051/src/LTL/LTLInterpret.ml

    r1462 r1488  
    304304      interpret_call lbls_offs st (Mem.find_global st.mem f) lbl
    305305
    306     | LTL.St_call_ptr (f1, f2, lbl) ->
    307       let addr = List.map (fun r -> get_reg r st) [f1 ; f2] in
    308       interpret_call lbls_offs st addr lbl
     306    | LTL.St_call_ptr lbl ->
     307      interpret_call lbls_offs st (dptr st) lbl
    309308
    310309    | LTL.St_condacc (lbl_true, lbl_false) ->
  • Deliverables/D2.2/8051/src/LTL/LTLPrinter.ml

    r1462 r1488  
    5555    Printf.sprintf "movex @DPTR, %s --> %s" print_a lbl
    5656  | LTL.St_call_id (f, lbl) -> Printf.sprintf "call \"%s\" --> %s" f lbl
    57   | LTL.St_call_ptr (f1, f2, lbl) ->
    58     Printf.sprintf "call_ptr [%s ; %s] --> %s" (print_reg f1) (print_reg f2) lbl
     57  | LTL.St_call_ptr lbl ->
     58    Printf.sprintf "call_ptr DPTR --> %s" lbl
    5959  | LTL.St_condacc (lbl_true, lbl_false) ->
    6060    Printf.sprintf "branch %s <> 0 --> %s, %s" print_a lbl_true lbl_false
  • Deliverables/D2.2/8051/src/LTL/LTLToLIN.ml

    r1462 r1488  
    5050  | LTL.St_call_id (f, _) ->
    5151    LIN.St_call_id f
    52   | LTL.St_call_ptr (f1, f2, _) ->
    53     LIN.St_call_ptr (f1, f2)
     52  | LTL.St_call_ptr _ ->
     53    LIN.St_call_ptr
    5454
    5555  (* Conditional branch statement. In [LIN], control implicitly
  • Deliverables/D2.2/8051/src/LTL/LTLToLINI.ml

    r1462 r1488  
    131131        | LTL.St_store l
    132132        | LTL.St_call_id (_, l)
    133         | LTL.St_call_ptr (_, _, l) ->
     133        | LTL.St_call_ptr l ->
    134134
    135135          visit l
  • Deliverables/D2.2/8051/src/LTL/branch.ml

    r1462 r1488  
    8080    | LTL.St_call_id (f, l) ->
    8181      LTL.St_call_id (f, rep l)
    82     | LTL.St_call_ptr (f1, f2, l) ->
    83       LTL.St_call_ptr (f1, f2, rep l)
     82    | LTL.St_call_ptr l ->
     83      LTL.St_call_ptr (rep l)
    8484    | LTL.St_condacc (lbl_true, lbl_false) ->
    8585      LTL.St_condacc (rep lbl_true, rep lbl_false)
Note: See TracChangeset for help on using the changeset viewer.