Ignore:
Timestamp:
Sep 23, 2010, 5:36:45 PM (9 years ago)
Author:
mulligan
Message:

IntelHex? file modified: string_of_intel_hex_entry implemented.

File:
1 edited

Legend:

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

    r122 r123  
    1616};;
    1717
    18 let intel_hex_of_instruction
     18let hex_string_of_vect x = "00"
     19
     20let string_of_intel_hex_entry entry =
     21  let record_length_l, record_length_r = entry.record_length in
     22  let data_checksum_l, data_checksum_r = entry.data_checksum in
     23  let length_string = hex_string_of_vect record_length_l ^
     24                      hex_string_of_vect record_length_l in
     25  let checksum_string = hex_string_of_vect data_checksum_l ^
     26                        hex_string_of_vect data_checksum_r in
     27  let type_string =
     28    match entry.record_type with
     29      Data -> "00"
     30    | End -> "01"
     31    | ExtendedSeg -> "02"
     32    | ExtendedLinear -> "04" in
     33  let data_string = String.concat "" (List.map hex_string_of_vect entry.data_field) in
     34    ":" ^ length_string ^ type_string ^ data_string ^ checksum_string
Note: See TracChangeset for help on using the changeset viewer.