Skip to main content
Visitor II
July 28, 2009
Question

Indirect jump and STM8S core instruction pipeline

  • July 28, 2009
  • 2 replies
  • 3819 views
Posted on July 28, 2009 at 06:43

Indirect jump and STM8S core instruction pipeline

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:03

    Hello,

    this will probably not answer your question, but, generally speaking, the first format has the big advantage (at least from a compiler point of view) of not ''breaking'' X: no need to save and restore it when it contains a meaningful value.

    Regards,

    Luca

    fggnrcAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:03

    Hello!

    the indirect jump instruction usefulness isn't clear to me.

    There are indeed two ways for code an indirect jump.

    The first one is:

    Code:

    JP [Vector.w]

    while the other one is:

    Code:

    LDW X,Vector

    JP (X)

    According to the STM8 Core Programming Manual, the former instruction is 4 bytes long and it takes 5 clock cyckes to execute.

    The latter two instructions take also 4 (= 3 + 1) bytes and take 4 (= 2 + 2) clock cycles to execute.

    I therefore see no advantage in using the indirect addressing mode because it can be emulated with index registers...

    How the STM8 core instruction pipeline affect my reasoning?

    Where can I learn more about it, since there are almost no references in the STM8 Core Programming Manual?

    Regards

    EtaPhi