Re: A89: Re: This sprite code in C


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

Re: A89: Re: This sprite code in C




 > >  Keep in mind that allocating bytes can make your insn address odd,
 > >  which, of course, will cause Address Errors.
 > 
 > whoa what do you mean allocating bytes...l know that the stack pointer or 

When you write 

 dc.b <some_expressions>
 
you allocate one or more bytes.
 
 > something can't be an odd number...is that related?  is there a way that l 

In that the PC, just like the stack pointer, must always be even. 
If you make it odd, then you'l get an address error next time it 
is used.

Therefore, if you allocate bytes, you should make sure that the next 
address after them is even. Depending on the assembler, you can
either use
  
  .align 2
  
(which works with gas) or 

  ds.w  0
  
which works with some Windows assembler.

 > can use the .end statement instead of braching over the sprite?  

Not really. The .end statement is an assembler directive, meaning:
"This is the end any useful content in this file, don't bother reading 
after this line because nothing there is of your concern."

So it's not the best idea, I'm afraid.

 > Thanks a lot for you help.
 
Any time.

Best Regards,

Zoltan



References: