English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Write an assembly program which requests login and password information and prompts with a successful or a failed login message based on the user’s response.
a. Login name and password information is saved in a file named c:\userpro.txt
b. The file c:\userpro.txt contains name as login name and password as password.
c. Maximum number of characters for login name and password is 25 and 15 respectively.
d. Password is case sensitive but login name is not.
e. The login screen should be similar to the following one:

ex

Login: name
Password: ******

Successful login/Login Failed

2007-05-03 21:11:20 · 4 answers · asked by yonas t 1 in Computers & Internet Programming & Design

4 answers

Yes I can. However, it appears that this is a school assignment, and asking for someone else to do your assignment is CHEATING, and when you cheat, you are really cheating YOURSELF out of a proper education, since you did NOT learn what you need to learn!

Ask us specific questions within this assignment, like how do you do a certain thing, and maybe we can help you, with a bit more details. As is, it'd be both morally impossible and logically impossible to help you. Why morally impossible, I've already explained. Why logically impossible... You haven't told us which CPU you're supposed to be writing for.

2007-05-03 21:17:38 · answer #1 · answered by Kasey C 7 · 1 0

Assembly is a fairly complex language to be described here and secondly, you should try doing your homework yourself.

I can give you a few hints as to how to do it (coz anyways its going to be a LONG assembly code)

You need to take input from keyboard, and if you wish to restrict number of characters, you might try a loop taking one character each time, storing it in an array.

Open a stream, associate the file C:\Userpro with the stream, and COMPARE the array with the stored info.
For case insensitive text (username) it is good idea to convert all the input in one case e.g. all small or all UPPER for a simpler comparison. (how to do it, hint: shift bits of input or even simpler, add or less the difference of ASCII codes of small and upper case)
Case sensitive comparison is simple, as you can compare byte to byte without any conversion. If you use the jump mnemonics of Assembly, the only thing remaining would be to display an appropriate message.
So, compare byte to byte, and simply on any failed comparison, jump out to the text 'Failed Login' if not, the login is successful.
You can put a 0 or 1 value on stack to give it back to any program spawning your logging in code.

2007-05-04 04:23:16 · answer #2 · answered by StarChaser 5 · 1 0

Sure that is a easy one. I was a assembler language programmer in the navy that is a easy code. Good luck with that.

2007-05-04 05:20:28 · answer #3 · answered by the light exposes the darkenss 3 · 0 0

no but i have a belly button

2007-05-04 04:13:27 · answer #4 · answered by mygoldenstate23@yahoo.com 1 · 0 2

fedest.com, questions and answers