Initial import
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 15 Oct 2003 06:13:11 +0000 (06:13 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 15 Oct 2003 06:13:11 +0000 (06:13 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2943 4a8a32a2-be11-0410-ad9d-d568d2c75423

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

diff --git a/support/regression/ports/hc08/spec.mk b/support/regression/ports/hc08/spec.mk
new file mode 100644 (file)
index 0000000..8a3be0a
--- /dev/null
@@ -0,0 +1,41 @@
+# Port specification for the xxxx port running with uCsim
+#
+
+# path to uCsim
+UCHC08 = $(SDCC_DIR)/bin/shc08
+
+SDCCFLAGS +=-mhc08 --less-pedantic --out-fmt-ihx -DREENTRANT=
+#SDCCFLAGS +=--less-pedantic -DREENTRANT=reentrant
+
+OBJEXT = .rel
+EXEEXT = .ihx
+
+EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
+
+# Rule to link into .ihx
+#%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
+
+%$(EXEEXT): %.c $(EXTRAS)
+       $(SDCC) $(SDCCFLAGS) $< $(EXTRAS) -o $@
+
+%$(OBJEXT): %.asm
+       $(SDCC_DIR)/bin/as-hc08 -plosgff $<
+
+%$(OBJEXT): %.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
+       $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+# run simulator with 10 seconds timeout
+%.out: %$(EXEEXT) fwk/lib/timeout
+       mkdir -p `dirname $@`
+       -fwk/lib/timeout 10 $(UCHC08) -t32 $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
+         || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
+       -grep -n FAIL $@ /dev/null || true
+
+fwk/lib/timeout: fwk/lib/timeout.c
+
+_clean:
+       rm -f ports/$(PORT)/testfwk.asm ports/$(PORT)/*.lst ports/$(PORT)/*.rel ports/$(PORT)/*.sym
+
diff --git a/support/regression/ports/hc08/support.c b/support/regression/ports/hc08/support.c
new file mode 100644 (file)
index 0000000..3a847d4
--- /dev/null
@@ -0,0 +1,16 @@
+
+void
+_putchar(unsigned char c)
+{
+  _asm
+    .db 0x9e, 0xed
+  _endasm;
+}
+
+void
+_exitEmu(void)
+{
+  _asm
+    .db 0x9e, 0xec
+  _endasm;
+}
diff --git a/support/regression/ports/hc08/uCsim.cmd b/support/regression/ports/hc08/uCsim.cmd
new file mode 100644 (file)
index 0000000..58afc78
--- /dev/null
@@ -0,0 +1,2 @@
+run
+quit