Changeset 58 for Deliverables/D4.1/ASMInterpret.ml
- Timestamp:
- Sep 10, 2010, 3:37:44 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D4.1/ASMInterpret.ml
r57 r58 803 803 | CLR ((`BIT b) as a) -> 804 804 set_arg1 status false a 805 | CPL `A -> 806 let acc_val = fetch_arg8 status `A in 807 { status with acc = complement acc_val } 808 | CPL `C -> 809 let ag_val = fetch_arg1 status `C in 810 set_arg1 status (not ag_val) `C 811 | CPL (`BIT b) -> 812 let ag_val = fetch_arg1 status (`BIT b) in 813 set_arg1 status (not ag_val) (`BIT b) 805 814 (* 806 815 | CPL of [ acc | carry | bit ] … … 860 869 let old_acc = status.acc in 861 870 let new_status = set_arg8 status old_acc arg in 862 { status with acc = old_arg }871 { new_status with acc = old_arg } 863 872 (* 864 873 | XCHD of acc * indirect … … 906 915 let ag_val = fetch_arg8 status ag in 907 916 let acc_val = status.acc in 917 let (b1,b2,b3,b4),n2 = status.psw in 908 918 let new_carry = acc_val < ag_val in 909 919 if ag_val <> acc_val then 910 { status with pc = status.pc ++ (int_of_byte rel) }920 { status with pc = status.pc ++ (int_of_byte rel); psw = (new_carry, b2, b3, b4),n2 } 911 921 else 912 status922 { status with psw = (new_carry, b2, b3, b4),n2 } 913 923 | CJNE ((`U2 (ag, `DATA d)), `REL rel) -> 914 924 let ag_val = fetch_arg8 status ag in 925 let (b1,b2,b3,b4),n2 = status.psw in 915 926 let new_carry = ag_val < d in 916 927 if ag_val <> d then 917 { status with pc = status.pc ++ (int_of_byte rel) }928 { status with pc = status.pc ++ (int_of_byte rel); psw = (new_carry, b2, b3, b4),n2 } 918 929 else 919 status930 { status with psw = (new_carry, b2, b3, b4),n2 } 920 931 (* 921 932 | DJNZ of [ reg | direct ] * rel
Note: See TracChangeset
for help on using the changeset viewer.