Hey I am doing a program in palindromes.
Don't worry, I dont want any code (I read the sticky). But this is my first semester using it, and my second program. I am having trouble in storing the word from the user. Right now it only stores one character. How can I make it save the entire word? What am I doing wrong?
Should I save the word one letter at a time in a loop so I can make it go in reverse order? Using Pops and Pushes?
I am using Tasm. Here is my code for reference
MSG1 DB ' Enter a word $' theword db 20 dup( ' '), 0 ItIs DB 'The word is a Palindrome $' ItIsNot DB 'The word is not a Palindrome $' .... .... GetPut: lea dx,MSG1 ;addr. of 1st msg mov ah,9 ;set for str. displ. int 21H ;call DOS to displ. ;DISPLAY MESSAGE ABOVE; mov ah,1 ;set func. to Get int 21H ;call DOS (val-AL) ;USER ENTERS STRING ABOVE; mov theword,al ;move input to theword lea dx,theword ;move the word to dx register mov ah,9 ;move 9 to ah signaling output int 21h ;call the interrupt
The current output is that it only allows me to type in one letter. Then the letter is echo'd (with no space in between). And the string that the word is a palindrome
If someone can show me how to have the user entered a string from they keyboard, and how I store it, that will be a big help.
Edited by pyTony: fixed formating