×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

String Input

String Input

String Input

(OP)
I know how to input a character, but how would I input a string? Also if I wanted to read a string from a user such as 34,45,67 as one input, how could I save 34 to ax register then 45 to the bx register and then 67 to the cx register?

RE: String Input

To input a string you have to monitor these single characters and combine into a string by yourself. Once you can do it, you'll be able to get '34' into AX and so on.
PS. This is the easiest way, but not the only one possible.

RE: String Input

(OP)
How would I monitor the characters?

RE: String Input

We talk about DOS, right?
Take a look at INT 16, functions 0 and 1. One of them tells you if a key has been pressed, other puts character info in AX. Well, you have to create a "main loop" where you can monitor the keyboard.

RE: String Input

Well from what I've learned, create a record in the data segment to hold your string like this:

INVAL LABEL BYTE ;Align all values on a byte for this to
;work
MAXLEN DB 10D; Tell the max input
ACTLEN DB ?
STRVAL DB 10 DUP (' ')


then to actually fill the data slot
MOV AX,0AH
LEA DX,INVAL; INVAL is a label so starts on offset of Maxlen
INT 21H; Call the DOS Interrupt 21

If you aren't using DOS, then I think there is something similiar for a function in BIOS INT 10H, since I have no experience assembly programming on non dos systems.


Then after this, you could parse the STRVAL for your inputs, your own user defined method likely, but it might be very inefficient. I don't know.  I'm pretty new to assembly programming.  Hope any of that helps anyways.

JavaDude32

RE: String Input

There is no string input function in BIOS.

If you want an input function more flexible than DOS's, you want to build your own.

If you're using Windows... hey, you probably aren't.

"Information has a tendency to be free.  Which means someone will always tell you something you don't want to know."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close