From: michaelh Date: Mon, 22 May 2000 02:31:58 +0000 (+0000) Subject: Preparing for 2.2.1 with good z80 support. X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=5c4397798deb5012e75c2e51478df697d5946c85;p=fw%2Fsdcc Preparing for 2.2.1 with good z80 support. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@256 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/Makefile b/Makefile index 01c94352..9cc27724 100644 --- a/Makefile +++ b/Makefile @@ -6,21 +6,41 @@ SHELL = /bin/sh AUTOCONF = autoconf PRJDIR = . -PKGS = support/gc support/cpp \ - src as/mcs51 as/z80 link/z80 debugger/mcs51 \ - device/include device/lib sim/ucsim +PKGS = debugger/mcs51 sim/ucsim +SDCC_LIBS = support/gc support/cpp +SDCC_ASLINK = as/mcs51 as link + PRJS = sim/ucsim PORTS = mcs51 z80 srcdir = . - # Compiling entire program or any subproject # ------------------------------------------ -all: checkconf +all: checkconf sdcc + +sdcc-libs: + for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done + +sdcc-cc: sdcc-libs + $(MAKE) -C src + +sdcc-aslink: + for as in $(SDCC_ASLINK); do $(MAKE) -C $$as; done + +sdcc-misc: for pkg in $(PKGS); do $(MAKE) -C $$pkg; done + $(MAKE) -C sim/ucsim + +sdcc-device: + $(MAKE) -C device/include + $(MAKE) -C device/lib + +sdcc: sdcc-cc sdcc-aslink sdcc-misc sdcc $(MAKE) -f main.mk all +# Some interesting sub rules +sdcc-bin: sdcc-cc sdcc-aslink # Compiling and installing everything and runing test # --------------------------------------------------- diff --git a/doc/SDCCUdoc-30.html b/doc/SDCCUdoc-30.html new file mode 100644 index 00000000..199c6aaf --- /dev/null +++ b/doc/SDCCUdoc-30.html @@ -0,0 +1,33 @@ + + + + + SDCC Compiler User Guide: Acknowledgments + + + + + +Next +Previous +Contents +
+

30. Acknowledgments

+ +

Alan Baldwin (baldwin@shop-pdp.kent.edu) - Initial version of ASXXXX & +ASLINK. +

John Hartman (jhartman@compuserve.com) - Porting ASXXX & ASLINK for +8051 +

Dmitry S. Obukhov (dso@usa.net) - malloc & serial i/o routines. +

Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu> - for his Freeware +simulator +

Jans J Boehm(boehm@sgi.com) and Alan J Demers - Conservative garbage collector +for C & C++. +

Malini Dutta(malini_dutta@hotmail.com) - my wife for her patience and support. +

Unknown - for the GNU C - preprocessor. +


+Next +Previous +Contents + + diff --git a/doc/SDCCUdoc-31.html b/doc/SDCCUdoc-31.html new file mode 100644 index 00000000..07d9efe1 --- /dev/null +++ b/doc/SDCCUdoc-31.html @@ -0,0 +1,34 @@ + + + + + SDCC Compiler User Guide: Appendix A: The Z80 and gbz80 port + + + + +Next +Previous +Contents +
+

31. Appendix A: The Z80 and gbz80 port

+ +

2.2.0 can target both the Zilog Z80 and the Nintendo Gameboy's Z80-like +gbz80. The port is incomplete - long support is incomplete (mul, div and mod +are unimplimented), and both float and bitfield support is missing, but apart +from that the code generated is correct. +

As always, the code is the authoritave reference - see z80/ralloc.c and +z80/gen.c. The stack frame is similar to that generated by the IAR Z80 compiler. +IX is used as the base pointer, HL is used as a temporary register, and BC +and DE are available for holding varibles. IY is currently unusued. Return +values are stored in HL. One bad side effect of using IX as the base pointer +is that a functions stack frame is limited to 127 bytes - this will be fixed +in a later version.bc +

9 +

+


