cam875 1 Junior Poster

I am getting a windows error when I run my assembly program. It only happens when the user enters what is supposed to be entered, which in this case is the character 2. I am using FASM x86 architecture.

include 'win32ax.inc'

.data

  inchar DB ?
  numread DD ?
  inHandle DD ?
  outHandle DD ?
  numWritten DD ?
  newLine DB 10
  string1 DB "UAC Operating System Emulator"
  string2 DB "Version 1.0.0 build(1)"
  string3 DB "(c) 10/11/08 Cameron Ewart, All Rights Reserved."
  mainMsg DB "console: "

.code

  start:
        invoke  AllocConsole
        invoke  GetStdHandle,STD_INPUT_HANDLE
        mov [inHandle],eax
        invoke GetStdHandle,STD_OUTPUT_HANDLE
        mov [outHandle],eax
        invoke WriteConsole,[outHandle],string1,29,numWritten,0
        invoke WriteConsole,[outHandle],newLine,1,numWritten,0
        invoke WriteConsole,[outHandle],string2,22,numWritten,0
        invoke WriteConsole,[outHandle],newLine,1,numWritten,0
        invoke WriteConsole,[outHandle],string3,48,numWritten,0
        invoke WriteConsole,[outHandle],newLine,1,numWritten,0
        invoke WriteConsole,[outHandle],newLine,1,numWritten,0
        invoke WriteConsole,[outHandle],mainMsg,9,numWritten,0
        invoke  ReadConsole,[inHandle],inchar,1,numread,0

        cmp [inchar],50
        je go

        invoke  ExitProcess,0


go:
  invoke WriteConsole,[outHandle],string1,29,numWritten,0
        invoke WriteConsole,[outHandle],newLine,1,numWritten,0
        invoke WriteConsole,[outHandle],string2,22,numWritten,0
        invoke WriteConsole,[outHandle],newLine,1,numWritten,0
        invoke WriteConsole,[outHandle],string3,48,numWritten,0
        invoke WriteConsole,[outHandle],newLine,1,numWritten,0
        invoke WriteConsole,[outHandle],newLine,1,numWritten,0
        invoke WriteConsole,[outHandle],mainMsg,9,numWritten,0
        invoke  ReadConsole,[inHandle],inchar,1,numread,0

.end start