Skip to main content
s1975
Associate II
Jul 31, 2013 7:51 PM UTC
Question

how to make PC-N? on STVD assembler? without label

Posted on July 31, 2013 at 21:51

example:

btjt PB_IDR, #1, PC-1; need it, not working

.label

 btjt PB_IDR, #1, label; not need it, working

please help...
    This topic has been closed for replies.

    11 replies

    fggnrc2
    Associate III
    Aug 1, 2013 4:18 AM UTC
    Posted on August 01, 2013 at 06:18

    BTJT PB_IDR, #1,*

    s1975
    s1975Author
    Associate II
    Aug 1, 2013 8:08 AM UTC
    Posted on August 01, 2013 at 10:08

    thank you,

    please answer:

    how to used records: *

    fggnrc2
    Associate III
    Aug 1, 2013 8:52 AM UTC
    Posted on August 01, 2013 at 10:52

    Hello user75!

    Page 23 (section 4.3.6 - operands) of the ST Assembler-Linker User Manual that is distributed with STVD explains the meaning and some uses of the symbol '*'.

    In my opinion, * should be used only in inline-loops as in your example.

    As regards the other uses, it's always better to use labels.

    s1975
    s1975Author
    Associate II
    Aug 1, 2013 9:02 AM UTC
    Posted on August 01, 2013 at 11:02

    whether correctly I wrote down?

    btjt PB_IDR, #1, {*-1}

    s1975
    s1975Author
    Associate II
    Aug 1, 2013 9:03 AM UTC
    Posted on August 01, 2013 at 11:03

    example PC-1 ?

    s1975
    s1975Author
    Associate II
    Aug 1, 2013 9:06 AM UTC
    Posted on August 01, 2013 at 11:06

    I agree, but sometimes happens more convenient PC-N

    s1975
    s1975Author
    Associate II
    Aug 1, 2013 9:10 AM UTC
    Posted on August 01, 2013 at 11:10

    you from what country?

    I from Russia

    s1975
    s1975Author
    Associate II
    Aug 1, 2013 9:11 AM UTC
    Posted on August 01, 2013 at 11:11

    thank you, BR!

    fggnrc2
    Associate III
    Aug 1, 2013 9:28 AM UTC
    Posted on August 01, 2013 at 11:28

    user75,

    consider * as a label which the assembler updates *before* translating the current instruction. For this reason, the instruction:

    BTJT PB_IDR,#0,*

    works, because * is the address of the first byte (of five bytes) that the assembler emits when it process this line. When you use {*-1} (I suggest you to use the curly brackets to avoid assembler errors), you avoid the assembler assistance in computing a valid jump destination. When your computation is wrong, there are no assembling errors, but only execution errors (if you are luky) or a strange behaviour which are difficult to debug. Why one should not use the assembler label feature to avoid these nasty errors?
    s1975
    s1975Author
    Associate II
    Aug 1, 2013 9:41 AM UTC
    Posted on August 01, 2013 at 11:41

    it is possible also a tag, I pass with AVR to ST, and it already simply a habit though the ST assembler allows more :)