Re: A85: Dumb question
[Prev][Next][Index][Thread]
Re: A85: Dumb question
Evil Sam wrote:
>
> This is probably a stupid question, but which is faster "jp &addr" or
> "jr addr"? I thought jp was faster than jr, but with the & sign, I'm not
> sure.
The JP is still faster. The & has no effect on the speed of the code;
it
only causes the address to be relocated when the program starts. It
will
make the program one byte longer (maybe 3, if it's more than 255 bytes
or
so from the last patched address) and does take a few millionths of a
second longer when the program is started. However, if you have a
conditional jump (e.g. jr nz, addr) then it may be faster to use the J
(which only takes 7 clock cycles if the jump isn't taken).
References: