Skip to main content
debruyne.marc
Associate III
September 14, 2021
Question

ERROR IN PROGRAMMING MANUAL?????????

  • September 14, 2021
  • 2 replies
  • 4442 views

hello sir

can someone, help me with that "SUB SP,#$9 " ,with is mentioned in the LATEST PROGRAMMING MANUAL OF STM8S PAGE 151.

if you write that in an even very 1line program, you have an error

Can't match Addressing mode ' SUB SP,#$9'

is there a n error of me, or is the manual example not correct

thanks for the help

    This topic has been closed for replies.

    2 replies

    Philipp Krause
    Senior II
    September 23, 2021

    The manual looks okay to me.

    I guess you are using an assembler that uses a different syntax for hex immediates.

    You should tell us which assembler you use. E.g. in sdasstm8 (the assembler that comes with SDCC), the syntax would be sub sp, #0x09.

    Tesla DeLorean
    Guru
    July 1, 2022
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    July 1, 2022

    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"

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    debruyne.marc
    Associate III
    July 2, 2022

    hello sir

    thanks for youre answer,thats it,its works now

    a nice day