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

support/regression/ports/mcs51/spec.mk [new file with mode: 0644]
support/regression/ports/mcs51/support.c [new file with mode: 0644]
support/regression/ports/mcs51/uCsim.cmd [new file with mode: 0755]

diff --git a/support/regression/ports/mcs51/spec.mk b/support/regression/ports/mcs51/spec.mk
new file mode 100644 (file)
index 0000000..591317b
--- /dev/null
@@ -0,0 +1,32 @@
+# Port specification for the mcs51 port running with uCsim
+
+S51 = ../../sim/ucsim/s51.src/s51
+
+SDCCFLAGS += --lesspedantic -DREENTRANT=reentrant -DGENERIC=_generic
+
+OBJEXT = .rel
+EXEEXT = .ihx
+
+# Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
+EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
+
+# Rule to link into .ihx
+%.ihx: %$(OBJEXT) $(EXTRAS)
+       $(SDCC) $(SDCCFLAGS) $(EXTRAS) $<
+       mv fwk/lib/testfwk.ihx $@
+       mv fwk/lib/testfwk.map $(@:.ihx=.map)
+
+# %$(OBJEXT): %.asm
+#      ../../bin/as-z80 -plosgff $@ $<
+
+# %$(OBJEXT): %.s
+#      ../../bin/as-z80 -plosgff $@ $<
+
+%$(OBJEXT): %.c
+       $(SDCC) $(SDCCFLAGS) -c $<
+
+# PENDING: Path to sdcc-extra
+%.out: %$(EXEEXT)
+       mkdir -p `dirname $@`
+       $(S51) -t32 -S in=$(shell tty),out=$@ $< < ports/mcs51/uCsim.cmd >/dev/null 2>&1
+       -grep -n FAIL $@ /dev/null || true
diff --git a/support/regression/ports/mcs51/support.c b/support/regression/ports/mcs51/support.c
new file mode 100644 (file)
index 0000000..9678dbc
--- /dev/null
@@ -0,0 +1,14 @@
+// #define MICROCONTROLLER_8051 
+#include <mcs51reg.h>
+
+void
+_putchar (char c)
+{
+  SBUF = c;
+}
+
+void
+_exitEmu (void)
+{
+  * (char idata *) 0 = * (char _xdata *) 0x7654;
+}
diff --git a/support/regression/ports/mcs51/uCsim.cmd b/support/regression/ports/mcs51/uCsim.cmd
new file mode 100755 (executable)
index 0000000..3ba0751
--- /dev/null
@@ -0,0 +1,3 @@
+break xram r 0x7654
+run
+quit