Monday, 15 August 2011

assembly - Why are branch instructions faster than jump instructions? -



assembly - Why are branch instructions faster than jump instructions? -

looking @ amtel avr instruction set, noticed branch instruction takes 2 cycles if executed , 1 if not, while jump instruction takes 3 cycles.

why this?

it seems comes op-code length. jmp instruction 32bit instruction because has read address separate word. reading costs additional clock cycle.

branches , relative jump rjmp , indirect jump ijmp 16bit instructions executed in 2 clock cycles.

assembly avr

No comments:

Post a Comment