Re: A89: Re: address error


[Prev][Next][Index][Thread]

Re: A89: Re: address error




Dux Gregis@ 10.3.98 19.08

>
>Here, I'll give you a little more information so that maybe someone can help
>me even if they don't know about the addressing error.  Here is my PutSprite
>routine:
>
>PutSprite:
> move.w #30,d2
> move.b #15,d3
> bsr FindPixel
>psLoop:
> clr.l d1
> move.w (a1)+,d1
> swap d1
> lsr.l d0,d1
> or.l d1,(a0)
> add.w d2,a0
> dbra.b d3,psLoop
> rts
>
>The FindPixel works; I tested it thoroughly.  FindPixel returns the video
>mem address pointer in a0 and the bit offset in d0 from the x and y
>coordinates in d0 and d1.  Here is how I called the PutSprite:
>
> move.l #10,d0
> move.l #20,d1
> move.l sprite(pc),a1
> bsr PutSprite
>
>But it crashes saying address error.  Also does the .l on the lsr
>instruction indicate that the register with the number of shifts is a long
>or that the operand is a long?

It means that the operand is long.  -- I think lsr only uses the byte on 
the number of shifts.

>
>thanks
>

An address error occurs when the processor asks the bus to access a 
nonexistant address.  This would mean that one of your address registers 
is somehow screwed up.

Here is the BIG problem:

move.l sprite(pc),a1

this moves the contents of sprite(pc) into a1, not the address.  You MUST 
use lea -- load effective address.  This is the source of the address 
error.

-Mark



-------
Mark Zavislak
felix@megsinet.net

Linux.  Where do you want to go tomarrow?