mikeakohn / naken_asm

Assembler for MSP430, dsPIC, ARM, MIPS, 65xx, 68000, 8051/8052, Atmel AVR8, and others.
http://www.mikekohn.net/micro/naken_asm.php
GNU General Public License v3.0
290 stars 49 forks source link

Endianess directives not recognized (and default wrong on STM8) #6

Closed abe-k closed 9 years ago

abe-k commented 9 years ago

When issuing one of the directives .big_endian or .little_endian, the assembler fails with, for example,

Error: Unknown directive 'big_endian' at filename:lineno.

This is because the conditionals in check_for_directive for these two directives do not return 1, but fall through to return 0, indicating no directive matched.

I also note that the default endianness specified for STM8 is incorrect: it is actually a big-endian processor.

This is a serious problem, as it means any word-length data or addresses stored will be loaded in backwards.

mikeakohn commented 9 years ago

This worked at one time. I added an automated test so it shouldn't break again.