summaryrefslogtreecommitdiff
path: root/src/stm8/main.c
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-23 03:57:38 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-23 03:57:38 +0200
commit9c47d08e98953623ceac02c8422863e593deb40e (patch)
tree69c881d20ac0bc878bdd91da8dc2e668374a3dbc /src/stm8/main.c
parent4df948b3c184864525e7fa7e26ab380a70d644cd (diff)
downloadsdcc-gas-9c47d08e98953623ceac02c8422863e593deb40e.tar.gz
Implemented -c support for --gas
STM8 code generator was generating some instructions in a "ld register, (#%d, register)" way, causing assembling errors on stm8-as. This is because stm8-as does not require the '#' character. A quick and dirty workaround has been implemented for this. Added new warning W_IGNORED_OPT_IN_ASM, which warns the user when both "--no-optsdcc-in-asm" and "--gas" are used (the first is ignored when the latter is active since GNU as does not accept the .optsdcc directive, as opposed to asxxx).
Diffstat (limited to 'src/stm8/main.c')
-rw-r--r--src/stm8/main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/stm8/main.c b/src/stm8/main.c
index b935f96..5c48247 100644
--- a/src/stm8/main.c
+++ b/src/stm8/main.c
@@ -285,8 +285,7 @@ stm8_genInitStartup (FILE *of)
"\tincw x\n"
"\tcpw x, __bss_end\n"
"\tjrne 0$\n"
- "\t; Copying .data from ROM to RAM\n"
- "\t; Calculate .data section size\n"
+ "\t; Transfer .data from ROM to RAM\n"
"\tldw x, __data_load_start\n"
"\tldw y, __data_start\n"
"1$:\n"
@@ -427,6 +426,11 @@ static const char *stm8AsmCmd[] =
"sdasstm8", "$l", "$3", "\"$1.asm\"", NULL
};
+static const char *stm8AsmGNUCmd[] =
+{
+ "stm8-as", "\"$1.asm\"", "-o", "\"$1.o\"", NULL
+};
+
static const char *const _libs_stm8[] = { "stm8", NULL, };
PORT stm8_port =
@@ -448,7 +452,9 @@ PORT stm8_port =
"-plosgffwy", /* Options with debug */
"-plosgffw", /* Options without debug */
0,
- ".asm"
+ ".asm",
+ NULL,
+ stm8AsmGNUCmd /* GNU assembler command */
},
{ /* Linker */
_linkCmd,
@@ -458,6 +464,7 @@ PORT stm8_port =
1,
NULL, /* crt */
_libs_stm8, /* libs */
+ ".o" /* ELF output extension */
},
{ /* Peephole optimizer */
stm8_defaultRules,