2022-06-28 05:42 AM
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
Solved! Go to Solution.
2022-07-01 09:16 AM
"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
2022-07-01 06:45 AM
Essentially the same question as this one.
Regards
/Peter
2022-07-01 07:14 AM
Perhaps there's some issue with spaces, or that the syntax for SP is always immediate,ie SUB SP, 2
2022-07-01 09:00 AM
>>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.
2022-07-01 09:16 AM
"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