A89: bsr <-> bra


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

A89: bsr <-> bra




> wow, thanks man :)
> may i ask, whats the difference?


bsr is branch to subroutine, while bra is just branch.

the difference is that bra just jumps to the label, while
bsr first put the address of the instruction after the bsr instruction on the
stack, and then jumps to the label.
this is so you can use the rts (return from subroutine) instruction later, wich
takes the address to jump to, from the top of the stack.
if you do a lot of bsr:s without any rts:s you will after a while run out of
space on the stack, and start overwrite vital parts of memory and can end up
with all kinds of strange errors.

Go to http://alh.dhs.org/ti89/  and download 68KPM.pdf and 68000.pdf, and then
go to http://www.mot-sps.com/home/lit_ord.html and order them as books (free)
the codes for the books you need is on alh.dhs.org/ti89.

thoose books are complete references to the 68000 processor, and containes
absolutley everything you could ever need to know. (and a lot more)
They can feel a little big for a beginner, but especially the 68KPM is good,
since it contains a complete reference to all the different instructions and
wich addressing modes you can use with wich. It is a must for any serious
programmer.

//Olle
(btw, please don't post formatted mail's to the list.)



References: