Changeset 161 for Deliverables/D4.1
- Timestamp:
- Oct 7, 2010, 10:35:46 AM (10 years ago)
- Location:
- Deliverables/D4.1
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D4.1/ASMInterpret.ml
r159 r161 1291 1291 | false,true -> 1292 1292 (* TYPE ERROR! *) 1293 let res,ac,ov,cy = add 8_with_c (mk_word status.th0 status.tl0) (vect_of_int 1 `Sixteen)in1293 let res,ac,ov,cy = add16_with_c (mk_word status.th0 status.tl0) (vect_of_int 1 `Sixteen) false in 1294 1294 if ov then 1295 1295 let b = set_bit status.tcon 5 true in -
Deliverables/D4.1/Physical.ml
r144 r161 50 50 ;; 51 51 52 let add16_with_c (b1 : [`Sixteen] vect) (b2 : [`Sixteen] vect) (c : bit) = 53 let n1 = int_of_vect b1 in 54 let n2 = int_of_vect b2 in 55 let c = int_of_bit c in 56 let res = n1 + n2 + c in 57 let ac = n1 mod 256 + n2 mod 256 + c >= 256 in 58 let c6 = n1 mod 2097152 + n2 mod 2097152 + c >= 2097152 in 59 let res,c = res mod 4194304, res >= 4194304 in 60 let ov = c <> c6 in 61 vect_of_int res `Sixteen,c,ac,ov 62 ;; 63 52 64 let subb8_with_c (b1 : [`Eight] vect) (b2 : [`Eight] vect) (c : bit) = 53 65 let n1 = int_of_vect b1 in -
Deliverables/D4.1/Physical.mli
r144 r161 22 22 val add8_with_c: 23 23 byte -> byte -> bit -> byte * bit * bit * bit 24 val add16_with_c: 25 word -> word -> bit -> word * bit * bit * bit 24 26 val dec: byte -> byte (* with roll-over *) 25 27 val inc: byte -> byte (* with roll-over *)
Note: See TracChangeset
for help on using the changeset viewer.