         @emptyReadCycles = 0  # Number of dummy write cycles
         @emptyWriteCycles = 0 # Number of dummy read cycles
         @activeInterrupts = 0 # Bitmap of active interrupts (each type of interrupt has its own bit)
+        @halted = false       # Whether KIL opcode was readed
 
     resetMemory: ->
         @write address, 0xFF for address in [0...0x0800]

    ###########################################################

    step: ->
        if @dma.isBlockingCPU() or @apu.isBlockingCPU()
            @tick() # CPU can't access memory (empty cycle)
        else
            @resolveInterrupt() if @activeInterrupts
            @executeOperation()

    ###########################################################


    executeOperation: ->
        operation = @$readOperation()
        unless operation
            logger.info "CPU halted!"
            @halted = true # CPU halt (KIL operation code)
            return

        instruction = operation.instruction
        addressingMode = operation.addressingMode
