cancel
Showing results for 
Search instead for 
Did you mean: 

hello sir i use the nucleo stm8s208rb with asembler language, so i start with the st visual develop and write even a small program l

debruyne.marc
Associate II

hello sir

a very simple asembler program ,with a big problem

its in ST visual develop , with the inside st assembler

that simple program

ldw X,#stack_end

ldw SP,X

 PUSH $C

 SUB SP,#$02

gives that error

 Error 54: Can't match Addressing mode ' SUB SP,#$02'

how can that besolved?

and please no answer as learn c.

many thanks

1 ACCEPTED SOLUTION

Accepted Solutions

https://www.st.com/resource/en/release_note/rn0005-st-assemblerlinker-asm-452-lyn-319-obsend-215-stmicroelectronics.pdf

"3.1 ASM limitations 3.1.1 Limitations for STM8 assembler �? The mnemonics of the following STM8 instructions: ADD SP,#byte SUB SP,#byte have been replaced by: ADDW SP,#byte SUBW SP,#byte"

Use SUBW SP,#$9

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

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

Essentially the same question as this one.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Perhaps there's some issue with spaces, or that the syntax for SP is always immediate,ie SUB SP, 2

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

>>and please no answer as learn c

Ok, so won't tell you to do that, but if you want to find a richer set of examples and use cases for instructions and forms that you're unfamiliar or unsure of, having the compiler generate a LISTING file, or having a disassembler or debugger generate a disassembly can be quite useful.

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

https://www.st.com/resource/en/release_note/rn0005-st-assemblerlinker-asm-452-lyn-319-obsend-215-stmicroelectronics.pdf

"3.1 ASM limitations 3.1.1 Limitations for STM8 assembler �? The mnemonics of the following STM8 instructions: ADD SP,#byte SUB SP,#byte have been replaced by: ADDW SP,#byte SUBW SP,#byte"

Use SUBW SP,#$9

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