How to Read a Character From a Keyboard in Assembly

Writing code in assembly language allows you faster access to a machine's hardware. If you have an assembly program that requires a user to input a character from the keyboard, your program needs to read the character to know what to do next. For example, if you need the user to enter a "Y" or "N," you need to tell the computer to read the entered character.

Instructions

    • 1

      Open your assembly language program's code.

    • 2

      Type the following at the point in the code where you need to read a character from the keyboard:

      mov ah, 0
      int 16h

      The code tells the computer to read the character. From there you can tell the computer what to do with the input.

    • 3

      Save and close your program's code.

Related Searches:

References

Comments

Related Ads

Featured