Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!not-for-mail From: David Kuehling Newsgroups: comp.lang.forth Subject: Gforth-EC, the underappreciated embedded Forth Date: Mon, 06 Feb 2012 23:07:36 +0100 Lines: 43 Message-ID: <87fwen62fr.fsf@snail.Pool> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.uni-berlin.de ipke9JkAfzGateWguuplgwOuf2ixBpAr1y5D2acJ4m9srygi8= Cancel-Lock: sha1:RgLHBudYeFUbZ5zR5DqtHV+oe0Y= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Xref: x330-a1.tempe.blueboxinc.net comp.lang.forth:9373 Hi, I've been having a look at Gforth-EC lately, that's the embedded cross-compiled Forth support that has been included with Gforth all the time, but as it's well hidden and pretty undocumented, I guess most people wouldn't have noticed it. Now it turns out it only takes a few commands to generate a usable 8086 gforth-ec executable, running in dosbox (i.e. emulated under Linux): From the Gforth source directory, run: ./build-ec 8086 mv kernl-8086.fi gforthec.com # need to rename for dosbox to execute it dosbox gforthec.com And voila, it prints the standard Gforth welcome message. Some testing: here . 14334 ok unused u. 47162 ok words [..] dup lit branch >r r> c! c@ (emit) (key) lastkey and xor + rp! rp@ sp! sp@ ! @ ?branch execute ;s ok More Forth-code to cross-compile can be added in arch/8086/prims.fs. Now 8086 code isn't really very interesting to most modern computer users, but 8086 isn't the only architecture supported by gforth-ec. I can successfully run build-ec for 8086, r8c and misc. Other targets that seem to have been supported at some time are m68k, shboom, 6502, c165 and 4stack, but with current Gforth-CVS compilation fails for those. Adding support for new target is not too difficult. Currently I'm trying to make it work for the LatticeMico32 CPU (the Milkymist SoC). cheers, David -- GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40