EASy68K  
It is currently Wed Jan 22, 2020 11:37 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Apr 04, 2014 12:43 pm 
Offline

Joined: Fri Apr 04, 2014 12:37 pm
Posts: 1
Hi,,

My program is used to replace the letter "e" with a letter "i"
but when i run the program i can't get the output , please help

Code:
START    ORG    $1000

*-------Code for output------

        LEA MESSAGE, A1
   
LOOP    CMPI.B  #$65,(A1)+      ;call EQ when we get the letter e
        BEQ EQ
        CMPI.B  #$00, (A1)
        BEQ EXIT
        BRA LOOP


EQ      MOVE.B  -(A1),D4       
        MOVE.B  #$69, (A1)      ;  replace e with i
        BRA LOOP   
   
   
EXIT     
         MOVE.B #14,D0    ; print output statment
         TRAP   #15
         
         MOVE.B #9,D0
         TRAP   #15   
         
         
MESSAGE DC.B    'Ali greets Computer Engineering Department',0

   
    END    START               ; last line of source



Thanks for help ^___6


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 10:59 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1115
Upon reaching exit (A0) is pointing at the end of the string. Make it point at the beginning of the string and it will display.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group