Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help a beginner in assembly language (small program)

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
hi folks,
I'm self studying the assembly language and you can imagine how difficult to study it alone.
I had a question which says : write a program that allows the user to type one letter and if the letter is 'Y', it displays the word "YES" ,followed by a new line ,else it'll display "NO" followed by a new line .then the sequence of events is repeated three more times before returning to DOS.
I found difficulties in repeating the sequence of events and in displaying the correct message for each condition .

thank you for reading,
looking forward to receiving help
S.W
 
You would have to look at the keyboard using int 16h (Look at Ralf Brown's interrupt list) and then compare the keybord buffer with the value of Y. Then you would have to make some kind of jmp command if they are equal. and for writing the word's I believe there is a some function in Dos you may use, I think it's int 21h and some subfunction
Hope it gives little help. :)
Machine code Rocks:)
 
If you need more help, try mailing me:
alan@i-manila.com.ph

Personally I prefer using the Int 21h DOS services for reading the keyboard, because they respond properly to Ctrl-C, which Int16h doesn't do. At the same time DOS provides a service to ignore Ctrl-C anyway.

You'll have to do a 'loop' structure first, as your basis, and you might want to check that your loop structure executes exactly three times before writing the inner portion (say let it print "Hello" three times first). Then replace the inner portion of the loop with the 'check keyboard' function and print function.

You have to be more specific as to what your problems are... "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top