         @readWord @moveProgramCounter 2
 
     moveProgramCounter: (size = 1) ->
-        prevValue = @programCounter
+        previousValue = @programCounter
         @programCounter = (@programCounter + size) & 0xFFFF
-        prevValue
+        previousValue
 
     ###########################################################
     # Interrupt handling
     ###########################################################
 
     resolveInterrupt: ->
-        if @requestedInterrupt? and not @interruptDisable
+        if @requestedInterrupt? and not @isRequestedInterruptDisabled()
             switch @requestedInterrupt
-                when Interrupt.IRQ   then @handleInterrupt 0xFFFE
-                when Interrupt.NMI   then @handleInterrupt 0xFFFA
-                when Interrupt.Reset then @handleInterrupt 0xFFFC
-            requestedInterrupt = null
+                when Interrupt.IRQ   then handleIRQ() 
+                when Interrupt.NMI   then handleNMI()
+                when Interrupt.Reset then handleReset()
             @tick()
-            @tick()
-
-    handleInterrupt: (interruptVectorAddress)->
+            @tick() # To make totally 7 cycles together with interrupt handler.
+            requestedInterrupt = false
+
+    isRequestedInterruptDisabled: ->
+        @requestedInterrupt == Interrupt.IRQ and @interruptDisable is on
+
+    handleIRQ: ->
         @pushWord @programCounter
-        @pushByte @getStatus()
+        @pushByte @getStatus() | Bit5
+        @interruptDisable = on # Is set after pushing the CPU status on stack.
+        @programCounter = @readWord 0xFFFE
+
+    handleNMI: ->
+        @pushWord @programCounter
+        @pushByte @getStatus() | Bit5
+        @interruptDisable = on # Is set after pushing the CPU status on stack. 
+        @programCounter = @readWord 0xFFFA
+
+    handleReset: ->
+        @stackPointer -= 3 # Does not write on stack, just decrements its pointer.
         @interruptDisable = on
-        @programCounter = @readWord interruptVectorAddress
+        @programCounter = @readWord 0xFFFC
 
     ###########################################################
     # Memory reading / writing

        result > 0xFF

    isSignedOverflow: (operand1, operand2, result) ->
        @isBitSet (operand1 ^ result) & (operand2 ^ result), 7

    ###########################################################
    # Operations table initialization

        status |= Bit1 if @zeroFlag
        status |= Bit2 if @interruptDisable
        status |= Bit3 if @decimalMode
        status |= Bit6 if @overflowFlag
        status |= Bit7 if @negativeFlag
        status
