View Single Post
Old 12 May 2007, 05:00   #2
Codetapper
2 contact me: email only!
 
Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,182
The main problem is you have move.w -1(a0),d1 in the save part. This is an illegal operation on a 68000 as you are moving a word but it is not word aligned, so it will crash. On a 68020+ that code will work.

To fix it, you need it to be move.w -2(a0),d1

If you are serious about learning, you should start with good habits as you will keep them as you learn:

cmp.w (a0)+,d1 instead of cmp (a0)+,d1
moveq #0,d0 instead of clr.l d0
lea list(pc),a0 instead of lea.l list,a0

Instead of hardwiring the amount as 5, calculate the length etc:

Code:
        lea     list(pc),a0
        move.w  #(listend-list)>>1,d0
        ...
list    dc.w    15,2,23,4,3
listend
Codetapper is offline  
 
Page generated in 0.05435 seconds with 11 queries