🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

asm question

Started by
6 comments, last by sourge 24 years, 6 months ago
I thought school was out? ;-)

What exactly is the question?

Six

Advertisement
Maybe he wants the code for that?
William Reiach - Human Extrodinaire

Marlene and Me


what im stuck on is how will i get the program to tell if the user types in 1,2,3. do i make a sub, then a jz to tell if it has the same #?
mov ah,0
int 16h

then the result is in register ah (1 have code 2, 2 has 3 and so on)

"Du kan kalla mig idiot, det har jag inget emot.
Jag är en idiot."
-Bob Hund
(It's swedish, means:
"You can call me an idiot, I don't care.
I am an idiot.")
ok, lets say we have to use int 21H and not int 16H (to tell the truth, im not there yet) . any suggestions?
been reading this assembly book for awhile and came up with a question. here goes

The user types one of teh digits 1,2 or 3 and the corresponding message in:

1 - HELLO
2 - GOODBYE
3 - HAVE A NICE DAY

is displayed followed by a new line, and then the sequence of events is repeated. Thus if the user types 1,3,2 the resulting display should be:

1HELLO
3HAVE A NICE DAY
2GOODBYE

thx in advance

Yes, looks like he really wants the code for that. (sorry for repeating what you just said, Gromit)
Just don't ask for help every time you encounter a problem. Try to learn while searching for the best way of doing something. Use your brain to ASSEMBLE the pieces of information provided in the book to one big picture. And be a bit clearer if you ask questions. It might be that if you asked your question more exactly, you wouldn't have received this reply of mine.
You''re right with jz and sub. After int 21h, the ASCII code of the character is in ah, so:

cmp ah,0x31 ;(0x31=ASCII code of ''1'')
jz label_key1
cmp ah,0x32
jz label_key2
cmp ah,0x33
jz label_key3

(cmp sets the flags like sub does, but doesn''t change the first operand)
Hope this helps you...

This topic is closed to new replies.

Advertisement