The Philippine Electronics and Technology Forum
February 10, 2012, 07:32:49 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  

Pages: [1]   Go Down
  Print  
Author Topic: PALINDROME(with input)  (Read 631 times)
zinckingeye
Size C Battery
*****

Pogi/Ganda Points: 4
Offline Offline

Gender: Male
Posts: 186



« on: May 06, 2010, 05:08:51 PM »

code this using emu8086 or microASM pleaseeeee...

example1: enter input: this is me
                               em si siht
              This is not palindrome

example2:  enter input: I saw was I
                                I saw was I
               This is palindrome.
Logged

Wakupakels....
The Philippine Electronics and Technology Forum
« on: May 06, 2010, 05:08:51 PM »

 Logged
noego
LR44 Battery
*

Pogi/Ganda Points: 0
Offline Offline

Posts: 1


« Reply #1 on: May 22, 2010, 06:02:30 AM »

.model tiny
.code
org 100h

start:
   jmp begin
;========================================
   msg db "Enter word:$"
   msg2 db "Reverse word:$"
   in1 db  30 dup(36)
   rev1 db 30 dup(36)    
   newline db 13,10,'$'
   p1 db "This is palindrome$"
   p2 db "This is not palindrome$"
;========================================    
begin:                
    xor cx,cx
   mov ah,9
   lea dx,msg
   int 21h
   mov ah,0ah
   lea dx,in1
   int 21h
   lea si,in1+1
   mov cl,[si]
   lea di,rev1
   inc si                        
   add di,cx
   dec di
   push cx
trans:
    mov bl,[si]
    mov [di],bl
    dec di
    inc si  
    loop trans    

    mov ah,9  
    lea dx,newline
    int 21h                  
    lea dx,msg2
    int 21h
    lea dx,rev1
    int 21h    
    lea dx,newline
    int 21h
    lea si,in1+2
    lea di,rev1
    pop cx
    repe cmpsb
    je palin
    lea dx,p2
    int 21h
          
exit:
   mov ah,4ch
   int 21h
palin:
    mov ah,9
    lea dx,p1
    int 21h
    jmp exit
end start
Logged
zinckingeye
Size C Battery
*****

Pogi/Ganda Points: 4
Offline Offline

Gender: Male
Posts: 186



« Reply #2 on: May 29, 2010, 04:18:17 PM »

ui.. kua mamat mo ng marami.... hahahaha.... l=maglelevel up na next sem.....
Logged

Wakupakels....
The Philippine Electronics and Technology Forum
   

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Need you input guys... « 1 2 »
Electrical Circuits and Devices
Kasamiko 34 2855 Last post June 12, 2009, 11:02:17 PM
by ultrasonic™
My DENGUE ako, need you input... « 1 2 3 4 »
Health and Medicine
toasted siopao 71 5489 Last post November 30, 2009, 06:59:36 PM
by Ngarus!
3 input / 4 input OR gate... help
Analog Electronics
markieTIGERS 4 887 Last post October 05, 2009, 01:26:33 PM
by rdpzycho
IC that combines input
General Digital Design
ICmaiden 12 858 Last post March 18, 2010, 06:50:49 PM
by ivANALOG
audio input xformer at ic na 1.5 lng input
General Electronics and Technology Discussion
fishbone000 0 206 Last post February 23, 2010, 03:58:18 PM
by fishbone000
Analog Input+ LCD
Microcontroller/Microprocessor Unit Projects and Programming
marcasjr™ 0 365 Last post March 07, 2010, 06:12:36 PM
by marcasjr™
Palindrome java.. need help..
COE Students
transistorized 3 131 Last post September 28, 2010, 08:13:40 AM
by bootfetch
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!