Ignore:
Timestamp:
Sep 30, 2010, 6:46:44 PM (9 years ago)
Author:
mulligan
Message:

Changes made today: we now have an emulator that is able to emulate two
small C programs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/test.ml

    r145 r147  
     1open BitVectors;;
     2open Util;;
     3open Pretty;;
     4
    15let hex = IntelHex.intel_hex_of_file "Test.hex" in
    26let mem = IntelHex.process_intel_hex hex in
     
    610 let instr,_,_ = ASMInterpret.fetch status.ASMInterpret.code_memory pc in
    711   prerr_string (BitVectors.hex_string_of_vect pc) ;
    8    prerr_endline (": " ^ Pretty.pp_instruction instr)
     12   prerr_endline (": " ^ pp_instruction instr)
    913in
     14(* DPM: for debugging! *)
     15let mem_pretty_print status =
     16  let rec aux status pc =
     17    let instr, pc', cost = ASMInterpret.fetch status.ASMInterpret.code_memory pc in
     18      prerr_string $ ((hex_string_of_vect pc) ^ ": ");
     19      prerr_string $ (pp_instruction instr) ^ " ";
     20      prerr_endline $ string_of_int cost;
     21      if int_of_vect pc' > 105 then (* DPM: hardcoded on a case-by-case basis *)
     22        ()
     23      else
     24        aux status pc'
     25  in
     26    aux status status.ASMInterpret.pc;
     27    prerr_endline "-------------------------------------"
     28in
     29 (* mem_pretty_print status; *)
    1030 ASMInterpret.execute observe status
    1131;;
Note: See TracChangeset for help on using the changeset viewer.