EASy68K  
It is currently Tue Nov 21, 2017 9:21 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Oct 31, 2014 11:40 pm 
Offline

Joined: Fri Oct 31, 2014 11:20 pm
Posts: 3
how i can solve this
"Write an assembly code that defines an array of characters (‘Hello, this is an assembly assignment’) at ad-dress $2000. Then you have to use loop(s) to count the number of repetitions of the letter (‘s’) and you have to change each letter (‘s’) in the string into its upper case (‘S’).
Note: Save the number of repetitions in D7."

i wrote this but it doesn't work

Code:
ORG    $2000
LIST   DC.B 'Hello, this is an assembly assignment'
NUMBER DS.B 1
   

START      ORG $1000
       
       MOVE LIST,A0
       
LOOP   MOVE.B (A0)+,D1
       CMP.B  #'s',D1
       BEQ    LABEL
       BRA LOOP
       
       
       
LABEL MOVE.B #'S',D1
      ADD.W  #$1,NUMBER
      MOVE.W NUMBER,D7
      BRA LOOP
      END START
[admin]added code tags


Top
 Profile  
 
PostPosted: Sat Nov 01, 2014 9:32 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1049
Your code needs comments.

You must ask specific questions on this forum, not general questions like "can someone fix my code?".

We will be glad to help you learn 68K programming but we are not going to do your homework for you. That would defeat its purpose.

_________________
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 2 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:  
Powered by phpBB® Forum Software © phpBB Group