2023-11-28 04:48 AM
Hello
How can I access STM8S CPU registers (Cosmic compiler)? When I write this "A = 0xff" (A is a processor register accumulator), then compiler writes this "#error cpstm8 main.c:17(3) A undefined". How to fix it?
Solved! Go to Solution.
2023-11-28 05:38 AM
Hello,
You need to access internal CPU registers with assembly language. You can insert asm code inside C code.
See https://www.cosmicsoftware.com/pdf/cxstm8_pd.pdf / page 2.
PS: this thread is the duplication of this one: https://community.st.com/t5/stm8-mcus/stm8-cpu-register-cosmic/td-p/614181
2023-11-28 05:38 AM
Hello,
You need to access internal CPU registers with assembly language. You can insert asm code inside C code.
See https://www.cosmicsoftware.com/pdf/cxstm8_pd.pdf / page 2.
PS: this thread is the duplication of this one: https://community.st.com/t5/stm8-mcus/stm8-cpu-register-cosmic/td-p/614181