Changeset 444

Show
Ignore:
Timestamp:
01/13/11 14:19:14 (2 years ago)
Author:
mulligan
Message:

Got Test.native to compile. Added functions for exporting intel hex format records to a file.

Location:
Deliverables/D4.1
Files:
4 modified

Legend:

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

    r441 r444  
    17461746      | `PUSH (`DIRECT b) -> 
    17471747       (* DPM: What happens if we overflow? *) 
    1748         let cry,new_sp = half_add (get_arg_8 status status.sp) (vect_of_int 1 `Eight) in 
     1748        let cry,new_sp = half_add status.sp (vect_of_int 1 `Eight) in 
    17491749        let status = { status with sp = new_sp } in 
    17501750        write_at_sp status b 
  • Deliverables/D4.1/IntelHex.ml

    r443 r444  
    33open Util;; 
    44open Parser;; 
     5open Printf;; 
    56 
    67exception WrongFormat of string 
     
    235236    processed @ end_buffer 
    236237;; 
     238 
     239let file_of_intel_hex path fmt = 
     240  let str_fmt = string_of_intel_hex_format fmt in 
     241  let channel = open_out path in 
     242    fprintf channel "%s\n" str_fmt; 
     243    close_out channel 
     244;; 
  • Deliverables/D4.1/IntelHex.mli

    r443 r444  
    1111 
    1212val intel_hex_of_file: string -> intel_hex_format 
     13val file_of_intel_hex: string -> intel_hex_format -> unit 
    1314val process_intel_hex: intel_hex_format -> Physical.WordMap.map 
    1415 
  • Deliverables/D4.1/Test.ml

    r429 r444  
    22open ASMInterpret;; 
    33open Util;; 
     4open IntelHex;; 
    45open Pretty;; 
    56 
     
    78let mem = IntelHex.process_intel_hex hex in 
    89let status = ASMInterpret.load_mem mem ASMInterpret.initialize in 
     10let _ = file_of_intel_hex "hex-output-test.hex" (pack_exported_code_memory 64 65536 status.code_memory) in 
    911let observe status = 
    1012 let pc = status.ASMInterpret.pc in