Changeset 57


Ignore:
Timestamp:
Sep 10, 2010, 3:18:55 PM (8 years ago)
Author:
mulligan
Message:

More instructions implemented. Started cleaning up code by moving
related functions acting on datatypes (bits, etc.) into dedicated
modules.

Location:
Deliverables/D4.1
Files:
3 added
1 edited

Legend:

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

    r55 r57  
    863863(*
    864864 | XCHD of acc * indirect
    865 
     865*)
    866866 (* program branching *)
    867  | JC of rel
    868  | JNC of rel
     867 | JC (`REL rel) ->
     868     let cy = carr status in
     869       if cy = true then
     870         { status with pc = status.pc ++ (int_of_byte rel) }
     871       else
     872         status
     873 | JNC (`REL rel) ->
     874     let cy = carr status in
     875       if cy = false then
     876         { status with pc = status.pc ++ (int_of_byte rel) }
     877       else
     878         status
     879(*
    869880 | JB of rel
    870881 | JNB of rel
     
    875886 | RETI
    876887 | AJMP of addr11
    877  | LJMP of addr16
     888*)
     889 | LJMP (`ADDR16 (lb,hb)) ->
     890     { status with pc = (lb,hb) }
     891(*
    878892 | SJMP of rel
    879893 | JMP of indirect_dptr
    880  | JZ of rel
    881  | JNZ of rel
    882894*)
     895 | JZ (`REL rel) ->
     896     if status.acc = ((false,false,false,false),(false,false,false,false)) then
     897                         { status with pc = status.pc ++ (int_of_byte rel) }
     898     else
     899       status
     900 | JNZ (`REL rel) ->
     901     if status.acc <> ((false,false,false,false),(false,false,false,false)) then
     902                         { status with pc = status.pc ++ (int_of_byte rel) }
     903     else
     904       status
    883905 | CJNE ((`U1 (`A, ag)), `REL rel) ->
    884906     let ag_val = fetch_arg8 status ag in
     
    897919         status
    898920(*
    899  | CJNE of (acc * [ direct | data ], [ reg | indirect ] * data) union2 * rel
    900921 | DJNZ of [ reg | direct ] * rel
    901922*)
Note: See TracChangeset for help on using the changeset viewer.