A simple keyboard input to string, and print it

Started by yodacool, June 06, 2005, 12:49:18 PM

Previous topic - Next topic

yodacool

I am kind of new to assembly. I have a book but it doesnt explain the keyboard int's in detail, and I am having a hard time with this. How would I:
Ask for a char from the keyboard, and loop untill the [enter] key is pressed.
Save all those chars into a string, and when done attach a '$' at the end of the string.

Printing it is pretty easy once you have the '$' at the end.

MichaelW

You can get information on the DOS and BIOS interrupt from Ralf Brown's Interrupt list.

An HTML version is here:

http://www.ctyme.com/rbrown.htm

And the download version here:

http://www-2.cs.cmu.edu/~ralf/files.html

You might take a look at Interrupt 21h functions 1, 2, and 0Ah, in addition to Interrupt 16h functions 0, 1, 10h, and 11h.
eschew obfuscation

yodacool

I will take a look, but I already have a huge interrupt list. I have been messing with them trying to get them to work for days, so any help would be appriciated. I notice that many do not give examples here, and just reference you to references or int lists, because people are afraid of doing others homework.
I am just starting to learn assembly, and there is a lot I dont know. I assure you I am not doing homework.

Every example code I get helps me to get the proper framework down for asm programs.
So can you show me an example of using one of these interrupts in conjunction with writing the chars it returns to a string in memory sequentally, or do I have to post all the errors and my own past 34 programs that didnt work?

MichaelW

The DOS version of Randy Hyde's Art of Assembly has examples with well-written explanations:

http://webster.cs.ucr.edu/AoA/DOS/index.html
eschew obfuscation

yodacool