Changeset 743


Ignore:
Timestamp:
Apr 7, 2011, 11:11:26 AM (9 years ago)
Author:
mulligan
Message:

Removed mess from yesterday.

Location:
Deliverables/D2.2/8051/src/ASM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/ASM/ASMInterpret.ml

    r742 r743  
    16491649;;
    16501650
    1651 let execute1' cycle_count status transform =
     1651let execute1 status =
    16521652  let instr,pc,ticks = fetch status.code_memory status.pc in
    16531653  let status = { status with clock = status.clock + ticks; pc = pc } in
     
    19371937  let status = { status with previous_p1_val = get_bit status.p3 4;
    19381938                   previous_p3_val = get_bit status.p3 5 } in
    1939   let status = transform cycle_count status in
    19401939    status
    19411940;;
    1942 
    1943 let execute1 status transform = execute1' 0 status transform;;
    19441941
    19451942(*
     
    19631960*)
    19641961
    1965 let rec execute transform f s =
     1962let rec execute f s =
    19661963  let cont =
    19671964    try f s; true
    19681965    with Halt -> false
    19691966  in
    1970   if cont then execute transform f (execute1 s transform)
     1967  if cont then execute f (execute1 s)
    19711968  else s
    19721969;;
     
    19881985  IntValue.Int8.of_int i
    19891986
    1990 let example_transform cycle_count status =
    1991   if cycle_count = 3 then
    1992     { status with dpl = vect_of_int 5 `Eight }
    1993   else
    1994     status
    1995 ;;
    1996 
    19971987let interpret print_result p =
    19981988  if print_result then Printf.printf "8051: %!" ;
     
    20011991    let trace = ref [] in
    20021992    let callback = observe_trace trace in
    2003     let st = execute example_transform callback st in
     1993    let st = execute callback st in
    20041994    let res = result st in
    20051995    if print_result then
  • Deliverables/D2.2/8051/src/ASM/ASMInterpret.mli

    r742 r743  
    123123   trace; it can raise Hold to stop execution. Otherwise
    124124   the processor never halts. *)
    125 val execute: (int -> (status -> status)) -> (status -> unit) -> status -> status
     125val execute: (status -> unit) -> status -> status
    126126
    127127val fetch: Physical.WordMap.map -> word -> ASM.instruction * word * int
Note: See TracChangeset for help on using the changeset viewer.