diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-30 00:04:10 +0100 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-30 00:04:10 +0100 |
| commit | 7c4ae5853b472f0a2bb1dd049a818ab8346c5cff (patch) | |
| tree | 39530381cd7cf5c7831a25a34f53410a40346a5e /src | |
| parent | 3378ab8f236f387978fa4cc75bd5fca7021e8a13 (diff) | |
| download | sdcc-gas-7c4ae5853b472f0a2bb1dd049a818ab8346c5cff.tar.gz | |
Bugfixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/stm8/gen.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/stm8/gen.c b/src/stm8/gen.c index 91dd7c7..e910ece 100644 --- a/src/stm8/gen.c +++ b/src/stm8/gen.c @@ -7655,7 +7655,13 @@ genJumpTab (const iCode *ic) if (!regalloc_dry_run) { - emit2 ("ldw", "x, (#!tlabel, x)", labelKey2num (jtab->key)); + if (options.gasOutput) + /* The '#' character might confuse GNU as to think !tlabel + * is an immediate operand instead of a label address. */ + emit2 ("ldw", "x, (!tlabel, x)", labelKey2num (jtab->key)); + else + emit2 ("ldw", "x, (#!tlabel, x)", labelKey2num (jtab->key)); + emit2 ("jp", "(x)"); } cost (4, 3); @@ -7669,7 +7675,7 @@ genJumpTab (const iCode *ic) dbuf_init(&b, 1024); /* emit2 (".dw", "#!tlabel", labelKey2num (jtab->key)); */ - emit2 ("", "!dw %d", labelKey2num (jtab->key)); + emit2 ("", "!dw !tlabel", labelKey2num (jtab->key)); } cost (2, 0); } |
