Thanks again Chilly Willy!
I have other more general questions relating to programming in assembly. Probably best not to start a new thread since it follows on from my hello world thing.
I'm wondering about why programmers seem to do things like use bsr for subroutines that are only run once at the start of the ROM to initialise parts of hardware, why not just code inline? And I read it is best to use registers whenever possible over RAM access, but if you're just doing one operation to the data before putting it back into RAM, isn't it going to actually take longer?
example:
Code: Select all
move.l $ff0000, d0
addq.l #1, d0
move.l d0, $ff0000
I have seen things similar to that^ in code, but for this particular example is it not more efficient to avoid registers and just use:
i.e. how do you decide when it is best to use registers over RAM access?
I have lots of little questions like this, since this is my first asm language!
too long/noob questions/didn't read above:
How did you guys learn good asm coding practices? from example/others' work? by reading lots of asm docs? trial and error?
Any links to materials on this much appreciated! If not I'll have to keep bugging you all with noob questions!!
![Razz :P](./images/smilies/icon_razz.gif)
I've read quite a bit of md asm docs a lot of them might mention that it's better to use one programming method over another, but not fully go in detail why.