A89: Re: General Question


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

A89: Re: General Question





The difference is a relative jump and an absolute jump to the subroutine.
In bsr the offset to the address is stored within the opcode .. that is, the
difference between the current address (PC) and the address you are jumping;
it's positive if the address you are jumping to is greater than PC, negative
if the address you are jumping to is less than PC.  Depending on the
distance, it usually only requires a byte or a word (I think bsr always
stores a word) to store the offset.  In jsr the whole longword of the
address is put into the opcode, so the opcode takes up more memory on the
calc.  You can only use bsr to branch to a subroutine within your code since
the compiler can only determine the offset relative to the program itself.
You should always use bsr to call subroutines in your own program, as you'll
save a little memory.  If you want to call something outside of the program
though, like a ROM or library call, then you must use jsr.



>
>I am a beginner to assembly, but not to programming ...
>I wanted to know what the main difference is between
>BSR and JSR.  In all of the documentation that I have
>found, I cant seem to understand the difference.
>
>
>Thanks
>Vadim
>
>
>_________________________________________
>Free web based e-mail with Pop access at http://www.newmail.net