Skip to main content
Visitor II
September 7, 2011
Question

Problems with JP and CALL instructions

  • September 7, 2011
  • 5 replies
  • 995 views
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
    This topic has been closed for replies.

    5 replies

    Visitor II
    September 7, 2011
    Posted on September 07, 2011 at 15:53

    try JPF/CALLF instructions

    newtonproAuthor
    Visitor II
    September 7, 2011
    Posted on September 07, 2011 at 19:34

    Already tried is the same

    newtonproAuthor
    Visitor II
    January 31, 2012
    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?
    Visitor II
    February 15, 2012
    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!!

    newtonproAuthor
    Visitor II
    March 1, 2012
    Posted on March 01, 2012 at 13:07

    Solved

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

    With this word the problems go away.