2019-10-01 11:08 AM
I have started writing some STM8 code in assembler and happened upon a memory assignment issue I can't explain.
Globally I have
segment 'ram0'
Test_Word ds.w
in code:
ldw X, #$48
ldw Test_Word , X
The two bytes of memory at location Test_Word is 00 $48
This appears to be Big Endian memory assignment
if in code ...
ld A, #5
ld Test_Word , A
The two bytes of memory at location Test_Word is 05 $48
To me this is very strange.
Can someone explain why the instructions
ldw X, #$48
ldw Test_Word , X
Did not populate memory as $48 00
Thanks in advance for any insight.
Joe
2019-10-06 02:08 AM
No. STM8 is big endian.
2019-10-06 03:05 AM
if you want to make sure, make a program with a 16 bit global variable, store a value and check the 2 bytes in debug watch or memory window.
Works for any core, and might give the answer faster than reading a programming manual.