Changeset 72
 Timestamp:
 Sep 14, 2010, 3:12:52 PM (10 years ago)
 Location:
 Deliverables/D4.1
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

Deliverables/D4.1/ASMInterpret.ml
r71 r72 780 780 let status = { status with acc = q ; b = r } in 781 781 set_flags status false None false 782  DA `A > 783 let (b1,b2,b3,b4),(b5,b6,b7,b8) = status.acc in 784 let acc_int_val = int_of_byte ((b1,b2,b3,b4),(b5,b6,b7,b8)) in 785 let (cy, ac, fo, rs1),(rs0, ov, ud, p) = status.psw in 786 let lower_nibble_int_val = int_of_nibble (b5,b6,b7,b8) in 787 let upper_nibble_int_val = int_of_nibble (b1,b2,b3,b4) in 788 if lower_nibble_int_val > 9 or ac = true then 789 let acc_int_val = acc_int_val + 6 in 790 if lower_nibble_int_val > 15 then 791 let upper_nibble_int_val = upper_nibble_int_val + 6 in 792 let upper_nibble = nibble_of_int upper_nibble_int_val in 793 let lower_nibble = nibble_of_int lower_nibble_int_val in 794 let new_psw = (true, ac, fo, rs1),(rs0, ov, ud, p) in 795 { status with acc = (upper_nibble, lower_nibble); psw = new_psw } 796 else 797 if upper_nibble_int_val > 9 then 798 let upper_nibble_int_val = upper_nibble_int_val + 6 in 799 if upper_nibble_int_val > 15 then 800 let upper_nibble = nibble_of_int upper_nibble_int_val in 801 let lower_nibble = nibble_of_int lower_nibble_int_val in 802 let new_psw = (true, ac, fo, rs1),(rs0, ov, ud, p) in 803 { status with acc = (upper_nibble, lower_nibble); psw = new_psw } 804 else 805 let upper_nibble = nibble_of_int upper_nibble_int_val in 806 let lower_nibble = nibble_of_int lower_nibble_int_val in 807 { status with acc = (upper_nibble, lower_nibble) } 808 else 809 let upper_nibble = nibble_of_int upper_nibble_int_val in 810 let lower_nibble = nibble_of_int lower_nibble_int_val in 811 { status with acc = (upper_nibble, lower_nibble) } 812 else 813 let upper_nibble = nibble_of_int upper_nibble_int_val in 814 let lower_nibble = nibble_of_int lower_nibble_int_val in 815 { status with acc = (upper_nibble, lower_nibble) } 782 816 (* 783 817  ANL (`U1 (`A, ag)) > 
Deliverables/D4.1/physical.mli
r71 r72 21 21 val int_of_byte7: byte7 > int 22 22 val int_of_nibble: nibble > int 23 val nibble_of_int: int > nibble 23 24 val byte7_of_bit: bit > byte7 24 25 val byte_of_byte7: byte7 > byte
Note: See TracChangeset
for help on using the changeset viewer.