+Next +Previous +Contents + + diff --git a/support/scripts/build.mak b/support/scripts/build.mak new file mode 100644 index 00000000..88a0beff --- /dev/null +++ b/support/scripts/build.mak @@ -0,0 +1,126 @@ +# Makefile to get and build all the parts of GBDK + +CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ + else if [ -x /bin/bash ]; then echo /bin/bash; \ + else echo sh; fi ; fi) + +TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) + +BUILD = $(TOPDIR)/build/sdcc +SDCCLIB = $(BUILD) +CVSFLAGS = -z5 +CVS = cvs +DIR = . +VER = 2.94 +# Used as a branch name. +SHORTVER = 294 + +ROOT_GBDK = :pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk +ROOT_SDCC = :pserver:anonymous@cvs.sdcc.sourceforge.net:/cvsroot/sdcc + +# For mingw32 hosted on Linux +# Source extension - what the gcc generated files have appended +#SE = +# Dest extenstion - what extension we want them to have. +#E = .exe +#SDCC_ROOT = \\\\gbdk + +# For mingw32 on win32 +# Source extension - what the gcc generated files have appended +#SE = .exe +# Dest extenstion - what extension we want them to have. +#E = .exe +#SDCC_ROOT = \\\\gbdk + +# For Linux +SE = +E = +SDCC_ROOT = /usr/lib/sdcc + +#all: logged_in dist +all: dist + +clean: + for i in sdcc gbdk-lib gbdk-support/lcc; do make -C $$i clean; done + rm -f *~ + rm -rf $(BUILD) gbdk-lib gbdk-support sdcc logged_in + +update: logged_in + cd $(DIR); cvs $(CVSFLAGS) -d$(ROOT_SDCC) co -r gbdk-$(SHORTVER) sdcc + cd $(DIR); cvs $(CVSFLAGS) -d$(ROOT_GBDK) co -r gbdk-$(SHORTVER) gbdk-lib + cd $(DIR); cvs $(CVSFLAGS) -d$(ROOT_GBDK) co -r gbdk-$(SHORTVER) gbdk-support + +_sdcc: sdcc-bin sdcc-lib sdcc-doc + +tidy: + rm -rf `find $(BUILD) -name "CVS"` + rm -rf `find $(BUILD)/lib -name "*.asm"` + -strip $(BUILD)/bin/* + +sdcc-bin: sdcc/sdccconf.h + make -C sdcc sdcc-bin + mkdir -p $(BUILD)/bin + for i in \ + sdcc sdcpp link-gbz80 as-gbz80 aslink asx8051 sdcdb; \ + do cp sdcc/bin/$$i$(SE) $(BUILD)/bin/$$i$(E); done + cp sdcc/sim/ucsim/s51.src/s51$(E) $(BUILD)/bin + cp sdcc/sim/ucsim/z80.src/sz80$(E) $(BUILD)/bin + cp sdcc/sim/ucsim/avr.src/savr$(E) $(BUILD)/bin + cp sdcc/debugger/mcs51/*.el $(BUILD)/bin + +sdcc-doc: + (cd sdcc; tar cf - doc) | (cd $(BUILD); tar xf -) + cp sdcc/README sdcc/COPYING $(BUILD) + mkdir -p $(BUILD)/sim + for i in COPYING INSTALL README TODO; \ + do cp sdcc/sim/ucsim/$$i $(BUILD)/sim; done + (cd sdcc/sim/ucsim; tar cf - doc) | (cd $(BUILD)/sim; tar xf -) + +sdcc-lib: sdcc-lib-z80 sdcc-lib-gen + mkdir -p $(BUILD)/lib + (cd sdcc/device/lib; tar cf - small large) | (cd $(BUILD)/lib; tar xf -) + (cd sdcc/device; tar cf - examples include) | (cd $(BUILD); tar xf -) + +sdcc-lib-z80: + make -C gbdk-lib/libc SDCCLIB=$(BUILD) PORTS=z80 PLATFORMS=consolez80 + (cd gbdk-lib/build; tar cf - consolez80 z80) | (cd $(BUILD)/lib; tar xf -) + +sdcc-lib-gen: + make -C sdcc sdcc-device + +sdcc/sdccconf.h: sdcc/configure + cd sdcc; \ + ./configure --datadir=$(SDCC_ROOT) + +_gbdk-lib: _sdcc-min _gbdk-support + cp -r gbdk-lib/include $(BUILD) + make -C gbdk-lib SDCCLIB=$(SDCCLIB) PORTS=gbz80 PLATFORMS=gb + +_gbdk-support: + make -C gbdk-support/lcc clean + make -C gbdk-support/lcc SDCCLIB=$(SDCC_ROOT)/ + mkdir -p $(BUILD)/bin + cp gbdk-support/lcc/lcc$(SE) $(BUILD)/bin/lcc$(E) + +dist: _sdcc-min _gbdk-lib _gbdk-support + mkdir -p $(BUILD)/bin + mkdir -p $(BUILD)/lib + cp -r gbdk-lib/build/gbz80 $(BUILD)/lib + cp -r gbdk-lib/build/gb $(BUILD)/lib + make -C gbdk-lib/libc clean + make -C gbdk-lib/examples/gb make.bat + cp -r gbdk-lib/examples $(BUILD) + cp -r gbdk-lib/libc $(BUILD) + cp -r sdcc/doc $(BUILD) + cp gbdk-support/README $(BUILD) + strip $(BUILD)/bin/* + rm -rf `find gbdk -name "CVS"` + +zdist: dist + tar czf gbdk-$(VER).tar.gz gbdk + +logged_in: + cvs -d$(ROOT_GBDK) login + cvs -d$(ROOT_SDCC) login + touch logged_in + make -f update.mak update diff --git a/support/tests/dhrystone/dhry.c b/support/tests/dhrystone/dhry.c index cd0f189b..6cf80df3 100644 --- a/support/tests/dhrystone/dhry.c +++ b/support/tests/dhrystone/dhry.c @@ -87,6 +87,8 @@ Enumeration Func_1 (Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val); Boolean Func_2 (char *Str_1_Par_Ref, char *Str_2_Par_Ref); Boolean Func_3 (Enumeration Enum_Par_Val); +unsigned getsp(void); + int main(void) { One_Fifty Int_1_Loc; @@ -105,7 +107,6 @@ int main(void) Next_Ptr_Glob = &_r[0]; Ptr_Glob = &_r[1]; - Ptr_Glob->Ptr_Comp = Next_Ptr_Glob; Ptr_Glob->Discr = Ident_1; Ptr_Glob->variant.var_1.Enum_Comp = Ident_3; @@ -123,13 +124,15 @@ int main(void) /* overflow may occur for this array element. */ /* 32766 is the highest value for a 16 bitter */ - Number_Of_Runs = 32766; + Number_Of_Runs = 10000; runTime = clock(); /* Main test loop */ for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index) { DPRINTF(("Run_Index = %d\n", Run_Index)); + if (!(Run_Index & 1023)) + printf("Loops: %u\r", Run_Index); Proc_5(); Proc_4(); /* Ch_1_Glob == 'A', Ch_2_Glob == 'B', Bool_Glob == true */