; CS2011, A Term 1999
; Prof. Sergio A. Alvarez

title Palindrome Detector Outline
; Warning: many lines are missing in this file

.model small
.stack

.data
forwstring db 100,?, 100 dup(?)
yesmessage db "Your string is a palindrome", 0Ah, 0Dh, '$'
nomessage  db "Your string is not a palindrome", 0Ah, 0Dh, '$'
ok = 0
nok = 1

.code

main proc
.startup
   call getstring  ; returns input string in forwstring
   mov si,offset forwstring
   call palchecker ; result in BX: ok means pal, nok means not
   cmp bx,ok
   jnz notpal      ; if string is a palindrome, tell user
      mov dx,offset yesmessage
      call writemessage
      jmp finish
   notpal:         ; if not a palindrome, say so as well
      mov dx,offset nomessage
      call writemessage
   finish:
.exit
main endp

palchecker proc
   ...
palchecker endp

getstring proc
 ...
getstring endp

writemessage proc
   push ax
   mov ah,09
   int 21h
   pop ax
   ret
writemessage endp

end


