cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with JP and CALL instructions

newtonpro
Associate II
Posted on September 07, 2011 at 15:38

When the JP instructions jump less than 92H I haven't any problem, but if it jumps more than 92H the JP and Call command do not work properly. I am sure to be in the same section because I use STM8S105C6.

Example1:

0x80E8 jp Base

if the label Base is an address 0x8110 the compiler translates in JP 0x8110 >>Correct

if the label Base is an address 0x8181 the compiler translates in JP 0x8081 >>Wrong

if the label Base is an address 0x8259 the compiler translates in JP 0x8159 >>Wrong

if the label Base is an address 0x8349 the compiler translates in JP 0x8149 >>Wrong

if the label Base is an address 0x83B5 the compiler translates in JP 0x80B5 >>Wrong

Example2:

0x83DD jp Base2

the label Base2 is an address 0x8685 the compiler translates in JP 0x8085 >>Wrong

After 0x817B every label must have the ''.w'' suffix for ex: Base.w

The call instruction is the same.

Why? Did I forget a few assembler directives?

Thanks
5 REPLIES 5
brazov22
Associate II
Posted on September 07, 2011 at 15:53

try JPF/CALLF instructions

newtonpro
Associate II
Posted on September 07, 2011 at 19:34

Already tried is the same

newtonpro
Associate II
Posted on January 31, 2012 at 15:20

The same problems there are with the STVD ver. 4.3.0.

If there are some errors during compiling the STVD ver. 4.3.0 go to crash. There is a bug?
marcosovilla9
Associate II
Posted on February 15, 2012 at 14:33

Hi Marco,

also to me it happens: STVD 4.3.0 crashes when it founds errors. With STVD 4.3.1 they corrected this problem but I found another problem about SWIM communication when starting debug, so I'm actually using STVD 4.2.0 , because it's the only that works fine!!

newtonpro
Associate II
Posted on March 01, 2012 at 13:07

Solved

It was necessary before  ''  segment 'rom'  '' write WORDS.

With this word the problems go away.