Changeset 110


Ignore:
Timestamp:
Sep 22, 2010, 5:06:12 PM (9 years ago)
Author:
mulligan
Message:

MOV instructions refactored.

File:
1 edited

Legend:

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

    r109 r110  
    831831;;
    832832
    833 let set_arg16 status (dh, dl) =
     833let set_arg16 status wrd =
    834834        function
    835835                `DPTR ->
    836                         { status with dph = dh; dpl = dl }
     836       let (dh, dl) = from_word wrd in
     837         { status with dph = dh; dpl = dl }
    837838
    838839let set_flags status c ac ov =
     
    971972        let (acc_nibble_upper, acc_nibble_lower) = from_byte status.acc in
    972973          { status with acc = mk_byte acc_nibble_lower acc_nibble_upper }
     974  | `MOV(`U1(b1, b2)) -> set_arg8 status (get_arg_8 status b2) b1
     975  | `MOV(`U2(b1, b2)) -> set_arg8 status (get_arg_8 status b2) b1
     976  | `MOV(`U3(b1, b2)) -> set_arg8 status (get_arg_8 status b2) b1
     977  | `MOV(`U4(b1,b2)) -> set_arg16 status (get_arg_16 status b2) b1
     978  | `MOV(`U5(b1,b2)) -> set_arg1 status (get_arg_1 status b2) b1
     979  | `MOV(`U6(b1,b2)) -> set_arg1 status (get_arg_1 status b2) b1
    973980(*
    974  | MOV(`U1(b1, b2)) ->
    975                 let arg = get_arg_8 status b2 in
    976       set_arg8 status arg b1
    977  | MOV(`U2(b1, b2)) ->
    978                 let arg = get_arg_8 status b2 in
    979       set_arg8 status arg b1
    980  | MOV(`U3(b1, b2)) ->
    981                 let arg = get_arg_8 status b2 in
    982       set_arg8 status arg b1
    983  | MOV(`U4(b1,b2)) ->
    984     let arg = get_arg_16 status b2 in
    985       set_arg16 status arg b1
    986  | MOV(`U5(b1,b2))->
    987     let arg = get_arg_1 status b2 in
    988       set_arg1 status arg b1
    989  | MOV(`U6(b1,b2))->
    990     let arg = get_arg_1 status b2 in
    991       set_arg1 status arg b1
    992981 | MOVC (`A, `A_DPTR) ->
    993982     let acc_int_val = int_of_byte status.acc in
Note: See TracChangeset for help on using the changeset viewer.