Changeset 445


Ignore:
Timestamp:
Jan 14, 2011, 1:33:37 PM (9 years ago)
Author:
mulligan
Message:

Debugging hex output. Seems mcu8051 really doesn't like what's been spat out.

Location:
Deliverables/D4.1
Files:
2 edited

Legend:

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

    r444 r445  
    138138  let addr_string = hex_string_of_vect entry.record_addr in
    139139  let checksum_string = hex_string_of_vect entry.data_checksum in
    140   let type_string = Printf.sprintf "%0 2d" (int_of_intel_hex_entry_type entry.record_type) in
     140  let type_string = Printf.sprintf "%02d" (int_of_intel_hex_entry_type entry.record_type) in
    141141  let data_string = String.concat "" (List.map hex_string_of_vect entry.data_field) in
    142142    ":" ^ length_string ^ addr_string ^ type_string ^ data_string ^ checksum_string
     
    197197*)
    198198let export_code_memory chunk_size max_addressable code_mem =
    199   let rec aux chunk_size address start_address rbuff lbuff =
    200     if chunk_size = 0 or address = max_addressable then
     199  let rec aux chunk address start_address rbuff lbuff =
     200    if address = max_addressable then
    201201      lbuff
     202    else if chunk = 0 then
     203      aux chunk_size (address + 1) address [] ((start_address, rbuff)::lbuff)
    202204    else
    203205      let code = Physical.WordMap.find (vect_of_int address `Sixteen) code_mem in
    204         if code = zero `Eight then
    205           aux chunk_size (address + 1) address [] ((start_address, rbuff)::lbuff)
    206         else
    207           aux (chunk_size - 1) (address + 1) start_address (code::rbuff) lbuff
     206        aux (chunk - 1) (address + 1) start_address (code::rbuff) lbuff
    208207  in
    209     aux chunk_size 0 0 [] []
     208    List.rev (aux chunk_size 0 0 [] [])
    210209;;
    211210
  • Deliverables/D4.1/Test.ml

    r444 r445  
    88let mem = IntelHex.process_intel_hex hex in
    99let status = ASMInterpret.load_mem mem ASMInterpret.initialize in
    10 let _ = file_of_intel_hex "hex-output-test.hex" (pack_exported_code_memory 64 65536 status.code_memory) in
     10let _ = file_of_intel_hex "hex-output-test.hex" (pack_exported_code_memory 16 128 status.code_memory) in
    1111let observe status =
    1212 let pc = status.ASMInterpret.pc in
Note: See TracChangeset for help on using the changeset viewer.