EASy68K
http://www.easy68k.com/EASy68Kforum/

I can't get any output statement
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1305
Page 1 of 1

Author:  Ali-sh [ Fri Apr 04, 2014 12:43 pm ]
Post subject:  I can't get any output statement

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

Author:  profkelly [ Mon Apr 07, 2014 10:59 pm ]
Post subject:  Re: I can't get any output statement

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/