Digital Stronghold - Software Engineering Blog




July 22, 2006

Antidote for insanity

Simple programming stuffs save me from insanity. This a86 assembly program tells if str1 is a palindrome.

start:
        cld
        mov cx, 7
        lea si, str1
        lea di, temp
	
reverse:
        mov al, [si+6]
        mov [di], al
        inc di
        dec si
        loop reverse
	
        mov ah, 09h
        lea dx, temp
        int 21h
	
        cld
        mov cx, 4
	
compare:
        lea di, temp
        lea si, str1
        repe cmpsb
        jne exit
	
        mov ah, 09h
        lea dx, yes
        int 21h
	
exit:
        mov ah, 4Ch
        mov al, 00
        int 21h
        int 20h
	
str1    db 'racecar$'
yes     db '',10,'string is a palindrome!$'
temp    db 8 dup ('$')

[Middle-East Crisis]

Israel, known as the chosen people of God called a thousand reservists in a possible prelude to a ground offensive against Lebanon. Accordingly, they have to clean up bunkers and tunnels that are invulnerable to air attacks. Isn’t it ironic for the Mossads to be called as the chosen people of God?

2 Comments »

The URI to TrackBack this entry is: http://eradicus.blogsome.com/2006/07/22/57/trackback/

  1. real! =)

    Comment by unknown — July 26, 2006 @ 2:52 pm

  2. jo……. thanks for this im going to study this… kc assignment namin to…

    Comment by mack0y — June 25, 2007 @ 11:41 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Theme designed by Joset Anthony Zamora


Digital Stronghold

↑ Get Headline Animator