I can help you.
Assembly language is used when needed. Otherwise ,modern desktops and laptops are so fast that thee is little reason to directly use assembly language.
If you are new to programming, it is best to start with something a little up on the ladder. The C language is often given as starring place. I would suggest something even easier to start with. Such as Python.
But let's say you really want to do assembly. OK.
First, document what you want to do. Next, use codes that you already know to get a working model. Then introduce a few new c concepts and try it out.
For General Reference:
http://en.wikipedia.org/wiki/X86_assembly_languagex86 assembly language is a family of backward-compatible assembly languages, which provide some level of compatibility all the way back to the Intel 8008. x86 assembly languages are used to produce object code for the x86 class of processors. Like all assembly languages, it uses short mnemonics to represent the fundamental instructions that the CPU in a computer can understand and follow. Compilers sometimes produce assembly code as an intermediate step when translating a high level program into machine code. Regarded as a programming language, assembly coding is machine-specific and low level. Assembly languages are more typically used for detailed and time critical applications such as small real-time embedded systems or operating system kernels and device drivers.
I put that here so others know what we are talking about.You description sounds like an input procedure where the user must enter a specific key from the keyboard. You code does not look like an input routine. Please clarify what you want to do and why you sue specific codes.
If you are using Linux, you must use only 32 bit code. And if you have a 64bit Windows system you also must use either 32 code. Or else 64 bit code.
Use you- can use 16 bit code only on 32 bit versions of Windows. Your code fragment did not say. Also, your ought to document with system calls your are using with INT 21H so that others can help you.
Here is preference that explains why IN 21h is used in assembly:
http://stackoverflow.com/questions/1245809/what-is-int-21hIn general, that call should have two parameters in registers. One a byte value and the other a pointer. Faille to do that can have strange results.
EDIT: If the OP is using MS-DOS or a compatible OS, he needs to understand the DOS API:
http://en.wikipedia.org/wiki/MS-DOS_APIMy bad. I said byte value. It must be word value.