![]() My result: Enter a string (max 128 characters): abbaĮxpected result: Enter a string (max 128 characters): innostunutsonni Jne negative Nop, jump to print NOT-message and exit Je positive jump to ok, palindrome/empty buffer Lea si, mystr Source buffer address id SI(decremented)Ĭoop:mov al, Copy character from source Lea di, mystrREV Result buffer address into DI Lea di, mystr String mystring: Read string here! This is what I've done so far: include "emu8086.inc" My program only prints the first letter of the input string as reversed string and doesn't really test the palindrome properly. Nop, jump to print NOT-message and exitīort: mov ax,4c00h code for return to ms-dos Niis: cmp cl,0 test if end-of-comparison/buffer Source buffer address id SI(decremented) Seur: mov length,cl Store # of characters in length copy mystr into mystrREV in reverse order count the number of characters in the buffer mystr into CX: Msg1 db "Enter a string (max 128 characters): ",0ĬALL PRINT_STRING Print message from Msg2 db 0ah,0dh,"The string is NOT a palindrome.",0 Msg3 db 0ah,0dh,"The string is a palindrome.",0 Modify the previous program so, that it checks whether the string is a palindrome. The job is to fill the commented empty lines with my own code. I'm trying to complete my last lab exercise for my microprocessors course and could really use some help with this. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |