source: Deliverables/D4.1/test.ml @ 140

Last change on this file since 140 was 140, checked in by sacerdot, 10 years ago

More cleanup.

File size: 590 bytes
Line 
1let hex = IntelHex.intel_hex_of_file Sys.argv.(1) in
2let mem = IntelHex.process_intel_hex hex in
3let status = ASMInterpret.load_mem mem ASMInterpret.initialize in
4let observe status =
5 let pc = status.ASMInterpret.pc in
6 let opcode = Physical.WordMap.find pc status.ASMInterpret.code_memory in
7 let instr,_,_ = ASMInterpret.fetch status.ASMInterpret.code_memory pc in
8  prerr_string ("pc = " ^ BitVectors.hex_string_of_vect pc) ;
9  prerr_string (" : " ^ BitVectors.hex_string_of_vect opcode);
10  prerr_endline (" = " ^ Pretty.pp_instruction instr)
11in
12 ASMInterpret.execute observe status
13;;
Note: See TracBrowser for help on using the repository browser.