Ignore:
Timestamp:
Sep 23, 2010, 10:43:29 AM (9 years ago)
Author:
mulligan
Message:

JC and JNC refactored.

File:
1 edited

Legend:

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

    r112 r113  
    10231023      let status = { status with acc = new_acc } in
    10241024        set_arg8 status new_reg (`INDIRECT i)
     1025 (* program branching *)
     1026  | `JC (`REL rel) ->
     1027      if get_cy_flag status then
     1028        let cry, new_pc = half_add status.pc rel in
     1029          { status with pc = new_pc }
     1030      else
     1031        status
     1032  | `JNC (`REL rel) ->
     1033      if not (get_cy_flag status) then
     1034        let cry, new_pc = half_add status.pc rel in
     1035          { status with pc = new_pc }
     1036      else
     1037        status
    10251038(*
    1026  (* program branching *)
    1027  | JC (`REL rel) ->
    1028      let cy = carr status in
    1029        if cy = true then
    1030          { status with pc = status.pc ++ (int_of_byte rel) }
    1031        else
    1032          status
    1033  | JNC (`REL rel) ->
    1034      let cy = carr status in
    1035        if cy = false then
    1036          { status with pc = status.pc ++ (int_of_byte rel) }
    1037        else
    1038          status
    10391039 | JB ((`BIT b1), (`REL rel)) ->
    10401040     let val_bit = get_arg_1 status (`BIT b1) in
Note: See TracChangeset for help on using the changeset viewer.