News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

palindrome 70%

Started by imadhx30, February 03, 2014, 03:33:53 AM

Previous topic - Next topic

imadhx30

corrected my program
given if it is a palindrome radar
if data is also imadhx plaindrome
:icon_exclaim: :icon_exclaim: :icon_exclaim:
.386
.model flat,stdcall
option casemap:none
;-----------------------
include\masm32\include\kernel32.inc
include\masm32\include\masm32.inc
include\masm32\include\msvcrt.inc
includelib\masm32\lib\kernel32.lib
includelib\masm32\lib\masm32.lib
includelib\masm32\lib\msvcrt.lib
;----------------------------------
.data
ch1 db "imad",0
affiche1 db " palindrome",0
affiche2 db "not palindrome",0
Format db "%d",0
blen db 0
bi db 0
;--------------------------------
.data?
tab1 db 25 dup(?)
;---------------------------------
.code
start:
lea edi,ch1
mov edx,0
mov ah,13
bc:
   mov cl,[edi+edx]
   cmp cl,ah
   je suit
   inc edx

suit:
     mov al,blen
     ror blen,1
     mov edx,0
     mov ebx,0
     mov dl,blen
     mov bl,bi
     lea edi,ch1

tstpal:
       cmp edx,ebx
       je pal
       mov ch,[edi+edx]
       mov cl,[edi+ebx]
       cmp ch,cl
       jne npal
       inc ebx
       dec edx
       jmp tstpal

pal:
    push offset affiche1
    call crt_printf
    jmp fin

npal:
     push offset affiche2
     call crt_printf
     jmp fin

fin:
ici:jmp ici
invoke ExitProcess,0
;----------------------
end start


jj2007

Quote from: imadhx30 on February 03, 2014, 03:33:53 AM
plz give solution

No solution for incomprehensible code without comments, sorry.

Just two hints:
1. ici:jmp ici
That will drive your CPU to 100% usage.

2. post half a page of explanations here