Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

.MODEL SMALL .STACK 100H .DATA msg DB 0AH,0DH,'=>is palindrome','$' .CODE MAIN PROC mov ah, 2h mov dl,'?' int 21h xor cx, cx mov ah, 1h int 21h call palindrome exit: mov ah, 4ch int 21h MAIN ENDP palindrome proc while_: cmp al, 0dh je end_while push ax inc cx int 21h jmp while_ end_while: mov ah, 2h mov dl, 0dh int 21h mov dl, 0ah int 21h jcxz exit top: pop dx int 21h loop top ret palindrome ENDP END MAIN

OpenStudy (anonymous):

everything is working well but the problem i m encountering here is that my program isnt telling that whether the given string is a palindrome ???? plz help me with this

OpenStudy (anonymous):

the problem is that it should compare the reverse string in the output with the given one and if it is the same it should tell that the given string is palindrome

OpenStudy (anonymous):

@asnaseer bro can you help me on this one i've asked this one an hour ago but no one is helping plz help me ....

OpenStudy (asnaseer):

sorry - but I don't know anything about assembler :(

OpenStudy (anonymous):

oh ok no problem but can you refer someone who can help ???

OpenStudy (asnaseer):

I'm sure I even know anyone who knows assembler - apart from you of course :)

OpenStudy (asnaseer):

*I'm NOT sure...

OpenStudy (anonymous):

lol :P

OpenStudy (anonymous):

may be this l help DATA SEGMENT X DW 0FFFFH MSG1 DB 10,13,'NUMBER IS PALINDROME$' MSG2 DB 10,13,'NUMBER IS NOT PALINDROME$' DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV AX,X MOV CL,10H UP: ROR AX,1 RCL DX,1 LOOP UP CMP AX,DX JNZ DOWN LEA DX,MSG1 MOV AH,09H INT 21H JMP EXIT DOWN: LEA DX,MSG2 MOV AH,09H INT 21H EXIT:MOV AH,4CH INT 21H CODE ENDS END START Output: Number is Palindrome ;Load the Data to AX. ;Move the Data AX to DS. ;Move DW to AX. ;Initialize the counter 10. ;Rotate right one time. ;Rotate left with carry one time. ;Loop the process. ;Compare AX and DX. ;If no zero go to DOWN label. ;Declare as a PALINDROME. ;Jump to EXIT label. ; Declare as not a PALINDROME -

OpenStudy (anonymous):

ok thank you very much i m your fan :) ty ty ty infinity

OpenStudy (anonymous):

but still my problem is there i've to take data from user

OpenStudy (anonymous):

lol i dont remember things properly sorry :P

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!