Changeset 106


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

Same with ORL and XRL instructions.

File:
1 edited

Legend:

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

    r105 r106  
    917917          else
    918918            status
    919  | `ANL (`U1(`A, ag)) ->
    920      let and_val = get_arg_8 status `A -&- get_arg_8 status ag in
    921        set_arg8 status and_val `A
    922  | `ANL (`U2((`DIRECT d), ag)) ->
    923      let and_val = get_arg_8 status (`DIRECT d) -&- get_arg_8 status ag in
    924        set_arg8 status and_val `A
    925  | `ANL (`U3 (`C, (`BIT b))) ->
    926      let and_val = get_cy_flag status && get_arg_1 status (`BIT b) in
    927        set_flags status and_val None (get_ov_flag status)
    928  | `ANL (`U3 (`C, (`NBIT b))) ->
    929      let and_val = get_cy_flag status && get_arg_1 status (`NBIT b) in
    930        set_flags status and_val None (get_ov_flag status)
     919   | `ANL (`U1(`A, ag)) ->
     920        let and_val = get_arg_8 status `A -&- get_arg_8 status ag in
     921          set_arg8 status and_val `A
     922   | `ANL (`U2((`DIRECT d), ag)) ->
     923        let and_val = get_arg_8 status (`DIRECT d) -&- get_arg_8 status ag in
     924          set_arg8 status and_val `A
     925   | `ANL (`U3 (`C, (`BIT b))) ->
     926        let and_val = get_cy_flag status && get_arg_1 status (`BIT b) in
     927          set_flags status and_val None (get_ov_flag status)
     928   | `ANL (`U3 (`C, (`NBIT b))) ->
     929        let and_val = get_cy_flag status && get_arg_1 status (`NBIT b) in
     930          set_flags status and_val None (get_ov_flag status)
     931   | `ONL (`U1(`A, ag)) ->
     932        let or_val = get_arg_8 status `A -|- get_arg_8 status ag in
     933          set_arg8 status or_val `A
     934   | `ONL (`U2((`DIRECT d), ag)) ->
     935        let or_val = get_arg_8 status (`DIRECT d) -|- get_arg_8 status ag in
     936          set_arg8 status or_val `A
     937   | `ONL (`U3 (`C, (`BIT b))) ->
     938        let or_val = get_cy_flag status || get_arg_1 status (`BIT b) in
     939          set_flags status or_val None (get_ov_flag status)
     940   | `ONL (`U3 (`C, (`NBIT b))) ->
     941        let or_val = get_cy_flag status || get_arg_1 status (`NBIT b) in
     942          set_flags status or_val None (get_ov_flag status)
     943   | `XRL (`U1(`A, ag)) ->
     944        let xor_val = get_arg_8 status `A -^- get_arg_8 status ag in
     945          set_arg8 status xor_val `A
     946   | `XRL (`U2((`DIRECT d), ag)) ->
     947        let xor_val = get_arg_8 status (`DIRECT d) -^- get_arg_8 status ag in
     948          set_arg8 status xor_val `A
    931949(*
    932  | ORL (`U1(`A, ag)) ->
    933      let (ac1,ac2,ac3,ac4),(ac5,ac6,ac7,ac8) = get_arg_8 status `A in
    934      let (ag1,ag2,ag3,ag4),(ag5,ag6,ag7,ag8) = get_arg_8 status ag in
    935      let and_val = ((ac1 || ag1, ac2 || ag2, ac3 || ag3, ac4 || ag4),
    936                    (ac5 || ag5, ac6 || ag6, ac7 || ag7, ac8 || ag8)) in
    937        set_arg8 status and_val `A
    938  | ORL (`U2((`DIRECT d), ag)) ->
    939      let (d1,d2,d3,d4),(d5,d6,d7,d8) = get_arg_8 status (`DIRECT d) in
    940      let (ag1,ag2,ag3,ag4),(ag5,ag6,ag7,ag8) = get_arg_8 status ag in
    941      let and_val = ((d1 || ag1, d2 || ag2, d3 || ag3, d4 || ag4),
    942                    (d5 || ag5, d6 || ag6, d7 || ag7, d8 || ag8)) in
    943        set_arg8 status and_val `A
    944  | ORL (`U3 (`C, (`BIT b))) ->
    945      let (cy,ac,fo,rs1),(rs0,ov,ud,p) = status.psw in
    946      let c = get_arg_1 status `C in
    947      let ag_val = get_arg_1 status (`BIT b) in
    948        { status with psw = (c || ag_val,ac,fo,rs1),(rs0,ov,ud,p) }
    949  | ORL (`U3 (`C, (`NBIT b))) ->
    950      let (cy,ac,fo,rs1),(rs0,ov,ud,p) = status.psw in
    951      let c = get_arg_1 status `C in
    952      let ag_val = not (get_arg_1 status (`NBIT b)) in
    953        { status with psw = (c || ag_val,ac,fo,rs1),(rs0,ov,ud,p) }
    954  | XRL (`U1(`A, ag)) ->
    955      let (ac1,ac2,ac3,ac4),(ac5,ac6,ac7,ac8) = get_arg_8 status `A in
    956      let (ag1,ag2,ag3,ag4),(ag5,ag6,ag7,ag8) = get_arg_8 status ag in
    957      let and_val = ((xor ac1 ag1, xor ac2 ag2, xor ac3 ag3, xor ac4 ag4),
    958                    (xor ac5 ag5, xor ac6 ag6, xor ac7 ag7, xor ac8 ag8)) in
    959        set_arg8 status and_val `A
    960  | XRL (`U2((`DIRECT d), ag)) ->
    961      let (d1,d2,d3,d4),(d5,d6,d7,d8) = get_arg_8 status (`DIRECT d) in
    962      let (ag1,ag2,ag3,ag4),(ag5,ag6,ag7,ag8) = get_arg_8 status ag in
    963      let and_val = ((xor d1 ag1, xor d2 ag2, xor d3 ag3, xor d4 ag4),
    964                    (xor d5 ag5, xor d6 ag6, xor d7 ag7, xor d8 ag8)) in
    965        set_arg8 status and_val `A
    966950 | CLR `A -> set_arg8 status
    967951     ((false,false,false,false),(false,false,false,false)) `A
Note: See TracChangeset for help on using the changeset viewer.