CS 210 PROJECT #3 Due: Noon Wednesday 04/26/06 The purpose of this project is to introduce the student to ways in which application programs can modify various behaviors of the terminal device (i.e., the combined keyboard and display-monitor), as needed for certain kinds of systems utilities such as the 'login' program. PROBLEM STATEMENT Develop a complete assembly language program (named 'password.s') which will prompt the user to type in a secret password, and then will display a notice that informs the user whether further access is being denied or granted: Correct password -- access is granted. or Incorrect password -- access refused. To insure that you acquire some experience with using the x86 string- manipulation instructions (including appropriate choice of a 'repeat' prefix and conditional-jump), this project will explicitly ask you to employ the 'cmpsb' instruction when comparing the user's input-string with your program's built-in password-string. These three additional 'user-interface' features are also requirements (intended to increase convenience, forgive mistakes, and improve security): (1) allow users to type in the required password using either uppercase or lowercase letters; (2) allow users to reenter their password, up to a maximum of four tries, before their login attempt is finally denied; (3) rewrite the keyboard-input procedure so that the password itself cannot be seen on the screen as it is being typed, but so that some neutral character (such as '*') will get displayed instead (to provide your user with 'feedback'). Your implementation of these features will (necessarily) acquaint you with loop-constructs, with ascii-codes, and with some individual bits in specific fields within a system-defined 'termios' data-structure. Be aware in your design of the user's experience: for example, do not print a message saying 'access is refused' if you will then allow the user another try at typing in the password correctly; instead, show a more accurate message, saying: Incorrect password -- please try again. The easiest way to implement "case insensitivity" for your user-input is for your program to convert lowercase letters to uppercase letters before making the comparison with the correct built-in password. Eliminating the automatic "echo" of input-characters on the screen is undoubtedly the most challenging part of this assignment and involves details of the Linux 'tty' interface to be discussed in our lectures. _____________________________________________________________________ Allan B. Cruse University of San Francisco Spring 2006