Address Register to Data Register Woes
Page 1 of 1

Author:  justMe [ Fri Sep 09, 2011 11:24 pm ]
Post subject:  Address Register to Data Register Woes

* 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]

Author:  lee [ Sun Sep 11, 2011 8:00 am ]
Post subject: 

string is not an even address.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group