3$ UCC 4th/86 PHILOSOPHY page 1 E-IntroductionF- UCC 4th/86 was originally written for 8-bit hardware in 1982. An extended version known as 7th was also marketed with multi-tasking, full source code, and several other extensions. Both were originally written for in-house use, and were only marketed for a short time, and with limited advertising. For this reason they sold very few copies, and despite their excellence, appear to be comparatively un-known even amongst Forth enthusiasts. There are already several highly professional and extremely comprehensive (confusingly so) FORTH packages for the PC now -- as well as several excellent Public Domain versions -- so what justification is there for resurrecting and faithfully maintaining the flavour of this old version? I believe that UCC 4th showed an originality of implementation, and clarity of conception that is totally absent in virtually all other versions. Having bought, and struggled unsuccessfully for many months with other packages in 1983, opening UCC 4th was like a breath of fresh air in a world hidebound by tradition, conservatism, and a seemingly perverse pleasure in obscurity for its own sake. This translation started initially from a desire to continue using UCC 4th in the H.K.Polytechnic Electrical Engineering department as we changed from 8-bit S-100 and Ampro machines to MSDOS PC based systems. By request of UCC the source code for the Compiler; Interpreter; and multi-tasker are not included (no multitasking is in fact implemented in this version). Memory images KERNEL.IMG are provided however which contain the Compiler and interpreter, and from these a complete new system can be built up -- as well as turnkey systems with the compiler/interpreter omitted. Much of the appeal of the original UCC 4th was in its truly excellent documentation. Some is extracted in these notes, but UCC have kindly agreed to make the original available, and should be contacted directly. United Controls Corporation have kindly given permission for this translation to be released to the Public Domain. They are in no way responsible for any bugs or deficiencies which may exist in this PCDOS implementation. Equally, the design and user interface of this is heavily based on the original 8-bit UCC 4th source code, which has been included with minimum modifications. (It will load in this PC version as-is). The ergonomics of the original UCC 4th user interface has been consciously maintained, because this is what gives UCC 4th/86 its unique characteristics. UCC 4th/86 PHILOSOPHY page 2 E-UCC 4th/86 vs. "the others"F- Much of the misunderstanding and general "bad press" which FORTH as a language suffers from is due more to the conservatism and inflexibility of the dedicated Forth community than to any deficiencies or limitations in the language itself. Indeed, one of the most rigid and unforgiving of languages, Pascal, has been warmly embraced - even by schoolchildren - because of its integrated Turbo implementation. Whilst texts such as Kelly/Spies FORTH: a Text and Reference are an enormous step forward in making Forth intelligible, (you are strongly advised to get a copy if you do not already have one), unfortunately the current commercial implementations of the language are as indigestible as ever to the newcomer. Two inch thick manuals with several Appendices now seem standard, describing every nut and bolt of the machine in loving detail, and not always with any continuing thread of logic. The inherent simplicity and conceptual beauty of Forth is totally obscured by its attempt to include everything from string handling and pattern matching through extended memory control, windowing, and the kitchen sink. The veterans of course know which strings to pull, and which faucet to turn to get the thing moving. The long established tradition of steering with the left foot while his left hand pours petrol in the carburettor and his right works the oil pump seems obvious; an environment of total man-over-machine control; and certainly a hallowed tradition which to question would be sacrilege. Well, this version of UCC 4th/86 is functional; comprehensive; and reasonably standard in its choice of words. However, it shuns screen files like the plague that they are. It can shell to your "friendly corner word- processor" rather than having it's own custom-built Forth-based integrated editor. Unlike many Forths where debugging facilities seem to be treated with some disdain, UCC 4th/86 has debugging, tracing, and disassembly consciously integrated as part of the original design. The "disassembly" is a genuine one -- not a display of the original pre-loaded source code sitting in a memory based screen-file. No longer do you have to carry in your head what is going on -- it can be displayed on-screen at any time - - even words which you have defined interactively, and not yet written to file. All output display is sensibly formatted for clarity of comprehension. For example, DDICT (display dictionary) gives a tabular display of all words with CFA and PFA addresses (not that we use such acronyms here) and flag bytes. This is infinitely preferable to the indigestible (and often un-interruptible) spewing over the screen that the conventional WORDS produces. The word MAP writes all words to a file (see EXTRN0 and EXTRN2) Forth words can be disassembled back to source - including words defined wholly or partially in Assembly (with certain limitations as described below due to the hybrid 8080/8086 characteristic) UCC 4th/86 PHILOSOPHY page 3 E-Keep it cleanF- For the beginner, there is always something emotionally unsatisfying in knowing -- as with Wordstar or Symphony -- that even though you can find your way around comfortably, you have only really scratched the surface of a truly mammoth package. Nagging on the edge of your mental desk is a pile of "tomorrow" learning tasks, whilst your sub- conscious (along with the documentation) stumbles around knee-deep in exotic and never-to-be-used "bells and whistles". UCC 4th/86 maintains a minimal system, and extensions are loaded in (and ATTACHED if chosen) as they are needed. UCC2.COM includes floating point, double precision, and transcendental functions. UCC1.COM omits these, but both include debug and dos-shell facilities. UCC0.COM is really only intended as a bare-bones package (it is simply KERNEL0.IMG in COM form) on which to build your own custom package. Most of the source is provided, so changes can be made if any of the words prove offensive to devotees. It is however designed for the learner driver. Not only is it a friendly learning environment in which a newcomer can find his feet -- hopefully the veteran will find some inspiration to say "hey - that's neat - why didn't we do it that way always". Words can be redefined -- and they can also be linked to the original word in a way which allows previous definitions which used that word to access the new one. This is extensively used in one of the RECURSIVE programs (HILSIER - Hilbert and Sierpin curves) provided. Unfortunately - at this stage - CGA and low resolution graphics (although functional) have not been supported consciously by any applications. Attempts to make the EGA demonstrations work also on a CGA display were abandoned as an essentially meaningless objective. Hopefully people who do not have EGA cards will not be discouraged from trying the non-graphics features of UCC 4th/86. UCC 4th/86 PHILOSOPHY page 4 E-Shortcomings and remediesF- Any suggestions for improvements will be welcomed. However PLEASE do not release enhanced versions without checking with me first. I would like to be the clearing house for new features added to UCC 4th/86. If you want to add features for your own personal use, go ahead. But if you want to distribute your enhanced version, contact me first. Please remember that the goal of this implementation of UCC 4th/86. is to encourage the newcomer to FORTH to learn and become a devotee. It is not intended to compete with commercial packages -- and indeed it is intentionally disrespectful of the "standardisation" where such is considered to be confusing to the newcomer. Most of it however is completely standard, and the few differences should cause no problems to those conditioned by convention. So what are the major shortcomings? They arise from the specification that a) UCC 4th/86 should adhere as closely as possible and acknowledge the dependency on the original 8080 based UCC 4th source code. b) The low level sections of source code are 8080 assembly, and producing 8086 run-code from 8080 mnemonics seems preferable to transcribing the source and installing an 8086 assembler c) The above a) and b) in no way preclude the addition of a conventional 8086/186/286/386 assembler. d) The original (low level) dis-assembler in the debug package (producing 8080 mnemonics) is largely based on using one byte op-codes as an index into a look-up table. Of course many 8086 op-codes are not single byte, and if an unfortunate sequence of code happens to get data mixed up with code, then the dissasembly may miss the JMP THREAD which marks the endpoint, and will go on forever. The main source of possible dis-assembly confusion will be code compiled with MASM -- rather than code introduced by CODE .... ; and 8080 mnemonics. Many 8086 instructions (specifically the indexed moves) are not implemented and will show as NOTIMP -- possibly followed by data bytes. e) 8086 routines (such as the EGA code) are compiled with MASM to COM files, and loaded in via the words CLOAD and CTLOAD. The necessary dictionary entries are embedded in the MASM source code, and transferred by CLOAD In-line entry of assembly code is of course possible (as at least one commercial FORTH does) by poking it in byte-by-byte using HEADB! (or as words with HEAD!) In-line entry of 8086 code by 8080 mnemonics is ** NOT ** to be dismissed as devious. It creates an attractive learning medium -- especially when disassembly will list the equivalent 8086 mnemonics. A few selected 8086 mnemonics (mainly double register and indirect register addressing instructions ) have been temporarily added as discrete words to allow speeding up of sections of the source code. UCC 4th/86 PHILOSOPHY page 5 E-Is it SharewareF- No. As a devotee of the "good old 8-bit days" and Ward Christensen in particular, I believe that all Public Domain software should be free, and come with sufficient source code for users to adapt their own copy to their own particular needs. There are no strings attached to this package at all -- other than distributing it, unmodified, and in its original form. If anyone finds it useful, I would be glad to hear from you, with any suggestions for improvement. An extension of the graphics (including CGA) is due soon. Other additions planned include in-line 8086 assembly and dis-assembly, and DOS style file interface. Larry Buchan Electrical Engineering Department Hong Kong Polytechnic Kowloon, Hong Kong. 8th. July 1988. 3$