Changeset 109 for Deliverables/D4.1
- Timestamp:
- Sep 22, 2010, 4:28:19 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D4.1/ASMInterpret.ml
r108 r109 898 898 let b = int_of_vect status.b in 899 899 if b = 0 then 900 (* CSC: acc and b undefined! we leave them as they are... *)900 (* CSC: ACC and B undefined! We leave them as they are. *) 901 901 set_flags status false None true 902 902 else … … 954 954 | `CPL `C -> set_arg1 status (not (get_arg_1 status `C)) `C 955 955 | `CPL (`BIT b) -> set_arg1 status (not (get_arg_1 status (`BIT b))) (`BIT b) 956 | `RL `A -> { status with acc = rotate_left status.acc } 957 | `RLC `A -> 958 let old_cy = get_cy_flag status in 959 let n1, n2 = from_byte status.acc in 960 let (b1,b2,b3,b4),(b5,b6,b7,b8) = from_nibble n1, from_nibble n2 in 961 let status = set_arg1 status b1 `C in 962 { status with acc = mk_byte (mk_nibble b2 b3 b4 b5) (mk_nibble b6 b7 b8 old_cy) } 963 | `RR `A -> { status with acc = rotate_right status.acc } 964 | `RRC `A -> 965 let old_cy = get_cy_flag status in 966 let n1, n2 = from_byte status.acc in 967 let (b1,b2,b3,b4),(b5,b6,b7,b8) = from_nibble n1, from_nibble n2 in 968 let status = set_arg1 status b8 `C in 969 { status with acc = mk_byte (mk_nibble old_cy b1 b2 b3) (mk_nibble b4 b5 b6 b7) } 970 | `SWAP `A -> 971 let (acc_nibble_upper, acc_nibble_lower) = from_byte status.acc in 972 { status with acc = mk_byte acc_nibble_lower acc_nibble_upper } 956 973 (* 957 | RL `A ->958 let (b1,b2,b3,b4),(b5,b6,b7,b8) = status.acc in959 { status with acc = (b2,b3,b4,b5),(b6,b7,b8,b1) }960 | RLC `A ->961 let old_carry = carr status in962 let (b1,b2,b3,b4),(b5,b6,b7,b8) = status.acc in963 let new_status = set_arg1 status b1 `C in964 { new_status with acc = (b2,b3,b4,b5),(b6,b7,b8,old_carry) }965 | RR `A ->966 let (b1,b2,b3,b4),(b5,b6,b7,b8) = status.acc in967 { status with acc = (b8,b1,b2,b3),(b4,b5,b6,b7) }968 | RRC `A ->969 let old_carry = carr status in970 let (b1,b2,b3,b4),(b5,b6,b7,b8) = status.acc in971 let new_status = set_arg1 status b8 `C in972 { new_status with acc = (old_carry,b1,b2,b3),(b4,b5,b6,b7) }973 | SWAP `A ->974 let (acc_n_1, acc_n_2) = status.acc in975 { status with acc = (acc_n_2, acc_n_1) }976 974 | MOV(`U1(b1, b2)) -> 977 975 let arg = get_arg_8 status b2 in
Note: See TracChangeset
for help on using the changeset viewer.