             try
                 result = eval breakCondition
                 if result
-                    nes.step()
-                    stdout.write "[Break] #{breakCondition} => #{result}\n"
+                    print "Break condition '#{breakCondition}' evaluated to #{result}"
                     break
             catch error
-                stdout.write "[Error] #{error.message}\n"
+                print "Error when evaluating break condition '#{breakCondition}': #{error.message}"
                 break
         nes.step()
 

                .replace /.*\[Function\].*\n/g, ""
        else if typeof result is "number"
            result = "0x#{numberAsHex result}"
        stdout.write "[Exec] #{param} = #{result}\n"
    catch error
        stdout.write "[Error] #{error.message}\n"

quitCommand = (param) ->
    process.exit 0

        when "j", "jump"  then jumpCommand param
        when "b", "break" then breakCommand param
        when "x", "exec"  then execCommand param
        when "r", "reset" then resetCommand param
        when "q", "quit"  then quitCommand param
        else print "Type 'help' to print available commands."
    rl.prompt()

rl.on "close", ->
    quitCommand()
