ISSN 0265-5195 Special Issue June 2000 An Introduction to Machine Forth John Tasgal An Introduction to Color Forth John Tasgal The BMP Example John Tasgal FIG UK Committee Chair Chris Hainsworth, Microplex Ltd., 5a Riverfield Road, STAINES TW18 2EE 01784 457565 Secretary Doug Neale, 58 Woodland Way, MORDEN SM4 4DS 020 8542 2747 Editor Chris Jakeman, dneale@w58wmorden.demon.co.uk 50 Grimshaw Road, PETERBOROUGH PE1 4ET 01733 753489 Treasurer chris.hainsworth@dial.pipex.com Keith Matthews, cjakeman@bigfoot.com 20 Spindlebury, CULLOMPTON EX15 1SY 01884 34818 Webmaster Jenny Brien, Windy Hill, Drumkeen, BALLINAMALLARD, Co Fermanagh BT94 2HJ 02866 388 253 Librarian jennybrien@bmallard.swinternet.co.uk Sylvia Hainsworth, Microplex Ltd., 5a Riverfield Road, STAINES 01784 457565 sylvia.hainsworth@dial.pipex.com Membership enquiries, renewals and changes of address to Doug. Technical enquiries and anything for publication to Chris Jakeman. Borrowing requests for books, magazines and proceedings to Sylvia. FIG UK Web Site For indexes to our Library and Forthwrite and much more, see http://forth.org.uk FIG UK Membership Payment entitles you to 6 issues of Forthwrite magazine and our membership services for that period (about a year). Fees are: National and international International served by airmail Corporate £12 £22 £36 (3 copies of each issue) Forthwrite Deliveries Your membership number appears on your envelope label. Please quote it in correspondence to us. Look out for the message "SUBS NOW DUE" on your sixth and last issue and please complete the renewal form enclosed. Overseas members can opt to pay the higher price for airmail delivery. 1 Editorial This is a special issue to publish in one place a series of 3 articles commissioned from John Tasgal. The recent software explorations of the originator of Forth, Charles (Chuck) Moore, have attracted lots of attention in the Forth community. Chuck has given several talks and more information is available on the Ultra Technology web site published by Jeff Fox (www.ultratechnology.com) . A paper on implementing Machine Forth was presented by Reuben Thomas at the 1999 euroFORTH conference. However, there are still details which are difficult to pin down and Chuck has published some code examples that warrant a detailed commentary. With help from Jeff Fox, John has endeavoured to fill this gap. Until next time, keep on Forthing, John Tasgal 0161 7739365 john@tcl.prestel.co.uk An Introduction to Machine Forth John Tasgal There has been a lot of interest in Charles (Chuck) Moore's recent work on special processors and the languages that go with them (see issue June 1999 for an interview with Moore). These are Forths that deviate from the classical model to match the hardware more closely. The differences challenge our assumptions about standard Forth; could it become both simpler and better? John Tasgal has researched both Machine Forth and Color Forth and expounds these differences. Alongside the Color Forth article (in the next issue) is a commentary on some of Chuck's published code, showing how complex code can be written with a simpler Forth. Machine Forth (MF) is a development, principally by Charles Moore and Jeff Fox, of classical Forth. Its aim is to simplify both the design of stack chips and the Forth-style languages they use. It is a low-level Forth closely mapped to the underlying hardware. There are two quite separate parts to this language: The first part is a core which is the instruction set of a MISC (Minimal Instruction Set Computing) chip. The second part is an extension to the instruction set to allow word and dictionary building etc. . As far as I know there is no standard and so I have chosen to use the Ultra Technology F21 chip as the 'reference' for the MF instruction set. This article describes the 'programming model' of a MISC chip. I only describe hardware where relevant. Notation T(n) T( n1 .. n0 ) The n'th bit of register T A bitfield in register T from bit n1 down to bit n0 Phrases To present the structural templates below in compact form these abbreviations are used for phrases, that is, a sequence of tokens : flag? carry?