Changeset 91 for Deliverables
 Timestamp:
 Sep 20, 2010, 3:30:27 PM (10 years ago)
 Location:
 Deliverables/D4.1
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

Deliverables/D4.1/ASMInterpret.ml
r90 r91 1 open BitVectors;; 1 2 open Physical;; 2 3 … … 7 8 (* no differentiation between internal and external code memory *) 8 9 type status = 9 { code_memory: byteWordMap.t; (* can be reduced *)10 low_internal_ram: byteByte7Map.t;11 high_internal_ram: byteByte7Map.t;12 external_ram: byteWordMap.t;10 { code_memory: ([`Eight] vect) WordMap.t; (* can be reduced *) 11 low_internal_ram: ([`Eight] vect) Byte7Map.t; 12 high_internal_ram: ([`Eight] vect) Byte7Map.t; 13 external_ram: ([`Eight] vect) WordMap.t; 13 14 14 15 pc: word; 
Deliverables/D4.1/physical.ml
r90 r91 8 8 Map.Make (struct type t = word let compare = Pervasives.compare end) 9 9 10 let byte7_of_byte = 11 function 12 (false,b2,b3,b4),n > (b2,b3,b4,n) 13  _ > raise Byte7_conversion 10 let int_of_bit = 11 function 12 false > 0 13  true > 1 14 15 let byte7_of_byte b = 16 let bits = to_bits b in 17 match bits with 18 [false;b1;b2;b3;b4;b5;b6;b7] > mk_byte7 b1 b2 b3 (mk_nibble b4 b5 b6 b7) 19  _ > raise Byte7_conversion 14 20 15 21 let add8_with_c b1 b2 c = … … 25 31 ;; 26 32 27 let subb8_with_c b1 b2 c=33 let subb8_with_c (b1 : [`Eight] vect) (b2 : [`Eight] vect) (c : bit) = 28 34 let n1 = int_of_vect b1 in 29 35 let n2 = int_of_vect b2 in 30 let c = int_of_ vect c in36 let c = int_of_bit c in 31 37 let res = n1  n2  c in 32 38 let ac = n1 mod 16  n2 mod 16  c < 0 in … … 52 58 53 59 let byte7_of_bit b = 54 false,false,false,(false,false,false,b)60 [false;false;false;false;false;false;b] 55 61 ;; 56 62 57 let byte_of_byte7 ( b1,b2,b3,n) =58 (false,b1,b2,b3),n63 let byte_of_byte7 ([b1;b2;b3]::n) = 64 [false;b1;b2;b3]::n 59 65 ;; 
Deliverables/D4.1/physical.mli
r88 r91 1 open Bit _vectors1 open BitVectors;; 2 2 3 3 exception Byte7_conversion … … 7 7 8 8 val byte7_of_byte: byte > byte7 9 val int_of_bit: bit > int 9 10 10 11 val subb8_with_c: 11 byte > byte > bit > byte* bit * bit * bit (* , c, ac, ov *)12 val dec: byte > byte(* with rollover *)13 val inc: byte > byte(* with rollover *)12 byte > byte > bit > ([ `Eight  `Eleven  `Four  `Seven  `Sixteen ] vect) * bit * bit * bit (* , c, ac, ov *) 13 val dec: byte > ([ `Eight  `Eleven  `Four  `Seven  `Sixteen ] vect) (* with rollover *) 14 val inc: byte > ([ `Eight  `Eleven  `Four  `Seven  `Sixteen ] vect) (* with rollover *)
Note: See TracChangeset
for help on using the changeset viewer.