shithub: scc

Download patch

ref: 7b4df93c6808bb73a3bfc1389f9f2a15dde30796
parent: 7d416c42124594d23b5c26d6951b748a43b4de65
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Jan 26 09:17:49 EST 2016

[cc2-z80] Fix emision of strings

Strings of 2 bytes were emitted with DW directives.

--- a/cc2/arch/z80/code.c
+++ b/cc2/arch/z80/code.c
@@ -152,19 +152,23 @@
 	/*
 	 * 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);
 }