Ignore:
Timestamp:
Mar 7, 2011, 11:10:57 AM (10 years ago)
Author:
ayache
Message:

Hex output not too long for mcu anymore. Readable output added.

Location:
Deliverables/D2.2/8051/src/ASM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/ASM/ASMPrinter.ml

    r619 r640  
    44let print_program p =
    55  let code_memory = ASMInterpret.load_code_memory p.ASM.code in
    6   let intel_hex = IntelHex.pack_exported_code_memory 16 65536 code_memory in
     6  let intel_hex = IntelHex.pack_exported_code_memory 16 65535 code_memory in
    77  IntelHex.string_of_intel_hex_format intel_hex
  • Deliverables/D2.2/8051/src/ASM/Pretty.ml

    r627 r640  
    4444    `Label l -> l ^ ":"
    4545  | `Cost l -> l ^ ":"
    46   | `Jmp j -> "Jmp " ^ j
    47   | `Call j -> "Call " ^ j
     46  | `Jmp j -> "ljmp " ^ j
     47  | `Call j -> "lcall " ^ j
    4848  | `WithLabel i -> pp_jump i
    4949  | `Begin_fun -> "\n; Begin function"
     
    9999
    100100let print_program p =
    101   let f s i = Printf.sprintf "%s%s\n" s (pp_instruction i) in
    102   "Org 0\n\n" ^ (List.fold_left f "" p.ASM.pcode) ^ "\nEND\n"
     101  let mem = ASMInterpret.load_code_memory p.ASM.code in
     102  let f (s, pc) _ =
     103    let (inst, new_pc, _) = ASMInterpret.fetch mem pc in
     104    (Printf.sprintf "%s%s: %s%s\n"
     105       s
     106       (string_of_int (BitVectors.int_of_vect pc))
     107       (pp_instruction inst)
     108       (if BitVectors.WordMap.mem pc p.ASM.cost_labels then
     109           " ;; (" ^ (BitVectors.WordMap.find pc p.ASM.cost_labels) ^ ")"
     110        else ""),
     111     new_pc) in
     112  fst (List.fold_left f ("", BitVectors.zero `Sixteen) p.ASM.code)
  • Deliverables/D2.2/8051/src/ASM/Pretty.mli

    r627 r640  
    2121val pp_instruction: [< ASM.labelled_instruction] -> string
    2222
    23 val print_program : [< ASM.labelled_instruction] ASM.pretty_program -> string
     23val print_program : ASM.program -> string
Note: See TracChangeset for help on using the changeset viewer.