cancel
Showing results for 
Search instead for 
Did you mean: 

hello sir i use the st development program

debruyne.marc
Associate II

hello sir

i use the st development program

and have a problem with the assembly code "int 040200"

if you write that , the st development does not accept that code, altough its in that way it mentioned in the manual

please can you help me, how to solve that

many thanks

marc debruyne

8 REPLIES 8

You asked this yesterday.

Not much STM8 support to be had here.

What error does the assembler give? Any examples of similar usage? Any compiler or disassembler generated code using this or similar instructions?​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
hello sir
thanks for youre answer
well indeed its i use the stv development stm tool an i selcet stm assembler
then if i write that assembler line "int  $040200"
the assembler tells me its not the a correct instruction
so then i ask you witch is the correct instruction then
certainly its so marked in the manual, but in reality its not accepted
by the stm8 assembler
i had already a similar problem but with "sub SP,#4" and it came out
that its be changed to "subw"SP,#$4"
hope you can help me sir
many thanks
marc debruyne
Op 20/10/2022 om 14:06 schreef ST Community:

Do you know what the opcodes for the instruction should be?

How do they report in a debugger, or disassembly, in ST's or COSMIC's tools?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

https://community.st.com/s/question/0D53W00001sKYf6SAG/regarding-the-stv-assembler

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Can only be used in the Interrupt Table (check section/attributes where used, likely $00.8000 .. $00.807F)

0x82 ($82) OPCODE INT

INT $2FFFFC

82 2F FF FC

Could try INT #$2FFFFC

or INT symbol

https://www.st.com/resource/en/programming_manual/pm0044-stm8-cpu-programming-manual-stmicroelectronics.pdf

If all else fails, create a MACRO, or define/emit byte stream for the encoded instruction

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Here they construct the interrupt table via a DC.L

http://stm8sdiscovery.nano-age.co.uk/adventures-in-stm8-assembler/revenge-of-the-blinking-led

; the interupt table
    segment 'vectit'
    dc.l {$82000000+start}                                ; reset
...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
hello sir
thanks for youre effort to help me
realy i all have tryed that
" ldw X, (X)
    neg A
    rlwa X, A
    int #$040200
;    nop
;    nop
;    nop
;    nop
    rlwa X, A
thats the error code the assembler gives me, but i try to over come that
just temporaly with 4 nop
main.asm(2378): as1 : Error 56: unrecognised opcode '    int #$040200 '
sir, maybe i am a "stupid  71y old man" but me too i am an electronique
engeneer, and have already programmed since,
8080-6502-6802-6809-atmega2560-cop8-,
and realy i tryed all, be sure i would otherwise not at all asked youre help
many thanks
marc debruyne
Op 20/10/2022 om 15:50 schreef ST Community:

Contextually this looks wrong. Is this coming from some sample/example, or you just trying to code something?

I'm not sure it's available as a 24-bit call instruction, but I'm not an STM8 user.

Isn't this supposed just to sit in the interrupt vector table?

Try using the 32-bit word function, or whatever this assembler uses

ie DC.L $82040200

Have you tried IAR, or other STM8 assemblers?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..