Changeset 447 for Deliverables


Ignore:
Timestamp:
Jan 14, 2011, 3:30:29 PM (9 years ago)
Author:
mulligan
Message:

Checksum seems to be working now on most lines, barring three? Weird bug.

Location:
Deliverables/D4.1
Files:
2 edited

Legend:

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

    r446 r447  
    213213
    214214let calculate_data_checksum (record_length, record_addr, record_type, data_field) =
    215  let ty = (flip vect_of_int $ `Eight) $ int_of_intel_hex_entry_type record_type in
    216  let addr1,addr2 = from_word record_addr in
    217  let _, total = add_bytes (record_length :: addr1 :: addr2 :: ty :: data_field) in
    218  let _,total = half_add (vect_of_int 1 `Eight) $ complement total in
    219    total
     215  let ty = (flip vect_of_int $ `Eight) $ int_of_intel_hex_entry_type record_type in
     216  let addr1,addr2 = from_word record_addr in
     217  let _, total = add_bytes (record_length :: addr1 :: addr2 :: ty :: data_field) in
     218  let _,total = half_add (vect_of_int 1 `Eight) $ complement total in
     219    total
    220220;;
    221221
  • Deliverables/D4.1/Test.ml

    r445 r447  
    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 16 128 status.code_memory) in
     10let _ = file_of_intel_hex "hex-output-test.hex" (pack_exported_code_memory 12 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.