 
     computeNegativeFlag: (result) ->
         @negativeFlag = (result >> 7) & 1
+
+    branchIfTrue: -> (condition, address)
+        if condition then
+            @programCounter = address
+            @branchTaken = true
 
     registerInstruction: (instruction, execution) ->
         @instructionsTable[instruction] = execution

            @computeZeroFlag @accumulator
            @computeNegativeFlag @accumulator

    computeCarryFlag: (result) ->
        @carryFlag = if result > 0xFF then 1 else 0


        @instructionsTable = []

        @registerInstruction Instruction.ADC, (address) ->
            operand = @read address
            result = @accumulator + operand + @carryFlag
            @computeCarryFlag result
            @computeZeroFlag result
            @computeOverflowFlag @accumulator, operand, @result
            @computeNegativeFlag result
            @accumulator = result & 0xFF

