Changeset 44


Ignore:
Timestamp:
Sep 8, 2010, 12:30:28 PM (8 years ago)
Author:
mulligan
Message:

Added pretty printing functions for bits, bytes, words etc.

Location:
Deliverables/D4.1
Files:
1 added
3 edited

Legend:

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

    r43 r44  
    11open Physical;;
    22open ASM;;
    3 
    4 exception BOO
     3open Pretty;;
     4
     5exception Fetch_exception of string
    56
    67type time = int;;
     
    5657  let pc,v = next pc in
    5758   try pc, byte7_of_byte v
    58    with FOO2 -> raise BOO in
     59   with Byte7_conversion -> raise (Fetch_exception "Cannot convert byte7") in
    5960 let instr = WordMap.find pc pmem in
    6061 let pc = pc ++ 1 in
     
    353354         XRL(`U2(`DIRECT b1, `DATA b2)), pc, 2
    354355 with
    355   Not_found -> raise BOO
     356  Not_found -> raise (Fetch_exception "Key not found")
    356357;;
    357358
  • Deliverables/D4.1/physical.ml

    r42 r44  
    1 exception FOO2
     1exception Byte7_conversion
    22
    33type bit = bool
     
    1616 function
    1717    (false,b2,b3,b4),n -> (b2,b3,b4,n)
    18   | _ -> raise FOO2
     18  | _ -> raise Byte7_conversion
    1919
    2020let int_of_bit b = if b then 0 else 1
  • Deliverables/D4.1/physical.mli

    r42 r44  
    1 exception FOO2
     1exception Byte7_conversion
    22
    33type bit = bool
Note: See TracChangeset for help on using the changeset viewer.