Ignore:
Timestamp:
Sep 22, 2010, 4:13:39 PM (9 years ago)
Author:
mulligan
Message:

CPL instructions refactored.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/ASMInterpret.ml

    r107 r108  
    951951   | `CLR `C -> set_arg1 status false `C
    952952   | `CLR ((`BIT b) as a) -> set_arg1 status false a
     953   | `CPL `A -> { status with acc = complement status.acc }
     954   | `CPL `C -> set_arg1 status (not (get_arg_1 status `C)) `C
     955   | `CPL (`BIT b) -> set_arg1 status (not (get_arg_1 status (`BIT b))) (`BIT b)
    953956(*
    954  | CPL `A ->
    955      let acc_val = get_arg_8 status `A in
    956        { status with acc = complement acc_val }
    957  | CPL `C ->
    958      let ag_val = get_arg_1 status `C in
    959        set_arg1 status (not ag_val) `C
    960  | CPL (`BIT b) ->
    961      let ag_val = get_arg_1 status (`BIT b) in
    962        set_arg1 status (not ag_val) (`BIT b)
    963957 | RL `A ->
    964958     let (b1,b2,b3,b4),(b5,b6,b7,b8) = status.acc in
Note: See TracChangeset for help on using the changeset viewer.