EASy68K  
It is currently Tue Dec 11, 2018 10:49 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Sep 09, 2011 11:24 pm 
Offline

Joined: Fri Sep 09, 2011 12:59 am
Posts: 1
Code:
*-----------------------------------------------------------
* Program    :   Caesar's Test on Strings
* Written by :   Me   
* Date       :   9/8/2011
* Description:   A program that accepts a given string, offsets the supplied string
*      by a pre-defined offset and then displays the result
*-----------------------------------------------------------
      ORG   $8000
start      move.b   #14,d0
      lea   splash,a1   ;Output splash screen
      trap   #15
      
      move.b   #14,d0
      lea   initPrompt,a1      ;Prompt for user for a string
      trap   #15
      
      move.b   #2,D0
      lea   string,A1
      trap   #15
      
      movea.l   A1,A2
      move.l   (A2),D1   ;BREAKS HERE
      beq   end
            
      bra   start
         
end:      move.b   #9,D0
      trap   #15
      
* Variables and Strings   
CR      equ   $0d
LF      equ   $0a
offset      dc.b   3
splash      dc.b   CR,LF
      dc.b   '----- Caesar Shift Encoding Example -----',CR,LF
      dc.b    ' Offset is predefined (offset=3)',CR,LF
      dc.b   ' Type 0 (zero) to end.',CR,LF,0
initPrompt   dc.b   'Please enter a string: ',0
string      ds.b   16
      END   START      ; last line of source



My initial plan was do a bit-by-bit x-fer into Dn and then add the offset; however my code halts with "Address Error: Instruction at 8026 accessing address 80b5". Where am I going wrong with this?[/i]


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 11, 2011 8:00 am 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
string is not an even address.


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 3 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