Re: A89: Re: This sprite code in C


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

Re: A89: Re: This sprite code in C




 > >  Convert the binary to decimal (base 10) -- %00000000 = 0, %00000001 = 1,
 > >  %00000010 = 2, %00000011 = 3. . .
 > 
 > l tried doing this, but l get illegal instructions... how do l make this 
 > work??

As I pointed out earier, you execute data. You can make it work by not 
executing data. In your case it would be quite advantageous to branch
over the sprite data (although it makes the code even less efficient).

That is:

  move.w 8(%sp),%d0
  move.w 10(%sp),%d1
  lea sprite(%pc),%a0
  bra over_the_sprite	<*****
sprite: dc.w    8
        dc.w    1
        dc.b    0
mask:   dc.b    0
over_the_sprite:        <*****

Keep in mind that allocating bytes can make your insn address odd,
which, of course, will cause Address Errors.

Regards,

Zoltan


Follow-Ups: References: