[hackers] [scc] [cc2-z80] Fix emision of strings || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 26 Jan 2016 14:22:11 +0100 (CET)

commit 7b4df93c6808bb73a3bfc1389f9f2a15dde30796
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Jan 26 14:17:49 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Jan 26 14:17:49 2016 +0100

    [cc2-z80] Fix emision of strings
    
    Strings of 2 bytes were emitted with DW directives.

diff --git a/cc2/arch/z80/code.c b/cc2/arch/z80/code.c
index 92799a8..c453822 100644
--- a/cc2/arch/z80/code.c
+++ b/cc2/arch/z80/code.c
_AT_@ -152,19 +152,23 @@ size2asm(Type *tp)
         /*
          * In z80 we can ignore the alignment
          */
- switch (tp->size) {
- case 1:
+ if (tp->flags & STRF) {
                 s = "\tDB\t";
- break;
- case 2:
- s = "\tDW\t";
- break;
- case 4:
- s = "\tDD\t";
- break;
- default:
- s = (tp->flags & STRF) ? "\tTEXT\t" : "\tDS\t%llu,";
- break;
+ } else {
+ switch (tp->size) {
+ case 1:
+ s = "\tDB\t";
+ break;
+ case 2:
+ s = "\tDW\t";
+ break;
+ case 4:
+ s = "\tDD\t";
+ break;
+ default:
+ s = "\tDS\t%llu,";
+ break;
+ }
         }
         printf(s, (unsigned long long) tp->size);
 }
Received on Tue Jan 26 2016 - 14:22:11 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 26 2016 - 14:24:38 CET