cancel
Showing results for 
Search instead for 
Did you mean: 

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

s1975
Associate II
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...
11 REPLIES 11
fggnrc2
Associate II
Posted on August 01, 2013 at 06:18

BTJT PB_IDR, #1,*

s1975
Associate II
Posted on August 01, 2013 at 10:08

thank you,

please answer:

how to used records: *

fggnrc2
Associate II
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
Associate II
Posted on August 01, 2013 at 11:02

whether correctly I wrote down?

btjt PB_IDR, #1, {*-1}

s1975
Associate II
Posted on August 01, 2013 at 11:03

example PC-1 ?

s1975
Associate II
Posted on August 01, 2013 at 11:06

I agree, but sometimes happens more convenient PC-N

s1975
Associate II
Posted on August 01, 2013 at 11:10

you from what country?

I from Russia

s1975
Associate II
Posted on August 01, 2013 at 11:11

thank you, BR!

fggnrc2
Associate II
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?