Ignore:
Timestamp:
Sep 14, 2010, 2:40:33 PM (9 years ago)
Author:
mulligan
Message:

Two more jump instructions implemented.

File:
1 edited

Legend:

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

    r70 r71  
    922922 | LJMP (`ADDR16 (lb,hb)) ->
    923923     { status with pc = (lb,hb) }
    924 (*
    925  | SJMP of rel
    926  | JMP of indirect_dptr
    927 *)
     924 | SJMP (`REL rel) ->
     925     { status with pc = status.pc ++ (int_of_byte rel) }
     926 | JMP `IND_DPTR ->
     927     let acc_val = status.acc in
     928     let dptr_low = status.dpl in
     929     let dptr_high = status.dph in
     930     let dptr = (dptr_high, dptr_low) in
     931     let jmp_addr = (int_of_word dptr) + (int_of_byte acc_val) in
     932       { status with pc = status.pc ++ jmp_addr }
    928933 | JZ (`REL rel) ->
    929934     if status.acc = ((false,false,false,false),(false,false,false,false)) then
Note: See TracChangeset for help on using the changeset viewer.