On 17 May 2007, at 22:17, Calvin Allett wrote:

What`s the difference between a JP and a JR, I don`t even mean
in T-States, but what varies between the way they work. If you`s
don`t mind me asking ?

A JR takes less space, two bytes compared to a JP instruction which takes 3. In a JR, you take your current address and add a one-byte offset to it, so you can only jump approximately 128 bytes in either direction (generally, the assembler will do this calculation for you). In a JP instruction you specify an the whole two-byte destination address and you jump exactly there.

Because of the Sam's memory timings, using JR is usually as fast (or slightly faster than) using JP. That may change with Mayhem accelerator!

Andrew

--
 ---       Andrew Collier         ----
  ---- http://www.intensity.org.uk/ ---
                                      --


Reply via email to