Changeset 140


Ignore:
Timestamp:
Sep 29, 2010, 12:51:05 PM (9 years ago)
Author:
sacerdot
Message:

More cleanup.

Location:
Deliverables/D4.1
Files:
5 edited

Legend:

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

    r138 r140  
    8989    he::tl
    9090
     91(* CSC: can overflow!!! *)
    9192let int_of_vect v =
    9293  let rec aux pow v =
     
    140141   
    141142let zero size = pad (size_lookup size) []
     143
     144(* CSC: can overflow!!! *)
     145let hex_string_of_vect v = Printf.sprintf "%0 2X" (int_of_vect v);;
  • Deliverables/D4.1/BitVectors.mli

    r98 r140  
    2929val int_of_vect: 'a vect -> int
    3030val vect_of_int: int -> ([< sizes] as 'a) -> 'a vect
     31val string_of_bit: bit -> string
    3132val string_of_vect: 'a vect -> string
    32 val string_of_bit: bit -> string
     33val hex_string_of_vect: 'a vect -> string
     34
    3335
    3436val (-&-): 'a vect -> 'a vect -> 'a vect
  • Deliverables/D4.1/IntelHex.ml

    r139 r140  
    3333    | 'C' -> 12 | 'D' -> 13 | 'E' -> 14
    3434    | 'F' -> 15 | _ -> assert false
    35 
    36 let hex_string_of_vect v = Printf.sprintf "%0 2X" (int_of_vect v);;
    3735
    3836let intel_hex_entry_type_of_int =
  • Deliverables/D4.1/IntelHex.mli

    r139 r140  
    33open Parser;;
    44
    5 type intel_hex_entry_type =
    6     Data
    7   | End
    8   | ExtendedSeg
    9   | ExtendedLinear
    10 ;;
     5type intel_hex_format
    116
    12 type intel_hex_entry =
    13 {
    14   record_length: byte;
    15   record_addr: word;
    16   record_type: intel_hex_entry_type;
    17   data_field: byte list;
    18   data_checksum: byte
    19 }
    20 ;;
    21 
    22 type intel_hex_format = intel_hex_entry list;;
    23 
    24 val string_of_intel_hex_format: intel_hex_format -> string;;
    25 val prs_intel_hex_format: intel_hex_format parser;;
    26 
    27 val hex_string_of_vect: 'a vect -> string;;
     7val string_of_intel_hex_format: intel_hex_format -> string
     8val prs_intel_hex_format: intel_hex_format parser
    289
    2910exception WrongFormat of string
     
    3112val intel_hex_of_file: string -> intel_hex_format
    3213val process_intel_hex: intel_hex_format -> Physical.WordMap.map
    33 
    34 val checksum_valid: intel_hex_entry -> bool;;
  • Deliverables/D4.1/test.ml

    r138 r140  
    66 let opcode = Physical.WordMap.find pc status.ASMInterpret.code_memory in
    77 let instr,_,_ = ASMInterpret.fetch status.ASMInterpret.code_memory pc in
    8   prerr_string ("pc = " ^ IntelHex.hex_string_of_vect pc) ;
    9   prerr_string (" : " ^ IntelHex.hex_string_of_vect opcode);
     8  prerr_string ("pc = " ^ BitVectors.hex_string_of_vect pc) ;
     9  prerr_string (" : " ^ BitVectors.hex_string_of_vect opcode);
    1010  prerr_endline (" = " ^ Pretty.pp_instruction instr)
    1111in
Note: See TracChangeset for help on using the changeset viewer.