print macro msg
lea dx,msg
mov ah,09h
int 21h
endm
.model small
.stack 100h
.data
s1 db 10,13,'Enter a string $'
s2 db 10,13,'palientrome $'
s4 db 10,13,'not palientrome $'
s3 db 50 dup('$')
f db 0
.code
mov ax,@data
mov ds,ax
print s1
mov dx,offset s3
mov bx,00h
mov ah,3fh
int 21h
sub ax,02
mov si,00h
mov cx,ax
mov di,ax
dec di
loop1: mov al,s3[si]
cmp al,s3[di]
jnz notp
dec di
inc si
loop loop1
print s2
jmp stop
notp:print s4
stop:mov ah,4ch
int 21h
end
No comments:
Post a Comment