I am trying to write a program in assembly language for the stm8sf103 microcontroller.
I would like to store an immediate hexadecimal value in a ram register (such as $0), but this isn't working and i am wondering why:
stm8/
segment 'rom'
loop
ld $0,#5
jp loop
end
I get the error:
as1 : Error 54: Can't match Addressing mode ' ld $0,#5'
Use
The instruction doesn't affect any condition flag.
From the ST8 Programming Manual, the description of
MOVisYou can refer to that manual for the supported addressing modes (20 in total), so you can understand why
ld $0,#5cannot work (there is no Direct with Immediate addressing).1 I can't understand this phrase, I believe there is a typo (it should be Data is not examined ...). The manual clearly states that no flag is affected.