diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-24 06:19:28 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-24 06:19:28 +0200 |
| commit | d5577a84aadd0195a95b5b4d83e49b40af49425b (patch) | |
| tree | 39ef608e0743b5e2fdc09fa9f3bc113272a5713c /src/SDCCglue.c | |
| parent | 8eeb5d5444b2f29aa56fb1f0f8f20955c160e99e (diff) | |
| download | sdcc-gas-d5577a84aadd0195a95b5b4d83e49b40af49425b.tar.gz | |
Got hi8/lo8 asm instructions working
GNU as does not support the #</#> notation asxxx uses to determine
address LSB and MSB. Instead, two instructions have been created on
GNU as and ld (see my stm8-binutils-gdb fork) for this purpose.
On the other hand, I'm upset to see gen.c does not provide an
assembler-agnostic implementation when SDCCasm.c already provides
tools already meant for this.
OTOH, support for the "-C" has been added for --gas.
Diffstat (limited to 'src/SDCCglue.c')
| -rw-r--r-- | src/SDCCglue.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/SDCCglue.c b/src/SDCCglue.c index d584303..9255137 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -1499,8 +1499,8 @@ printIvalFuncPtr (sym_link * type, initList * ilist, struct dbuf_s *oBuf) { if (TARGET_PDK_LIKE) { - dbuf_printf (oBuf, "\tret #<%s\n", name); - dbuf_printf (oBuf, "\tret #>%s\n", name); + dbuf_tprintf (oBuf, "\tret !lsbimmeds\n", name); + dbuf_tprintf (oBuf, "\tret !msbimmeds\n", name); } else if (TARGET_IS_STM8 && FUNCPTRSIZE == 3) { @@ -1560,7 +1560,7 @@ printIvalCharPtr (symbol * sym, sym_link * type, value * val, struct dbuf_s *oBu { if (TARGET_PDK_LIKE && !TARGET_IS_PDK16) { - dbuf_printf (oBuf, "\tret #<%s\n", val->name); + dbuf_tprintf (oBuf, "\t!lsbimmeds", val->name); dbuf_printf (oBuf, IN_CODESPACE (SPEC_OCLS (val->etype)) ? "\tret #>(%s + 0x8000)\n" : "\tret #0\n", val->name); } else if (port->use_dw_for_init) @@ -2130,7 +2130,14 @@ createInterruptVect (struct dbuf_s *vBuf) return; } - dbuf_tprintf (vBuf, "\t!areacode\n", HOME_NAME); + dbuf_tprintf (vBuf, "\t!areacode", HOME_NAME); + + if (options.gasOutput) + /* Read-executable flags must be defined so ld can + * place the interrupt vectors into a separate section.*/ + dbuf_tprintf (vBuf, ",\t\"ax\""); + + dbuf_printf(vBuf, "\n"); dbuf_printf (vBuf, "__interrupt_vect:\n"); |
