add mcs51-port
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 23 Aug 2001 12:53:07 +0000 (12:53 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 23 Aug 2001 12:53:07 +0000 (12:53 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1163 4a8a32a2-be11-0410-ad9d-d568d2c75423

support/regression/Makefile
support/regression/fwk/lib/testfwk.c

index daa42ef779157fdfe1a2dfe9723c9d5e0bad4618..b320936528734cf9a7a10d96ec9fbac455b8d2c3 100644 (file)
@@ -20,8 +20,9 @@
 #       o Provides the emulators
 #   * The gbdk-lib package from gbdk.
 #       o cvs -d cvs.gbdk.sourceforge.net:/cvsroot/gbdk co gbdk-lib
-#       o Provildes mul, div, and include files for the z80 tests.
+#       o Proviles mul, div, and include files for the z80 tests.
 #   * python 1.5 or above
+#   * uCsim for the mcs51 port
 #
 # The paths below assume that sdcc, sdcc-extra, and gbdk-lib all reside in
 # the same directory.
@@ -60,7 +61,7 @@ GENERATE_CASES = generate-cases.py
 # The port name must be the same as the one used in the SDCC '-mxxx' argument.
 # Each port must have a spec.mk which describes how to build the object
 # files and how to run the emulator.
-ALL_PORTS = $(filter-out CVS,$(notdir $(wildcard $(PORTS_DIR)/*)))
+ALL_PORTS = $(filter-out CVS mcs51,$(notdir $(wildcard $(PORTS_DIR)/*)))
 
 all: test-ports
 
index 55e2085b6fe0079195aa477991a418593d208a96..8ba42960bc8ba66e0ca8bbaa528076e67f3c980c 100644 (file)
@@ -57,6 +57,18 @@ static void _printn(int n)
     _putchar('0' + rem);
 }
 
+#ifdef SDCC_mcs51
+union
+{
+    struct
+    {
+      int  offset;
+      char data_space;
+    } part;
+    char *p;
+} generic_p_u;
+#endif
+
 void __printf(const char *szFormat, ...) REENTRANT
 {
     va_list ap;
@@ -66,7 +78,16 @@ void __printf(const char *szFormat, ...) REENTRANT
         if (*szFormat == '%') {
             switch (*++szFormat) {
             case 's': {
+#ifdef SDCC_mcs51
+#warning Workaround bug #436344
+                char GENERIC *sz;
+
+                generic_p_u.part.data_space = va_arg (ap, char);
+                generic_p_u.part.offset     = va_arg (ap, int);
+                sz = generic_p_u.p;
+#else
                 char GENERIC *sz = va_arg(ap, char GENERIC *);
+#endif
                 while (*sz) {
                     _putchar(*sz++);
                 }