cancel
Showing results for 
Search instead for 
Did you mean: 

STM8 Assembler using STVD

pavelp1800
Associate II
Posted on September 18, 2011 at 19:13

I use STM8 Assembler.

Code:

......

CLOCK EQU 16000

TIME EQU CLOCK/1000

....

compile error

Error 67: Improper Character(s) '/1000'

Why?

I find 🙂

TIME EQU {CLOCK/1000}

Works without errors

3 REPLIES 3
pavelp1800
Associate II
Posted on October 06, 2011 at 10:49

Hi.

At increase in the size of a code the program does not work. Has started a debugger - the instruction call xxxx has the size of 3 bytes - CD xx xx (where xx xx the absolute address of procedure), though in PM0044-STM8 - call xxxx has the size of 4 bytes - 72CD xx xx ?

At size increase the absolute address xx xx varies on not the correct

My code:

  call MyProc

    ........

  ; If here to add instructions, the xx xx - address is generated incorrectly

   ........

MyProc.w

       ........

    ret 

fggnrc2
Associate II
Posted on October 06, 2011 at 13:21

Hello Pavel.

What the debugger shows is right.

The assembler translates CALL MyProc to CD xx xx, where $xxxx is the address of MyProc.

72 CD xx xx is instead the translation of CALL [MyProc.w] where MyProc ''points'' to the code to be called.

If your code doesn't work when its size grows, you have to execute it step by step until the error happens.

After you spotted the place, compare your code with the disassembled one and you'll find the error reason.

BR

EtaPhi

pavelp1800
Associate II
Posted on October 06, 2011 at 14:05

 T

hanks

EtaPhi

Similar the error consists wrong generation of the address for СALL instructions ...

This error is described here [DEAD LINK /public/STe2ecommunities/mcu/Lists/stm81/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/stm81/Problems with JP and CALL instructions&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580001E3853D9DB932A46A3FE4CD15CAB46FB&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/stm81/AllItems.aspx&currentviews=52]- Problems with JP and CALL instructions