NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

.model small
.stack 100h
.data
msg_title db 0Ah,0Dh, '=== PALINDROME CHECKER ===$'
prompt db 0Ah,0Dh, 'Enter a word: $'
is_pal db 0Ah,0Dh, 'Result: The word is a palindrome.$'
not_pal db 0Ah,0Dh, 'Result: The word is NOT a palindrome.$'
newline db 0Ah,0Dh, '$'
buffer db 50 dup('$') ; space for input
len dw 0 ; to store string length

.code
main proc
mov ax, @data
mov ds, ax

; ===== DISPLAY TITLE =====
mov ah, 9
lea dx, msg_title
int 21h

; ===== ASK FOR INPUT =====
mov ah, 9
lea dx, prompt
int 21h

; ===== READ STRING =====
lea dx, buffer
mov ah, 0Ah
int 21h

; Get string length (first byte = max len, second byte = actual len)
mov al, [buffer+1]
mov ah, 0
mov len, ax ; save length in len

; ===== PALINDROME CHECK =====
mov cx, len
mov si, offset buffer + 2 ; start of string
mov bx, si
add bx, cx
dec bx ; end of string

check_loop:
cmp si, bx
jge done_check ; done if start >= end

mov al, [si]
mov dl, [bx]
cmp al, dl
jne not_palindrome ; mismatch ? not palindrome

inc si
dec bx
jmp check_loop

done_check:
; if we reach here, it’s a palindrome
mov ah, 9
lea dx, is_pal
int 21h
jmp exit_program

not_palindrome:
mov ah, 9
lea dx, not_pal
int 21h

exit_program:
mov ah, 4Ch
int 21h
main endp
end main
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.