Changeset 107


Ignore:
Timestamp:
Sep 22, 2010, 3:52:58 PM (9 years ago)
Author:
mulligan
Message:

CLR instruction refactored.

File:
1 edited

Legend:

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

    r106 r107  
    781781  function
    782782    `BIT addr ->
    783       (match addr with
    784          (false,r1,r2,r3),n1 ->
    785            let addr = (int_of_vect (mk_byte7 r1 r2 r3 n1)) in
     783      let n1, n2 = from_byte addr in
     784      (match from_nibble n1 with
     785         (false,r1,r2,r3) ->
     786           let addr = (int_of_vect (mk_byte7 r1 r2 r3 n2)) in
    786787           let addr' = vect_of_int ((addr / 8) + 32) `Seven in
    787788           let n_bit = set_bit (Byte7Map.find addr' status.low_internal_ram) (addr mod 8) v in
     
    790791              | Some n_bit' ->
    791792                  { status with low_internal_ram = Byte7Map.add addr' n_bit' status.low_internal_ram })
    792                         | (true,r1,r2,r3),n1 ->
     793                        | (true,r1,r2,r3) ->
    793794           (*CSC: SFR access, TO BE IMPLEMENTED *)
    794795           (* assert false for now. Try to understand what DEC really does *)
     
    947948        let xor_val = get_arg_8 status (`DIRECT d) -^- get_arg_8 status ag in
    948949          set_arg8 status xor_val `A
     950   | `CLR `A -> set_arg8 status (zero `Eight) `A
     951   | `CLR `C -> set_arg1 status false `C
     952   | `CLR ((`BIT b) as a) -> set_arg1 status false a
    949953(*
    950  | CLR `A -> set_arg8 status
    951      ((false,false,false,false),(false,false,false,false)) `A
    952  | CLR `C ->
    953      set_arg1 status false `C
    954  | CLR ((`BIT b) as a) ->
    955      set_arg1 status false a
    956954 | CPL `A ->
    957955     let acc_val = get_arg_8 status `A in
Note: See TracChangeset for help on using the changeset viewer.