Ignore:
Timestamp:
Sep 14, 2010, 5:21:08 PM (9 years ago)
Author:
mulligan
Message:

MOVC instruction implemented.

File:
1 edited

Legend:

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

    r75 r76  
    879879    let arg = fetch_arg1 status b2 in
    880880      set_arg1 status arg b1
    881 
     881 | MOVC (`A, `A_DPTR) ->
     882     let acc_int_val = int_of_byte status.acc in
     883     let dptr_int_val = int_of_word (status.dph, status.dpl) in
     884     let addr = word_of_int (dptr_int_val + acc_int_val) in
     885     let lookup = WordMap.find addr status.code_memory in
     886       { status with acc = lookup }
     887 | MOVC (`A, `A_PC) ->
     888     let acc_int_val = int_of_byte status.acc in
     889     let new_pc_int_val = (int_of_word status.pc) + 1 in
     890     let addr = word_of_int (new_pc_int_val + acc_int_val) in
     891     let lookup = WordMap.find addr status.code_memory in
     892       { status with acc = lookup; pc = word_of_int new_pc_int_val }
    882893 (* data transfer *)
    883894(*
    884  | MOVC of acc * [ acc_dptr | acc_pc ]
    885895 | MOVX of (acc * [ indirect | indirect_dptr ],
    886896            [ indirect | indirect_dptr ] * acc) union2
Note: See TracChangeset for help on using the changeset viewer.