Changeset 60


Ignore:
Timestamp:
Sep 10, 2010, 4:20:09 PM (9 years ago)
Author:
mulligan
Message:

Finished implementing all jump instructions.

File:
1 edited

Legend:

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

    r58 r60  
    886886       else
    887887         status
     888 | JB ((`BIT b1), (`REL rel)) ->
     889     let val_bit = fetch_arg1 status (`BIT b1) in
     890       if val_bit = true then
     891         { status with pc = status.pc ++ (int_of_byte rel) }
     892       else
     893         status
     894 | JNB ((`BIT b1), (`REL rel)) ->
     895     let val_bit = fetch_arg1 status (`BIT b1) in
     896       if val_bit = false then
     897         { status with pc = status.pc ++ (int_of_byte rel) }
     898       else
     899         status
     900 | JBC ((`BIT b1), (`REL rel)) ->
     901    let val_bit = fetch_arg1 status (`BIT b1) in
     902    let new_status = set_arg1 status false (`BIT b1) in
     903       if val_bit = true then
     904         { new_status with pc = status.pc ++ (int_of_byte rel) }
     905       else
     906         new_status
    888907(*
    889  | JB of rel
    890  | JNB of rel
    891  | JBC of bit * rel
    892908 | ACALL of addr11
    893909 | LCALL of addr16
Note: See TracChangeset for help on using the changeset viewer.