Sie sind auf Seite 1von 4

data segment

list1 LABEL Byte maxl DB 30 actl DB ? kb_data DB 20 dup('0')

msg1 db 'Palindrome msg2 db 'Not Palindrome msg3 db "Enter String $"

$' $'

data ends

code segment

ASSUME CS:code,DS:data,ES:data start:

mov ax,data mov ds,ax mov es,ax

mov ah,09 lea dx,msg3

int 21h

MOV AH,0AH LEA DX,list1 INT 21H

LEA SI,kb_data

MOV Al,actl MOV AH,00H

LEA DI,kb_data ADD DI,ax dec di

MOV cl,02h div cl MOV CL,AL

LEA SI,kb_data

CALL palindrome

CMP dl,01h JNZ same

MOV Ah,09h LEA Dx,msg2 INT 21H

jmp skip2 same: MOV Ah,09h LEA Dx,msg1 INT 21H

skip2: mov ah,4ch int 21h

palindrome proc near

mov dl,0h AGAIN: MOV AL,[SI] MOV BL,[di] CMP al,bl JNZ skip INC SI dec di dec cl JNZ AGAIN RET

skip:

MOV DL,01H

RET

palindrome ENDP

code ends end start