DEDICATION This product, software and manual, are dedicated to the memory of Max Ray Haddick, Veteran, Scholar, Educator, Journalist, Humanitarian and father of the lead programmer for this project. Max passed away the day this project was finished. Originally this product was slated to be named NMI-FORTH, which you may have seen in the preliminary documentation. The management at New Micros, Inc. was not satisfied with that name. It did not convey the intent to produce a superior software product, a language that was concise and accurate in the use of its words, characterized by skilled execution and prepared with precision in thought, while not losing sight of the final application (i.e.: those who will use it). Such was the nature of the man, Max Ray Haddick. A well spoken and clear thinking person who never lost sight of the quest for accuracy, without overlooking the need for people to understand the information he presented. There is an empty place now in the world where, formerly, he walked. In dedication to his memory, and the best in all men that he looked for and cherished, this product bears a remembrance of his name. His life stood for all the things we hoped to accomplish with this product. Hopefully, it can live up to the standards of its namesake. The product now carries the name Max-FORTH. INTRODUCTION Max-FORTH for the 68HC11 is a ROM based operating system and language. When combined with a 68HC11 (as found in the F68HC11) Max-FORTH creates a complete development environment. Max-FORTH programs can be written, tested and run under its control. Although usual development configurations would include external RAM and mass storage (either on the F68HC11 system or on the host terminal), short programs can actually be developed on a F68HC11 system using Max-FORTH with no extra support (beyond XTAL circuit, pull ups, power and serial I/O connections). Max-FORTH produces compact code that is suitable for ROMing or EEPROMing. Both "Headed" and "Target Compiled" code applications can be created. While the compiled programs may not execute as fast as well-written assembly language programs, they do compare favorably with the results from other compiled languages. They are usually more compact, more quickly written, and more easily tested in Max-FORTH's interactive programming environment. Max-FORTH closely follows the FORTH-83 Standard in order to be compatible with other FORTH's, also, to be easily supported, learned and used. In addition to the FORTH-83 Required Word Set, Max-FORTH also contains all the FORTH-83 Extension Word Sets, all the Controlled Reference Words and some of the Uncontrolled Reference Words. It also has many single chip specific extensions and operating system words not found in the standard. The most common version of Max-FORTH encountered is the F68HC11 single chip computer foundried for New Micro's Inc. by Motorola. Two revisions have been released in single chips so far, V3.3 and V3.5. Max-FORTH, however, is available in several versions: Version 1.x DISCONTINUED Version 2.x is also supplied in external ROM for use on the same type systems. This version will autostart a user program at any 1K boundary, or in the EEPROM. This version is suitable for volume production use under a license agreement. Version 2.3 is essentially identical to Version 3.3 which is supplied in the NMI F68HC11 MCU. Version 3.x is supplied in the internal ROM of the NMI F68HC11 MCU. These chips are manufactured by Motorola for sale by New Micros, Inc. These chips will autostart a user program at any 1K boundary, or in the EEPROM, and are suitable for volume production use under license agreement. The purchase of the chip includes license for use of that copy in that chips. No further paper work is required. Version 4.x, not yet released, will allow the user to target compile up to 5K bytes of program on a 3K byte Max-FORTH kernel, which may be submitted to Motorola for production as an internal single chip ROM code in the MC68HC11A8, or any of the various family variants, under license agreement for the kernel with New Micros, Inc. This manual is suitable for use with Versions 1.x, 2.x and 3.x. SPECIAL (COPYRIGHT) NOTICE I'd like to do something a little different here than the usually dry references to law and penalties, which are easy to ignore. (See the LIMITED USE SOFTWARE LICENSE AGREEMENT at the end of the manual for that stuff.) I'd like to talk to you directly. You see, I've put a great deal of my personal net worth into the development and preparation of this product and I've "done without" in order to pay for it. My intention was to bring you a superior product, one that might save you a great deal of time in developing your own applications and products. If it does and you are pleased with its function, I hope to continue to sell you this product. This may be in the form of computer boards with F68HC11's installed. This may be in the form of F68HC11's with the software product in internal ROM. It may be in the form of Version 2.x external ROM's. If your quantities are very large, and you wish to purchase your 68HC11's directly from Motorola, then it may be in the form of a license agreement for our kernel as Version 4.x If you finish your project a few months earlier than you might have without a high level language, what does that mean to in dollar terms? According to some common industry cost estimates for engineering time, it's about $4,000 to $20,000. Somehow that number overwhelms the small price I'm asking for a "single use license" on a copy of the software. If everyone who might be interested in using this product bought one and only one copy, however, I don't believe I could make back my investment. If you only buy one ROM from me and copy it for production, you won't be cheating some big impersonal corporation, you will be cheating me. I won't like it. If I find out about it, I won't put up with it. I am willing to take the risk of spending the money and producing the product and offering it for use as described above and then letting you decide if it isn't of greater value than the small amount I'm asking for it. I am not willing to put all that money and effort (blood, sweat and tears) into the project to have it used without compensation. If you don't want to live up to the terms under which I make this product available, please don't bother to start. If the terms are not acceptable, return the product immediately. In return for your patronage, I'll give software support. This is the best of the free enterprise system - where men deal with each other by common consent (contract) rather than force. Let us then, as free men, deal with each other honorably. Thank you. Signed Randy M. Dumse, President, New Micros, Inc. GETTING STARTED In order to run the 68HC11 version of Max-FORTH, a working 68HC11 based hardware system is required. With Versions 1.x and 2.x, this system can be a Motorola EVB, a New Micros, Inc. NMIX-0021/22/23 or similar single board level computer system. The Max-FORTH ROM needs to be installed in the $E000 - $FFFF portion of the memory map. The MODA and MODB pins on the 68HC11 need to be strapped high (i.e.: to VDD, usually through pullups) to put the chip in the expanded multiplexed mode. The internal ROM, if any, must be disabled (EEPROM bit 1 of the CONFIG Register = 0), which may need to be accomplished on a Motorola EVM if not so set by the factory. With Version 3.x, this system can be a Motorola EVB or New Micros, Inc. NMIX-0021 or similar single board level computer system. The Max-FORTH is resident in the NMI 68HC11 MCU, which must be installed as the microprocessor of the board. Internally, the ROM occupies the $E000 - $FFFF portion of the memory map. The MODA and MODB pins on the 68HC11 can be: both strapped high (i.e.: to VDD) to put the chip in the expanded multiplexed mode or MODA strapped low and MODB strapped high to put the chip in the single chip mode. The internal ROM, which contains the Max-FORTH code, must NOT be disabled (EEPROM bit 1 of the CONFIG Register = 1), which may need to be accomplished on a Motorola EVM if accidentally changed from factory setting. When the Max-FORTH ROM is properly installed in the memory map of the 68HC11, a reset will cause the FORTH system to take control. If there is no user program in external memory or the internal EEPROM, the outer interpreter of Max-FORTH will be entered. The startup message "Max-FORTH Vx.x" will be sent out to the system serial communications interface at 9600 baud (that assumes an 8 MHz XTAL, 2 MHz internal operation) with 1 start, 8 data, and 1 stop bit. The system is now ready for input on the serial communications interface. At this point, entering WORDS followed by a carriage return will display all the words in the language in tabular form. (It is psychologically very reassuring, for some reason, to type in a few letters and watch the computer respond with pages of information. The long listing of words can be interrupted by pressing the any key... ) At this point, the entire language is running out of the internal 256 bytes of 68HC11 RAM. Because of this limited amount of RAM available, the amount of room for the Terminal Input Buffer and the dictionary is small. The Terminal Input Buffer is set to 16 characters. The dictionary has room for only a few short definitions. The Data Stack is limited to 39 entries and the Return Stack to 28 words. Any or all of these RAM based areas may be moved to external locations to allow expansion. After they have been arranged to satisfaction, programming can begin. USING THIS MANUAL Read what ever you want to. You don't have to read it in order either. A PRIMER FOR BEGINNERS WHAT IS A COMPUTER LANGUAGE ? What a Computer Does Few people would argue that the powers and uses of the computer are anything less than amazing. Computers, both great and small effect our lives every day. Most of our bills are prepared by large automated systems, as are paychecks, tax forms and mailings. Small computers perform every function from controlling traffic lights to timing how long our dinner cooks in the microwave oven. Everywhere we see computers being used, some taking over tasks from less efficient methods and others tackling new tasks never before possible. Why are computers being used so commonly? The answer is very simple, actually. It is because of what they do as compared to what they cost. But what do they do? Few people actually understand what computers really do. They see the end result of the computers' work but have no concept of how it is accomplished. The job of a programmer is not only to know what the computer does but also how to make the computer do all it can. Although the results look very complicated, a computer only does one small thing at a time. Each task or instruction it does is relatively simple. The power of a computer comes from the speed at which it can complete these small tasks. Just imagine how effective you would be if you could accomplish around a million things a second. This, then, is the key. A computer accomplishes great tasks by doing very small and simple tasks very quickly. By combining a list of these simple tasks together, a programmer defines what he wants the computer to do. This list is called a program. When correctly prepared and entered into the computer, the program will be executed one instruction at a time. Never is there any more than one machine code instruction being executed at one time. A computer has fixed number of instructions that it understands. This group of instruction is called the "instruction set". Programs written using the instruction set directly are called machine code programs. Each instruction in the instruction set performs one carefully defined task. Generally, it takes hundreds of these instructions to be arranged in a program to do a function most people would consider useful. Even simple calculators which are made from programmed microcomputers need thousands of instructions in their programs to read the keyboard, perform calculations and display or print the results. When we use a calculator we can see the end result but cannot see that the computer inside is actually doing only one small thing at a time. For instance, the program probably spends most of its time waiting for a key to be pressed and keeping the right number displayed. The routines that do these tasks use many more instructions than you might expect. Each key for example must be looked at individually to see if it is pressed or not. Ten or twenty machine code instructions may have to be executed to read just one key. Most calculators have 14 or more keys that several hundred instructions must be done to look at the key pad once, yet the computer does it so quickly that you may think that it is reading all the keys at once at all times. Besides checking up on the key pad, microcomputers in calculators are also turning on the digits of the display one at a time. The scanning is so fast that you are not able to tell. It looks like all the digits are on all the time, but in most LED calculators only one digit is active at a time. Still the computer is doing one instruction at a time and it may take up to a hundred of these instructions just to show one digit, then a hundred more to show the next. Computers truly are amazing, but not for the reason most people think. It is not that the computer can do complex things but rather that the computer can do so many simple things so quickly. Beyond that it is up to the programmer to arrange instructions in sequences which do the job that others think complex. Zeros and Ones Inside the computer, the program is stored in binary format. Because of the nature of the components computers are built with, only on and off state can be stored. Each binary digit (shortened and called "bit") can either be in an 'on' or an 'off' state. It can only be in one state at any given instant of time. Because it is easier to think of those little bits of data as numbers instead of on's and off's, we generally speak of them as being in a " 0 " or " 1 " for off and on state, respectively. Computer memory generally does not uniquely keep track of every single bit of information, it has but instead groups of bits together. The bits are organized into fixed groups by size. These group of bits are called "memory locations". They are also sometimes called "memory cells" and even "words of memory". By grouping bits together, larger numbers than just 0's and 1's can be stored at a memory location. The more bits gathered per cell, the greater the range of number the computer can store in that location. Each computer will have its own "word" size but some of the more popular sizes are 4, 8, 16 and 32 bits per location. In the memory of the computer all the information the computer works with is stored. Both the numbers or data the computer worked on and the program that tells the computer what to do are stored there. There are usually thousands of locations in memory. Often the program is stored in one area of memory and the data that the program works on in another. To the untrained eye the patterns of zeros and ones that make up a computer program seem random - having no meaning. But to the computer each group of bits represents one unique instruction to be accomplished in a sequence. The following list of zeros and ones is a program that was written for the 68HC11 microprocessor. This program adds two numbers together and stores the result in a third area. 11111100000100100011010011110011000100100011011011111101000100100 0111000 Even trained programmers have trouble recognizing programs when they are written like that. It is difficult to distinguish where one group of bits ends and another starts. Since the size of memory locations used by the 68HC11 processor are 8 bits wide, we can arrange the format in which our program is written, dividing the zeros and ones into 8-bit groups, one per line. 11111100 00010010 00110100 11110011 00010010 00110110 11111101 00010010 00111000 This still does not give much of a clue to what the computer sees in this pattern. For us, even when the pattern repeats, it is difficult to recognize because of the sheer numbers of zeros and ones shown. If these numbers are considered to be one 8-bit binary number, we can translate them into another number base more easily handled by humans. Base 16, called hexadecimal is very popular for representing binary numbers in a more readable format. This is because all the information contained in eight binary digit can be completely and exactly expressed with only two hexadecimal digits. FC 12 34 F3 12 36 FD 12 38 When our addition program is rewritten using hexadecimal numbers (called hex, for short) instead of binary, the format is easily more recognizable. Still the numbers do not make any obvious sense. Since more than one location is sometimes used to make up one machine code instruction, we could group the locations that represent a single instruction together on one line and again look at the program. FC 12 34 F3 12 36 FD 12 38 Not until each line is explained by function can any sense be made from this program. When computers were first made there were no tools to help programmers write programs. Everything entered into the computer had to be in this type of format of zeros and ones. Programming in this fashion was very difficult and it was very easy to make errors. For these reasons programming languages were invented. Assembly Language From the experience of programming with machine code, it was obvious that better tool is needed for programming. The first programming tools were "hex loaders" that allowed the machine programmers to enter programs by typing in hexadecimal digits rather than setting individual switches for every bit. While this was an improvement, it was far from an end-all solution. The step that followed lead to the creation of programming languages. A complete programming language translates program instructions written according to certain rules, called syntax, into machine code instructions. The first programming languages made were called assemblers. The code written for assemblers is called assembly language. Assembly language allows a programmer to write machine coded instruction as group of letters rather than numbers. Each machine code instruction is assigned a special name called a mnemonic. These names are chosen carefully to have a close connection to the function performed by the instruction. They are much easier to remember than the zeros and ones they represent. Look at the same program written before in machine code and compare it to the listing below written in assembly language. The structure of the program is much more obvious now. Even without being able to write an assembly language program you can understand the purpose of some of the instructions now. LDD $1234 ADD $1236 STD $1238 Assembler were a great help to the programmers. Letting the assembler translate the program from mnemonics to machine code greatly reduced of the commonly made programmer errors. It was quicker to write an assembly language program and run the assembler to translate it to machine code, than it was to write in machine code directly. The assembler can also do certain mathematical operations for the programmer. Many assemblers have provisions to allow numbers to be entered in different number bases. The programmer is not limited to only hexadecimal. If a programmer wanted to add two decimal number, rather than figuring what the binary or hex numbers are, the programmer simply uses a sign to specify the base. The assembler does the conversion. Further, assemblers allow a written name to stand in the place of an actual number. The numbers can be assigned to names once in the beginning of a program, and there after be refered to by name in much the same way the mnemonics are used to stand in for the actual machine opcodes. Look again at the addition program again with symbolic names used in the instructions. LDD COUNT1 ADD COUNT2 STD TOTALS Programmers often find that many of the programs they write have similar needs. For instance, nearly every program may need to display a cue or message to the operator. Rather than recreate that code everytime programmers began to catalogue small portions of code. These are generally referred to as "routines". Sometimes the routines were grouped together in libraries where they could be called out when needed. It was very convenient to think of a function as routine rather than so many distinct lines of code. Although assembly language was a great improvement over machine coding procedures, few people were adept at using it. The problem is two fold. First, machine coded instructions are directly replaced by assembly language instruction, one for one. In order to understand how to write a program in assembly language the programmer must know all the details of the machine, how many registers it has, what each instruction is and does, and how it will affect the status of the machine for future instructions. This not only requires the programmer to think of many things when programming but in particular to think of the programming in terms of the machine, not the programming problem. The common use of libraries demonstrate that people tend to think of problems in a larger realm than individual instructions allow. Even when breaking a problem into its smallest conceivable parts, the parts do not resemble machine code instructions. Taking the individual parts all the way to their assembly language equivalents produces a program that bears no obvious relationship to the original problem. In brief, assembly language use requires a train of thought quite removed from that used in ordinary problem solving. The second reason assembly language did not see more common use is a lack of commonality. Every manufacturer has its own line of machines and therefore a unique instruction set. Even within a manufacturer's line there was no guarantee of consistency from model to model as new designs were added. Since each machine code instruction has one corresponding mnemonic, every time the machine changed so did the assembly language. Knowing how to program on one type of computer was no guarantee of being able on another. This is a double edge problem. It meant that not only were programmers "locked" into the machines that they know assembly language for, but that their programs were also. If two computer owners wanted to share the work done for their systems, the computers themselves had to be identical (in instruction set) if the programming is to be done in assembly language. This problem is called one of "tranportability". Higher Level Languages Soon after the concept of writing programs in representative symbols was proven, work on high level languages began. For the largest part the name "high level" came from these new languages machine independence. This means a high level language program written for one computer could theoretically run just as well on another equipped with the language. A programmers efforts, therefore, were not restricted to one machine. The origin of the name also has some basis in the level of thought required to solve a programming problem. Most high level languages try to have some orientation that allows a problem to be solved in a method consistent with the natuer of the problem. The object is to free the programmer from thinking in terms of the machine. High level language became very popular quickly. They greatly improved productivity. A programmer could use a language he was already familiar with even if the program was to be used on several different machines and he could think of the problem in a "high level". Less time was needed to write programs in high level languages as opposed to assembly language. The usefulness of a high level language depended on many things. Largely it can be summarized in the number of applicable routines or functions built into the language. Any time a translation is involved there will be inefficiencies. While high level language certainly let programmers write programs faster, they did not necessarily write fast programs. Actually quite the opposite. Since the routines predefined in high level languages were to be as general purpose as possible, they had to accomodate many things not needed in every situation. The result was an excess of machine code generated in practically every instance that ran slower than a similar program written in assembler. When high level languages were becoming available another interesting phenomenon was also shaping the future of the computer industry. Hardware costs were very high so "through-put" of the computer was very important. The more tasks that could be run per hour, the less each one costs. Programs that organized the computer's work load, scheduling programs to be run and keeping track of the system states were created. These programs were called "supervisors" or sometimes "operating systems". When a user's program failed, much valuable computer time could be lost trying to recover the system. Because this time was so expensive, there was considerable impetus to put limits on the user. High level languages were designed to limit the user from the machine. The concept was to protect many users from the carelessness of one. Since many users felt that they were entitled to more control than the languages and Operating Systems allowed, many clever schemes were developed to beat the system. ("I'm going to make it run my program next, no matter what!"). This only escalated the problem further as more security was added in the system and the user was afforded less and less control over his programs and the environment under which it ran (a classic case of creeping socialism). The situation has radically changed since the mold for most high level languages was made. Hardware costs are now so low, if a programmer wastes even hour's time on a program, he may have wasted more money than it would cost to purchase and operate the computer he is programming for a lifetime. Under such circumstances, having the operating system and language restrict the programmer from system access has to be carefully re-thought. If the computer is to be dedicated to a real time task, it is not practical to isolate the programmer from the hardware. There are certainly no other users to protect and a system crash is usually cured by the pressing of the reset button. The validity of premises that conventional languages were designed under are totally reversed. Consequently, it is resonable to assume that programming in a language which has a different base set of premises, more applicable to the situation of the present day will surely be more efficient. This is exactly the case with FORTH. A BEGINNING FORTH TUTORIAL What Makes FORTH Different ? Most high level languages are very similar in nature. Since there were some applications where one programming language was inefficient, another language was written based on a new set of routines. Until FORTH, there was very little "new under the sun". There are two basic types of high level languages: compilers and interpreters. Although most languages are usually available as only one or the other type, there is no other reason a version of any language could be written as either. A compiler is a program that translates source code from a predefined file into its machine equivalent. Actually the output of a compiler may be machine code or assembly language to be further assembled to machine code. If a program had errors or did not work as desired, the programmer must re-edit the source file and again run the compilation process. An interpreter is usually more interactive, meaning it responds to the user. There are usually two distinct modes associated with an interpreter - the entry mode and run mode. In the entry mode, the programmer edits and prepares the program for execution. When the run mode is entered, each line is translated into machine code routines and is executed as encountered. There is usually no intermediate step of compilation to machine code. Each line is translated and executed as a single action. The advantage of an interpreter is that it is very user friendly, which makes it easy to use. The disadvantage is that it runs very slowly when compared to a compiled program. Despite the fact of whether a language is an interpreter or compiler, most languages work in quite the same way. Their structure is nearly identical in philosophy to that of straight line assembly code. The language allows for a fixed set of functions in the language just as the machine has a fixed number of instruction in its instruction set. To solve this problem, the programmer must list a sequence of these functions to be performed. The solution is defined in terms of the functions available. FORTH is a truly unique language. Programming in FORTH is quite conceptually different from using other languages. Making a long list of functions to be performed is not the usual programming method. Instead, new functions are defined based on other previously defined functions. In turn, higher level functions can be defined using the new definitions just added. The language itself is expanded and modified. In this way, the programming language FORTH might be more accurately called a programmable programing language. It is difficult to classify FORTH based on previous guidelines. Neither "interpreter" nor "compiler" can accurately describe the nature of FORTH. While FORTH has elements of being an interpreter, it can also be argued that it's a compiler. It is often described as an interactive compiler or compiling interpreter, the later probably being most accurate. FORTH has an interactive interpreter which acts like a conventional interpreter in entry mode. New definitions (called "words") can be entered in the same manner as code would be entered into an interpreter. These words can be directly entered at the system terminal and run as commands or be used in new definitions. It is difficult, therefore, to distinguish between the entry mode and the run mode. FORTH's unique structure allows for some of the best of both worlds. FORTH runs fast during execution. It is therefore comparable to compiled languages. On the other hand, FORTH is very user friendly and resembles an interpretive language. Because of FORTH's unique structure of programmability it is easier and, thereby, quicker to program and test applications in, than either type of previous category of languages. This new concept in programming gives FORTH an unusually wide range of applications as compared with conventional languages. The FORTH instruction set is open ended. The intent is to give the programmer not just a set of function to use but also the tools to create new functions, in fact any functions desired, instead. FORTH was developed by an individual (Charles Moore) in the early 70's. He found himself in the position of having a whole computer to his use to do a real time task. He found that conventional languages restricted his access to the machine to the point that they were unusable. Using a different set of base premises, he created a new language over the course of several years that was tailored to the new system requirement. How Does One Uses FORTH ? Like other user friendly interpreters FORTH is easy to get started with. You sit down at the terminal of a FORTH computer and use it as a calculator or type in a string of commands. When FORTH is done interpreting what was on the line you typed in, it says "OK" and waits for another line. FORTH is a very format free language with a minimum of restriction. Classification of what things can be typed in the input stream is fairly simple. Inputs can only be two things. The first are commands called "words" that have predefined meanings (a few words require inputs following them, which are strings). The other possible items entered are numbers. So with this limitation of using only words and numbers, all of FORTH can be used. The most pressing requirement in successfully typing in commands to be interpreted by FORTH is the correct use of delimiters. Most other languages have so few commands that the allowed commands can easily be picked out of the input stream, even in a long and run-together line of typed characters. They also often use special rules and conventions for naming words (ie: variables). The requirement that names begin with an alpha character and contain only alpha-numerics is almost a universal requirement for other high level languages. Some languages require even more difficult conventions, such as variables be in capital letters and constants in lower case, or special characters, like "$" to indicate a string variable, etc.. FORTH requires each word or number entered to be separated from others around it by delimiting characters. At least one delimiting character must intervene between each unique entry and the next, but use of more than one is not prohibited. FORTH recognizes blanks as delimiting characters. (thisisratheraconvenientconventiontakenfromenglish.onemustwonderw hyotherlanguagesletallinputtoberuntogether.) By virtue of this unique, but very simple requirement, FORTH words can use any characters as part of their names. Only blanks, backspaces and null characters can not to be used in a words name. Extremely useful names can be given to words on this basis. The name of the subtraction function can be therefore be written as - and the operation that prints a title as ." and the operation that indicates the compiler should continue on the next screen of text as --> . Since FORTH allows you to define new words to those already in the language as you program, the same opportunities are yours. Very meaningful names can be assigned to newly defined functions. FORTH allows up to 31 characters to be used in naming words. Names such as CALCULATE-NET-PROFIT*%OF-RETURN are not only possible, but add a great deal of meaning to the program to casual readers. Without forcing such liberal use of the keyboard, FORTH would equally as well deal with words named A, B or C. These simple rules suffice for all the syntax required by a FORTH system. Anything typed into FORTH to interpret must either be a word (a word may be followed by a string as required by its definition) or a number. Anything else will cause an error. Each item must be separated from another by at least one space. Names of words can be any character except a space, a backspace, a null character, and of course, a carriage return which is used to terminate (enter) a line typed into FORTH. How Much is There to FORTH ? As with any language, the most difficult part of using it is learning it. Unlike other computer languages such as BASIC, which has a few functions (or operators) and lots of syntax rules, there are many functions built into FORTH, and just a little syntax (which you just learned). These functions are the building blocks which you must use to solve your programming problem. With BASIC it is fairly easy to look at a list of valid commands, picking a few to start with, learn what are valid names for variables, acquire a very basic understanding of syntax and how line numbers work, and then begin programming. The effective range of program solutions based on such a brief exposure is, to say the least, quite limited. The key how to do more in BASIC is by not only recognizing the command words and understanding their purpose, but also in understanding some very complex relational effects and detailed syntactical rules. Learning the commands and their purpose is not extremely difficult because of their small numbers (usually 15 to 40 depending on the level of implementation or version). Learning a new syntactical set of rules for each command is difficult. For instance, the operator + (plus) in BASIC may be used to calculate the sum of two variables or terms in an equation giving a numerical result. This same operator may also be used to append one string of characters to another. Whether this operator has other uses and effects, using it to add a variable to a string can be quite another problem. The answer to these questions varies from BASIC to BASIC depending on the attittudes of the programmer who implemented it. The more "powerful" the BASIC, the more "complex" the syntax. With the exception of the brief rules mentioned in the earlier section, FORTH is nearly syntax free. Inputs are words (and their strings) and numbers. There is no particular requirement that a word be on one line, or the next. Words are executed in their order of entry. Little else in the way of format is required. So if syntax is not a great problem, what is necessary to learn FORTH? Although each word has a fairly distinct unique action, there are many words to learn, over 200 in most FORTH implementation. It is difficult to directly relate word count to language "power" but it is probably correct to say: the more "fully developed" the FORTH, the greater the number of words. Then the opposite of BASIC is true of FORTH, after a few basic principles are learned about the language you must learn more words rather than more syntax. This way, the learning of FORTH is much more akin to a language like French, a few basic words from the language must be known and a few rules learned about using them. This is enough to get by. More words must be understood to become fluent in the language. FORTH words can be likened to verbs. They represent the actions, the functions to be performed. Numbers and strings are similar to nouns. They usually indicate where the action of the words will be directed. There are, of course, words that you may never need to learn. The same is true of French. There are details of any language in which only scholars find interest. There are primitive words in FORTH which only those most curious about FORTH's structure bother to learn. Some areas of programming may be of no particular applicability in another discipline. Output formatting may be of no use to a programmer doing real time process control. There would be no more use in a detailed study of formatting for him than would the French word for "polar bear" to someone who never speaks of animals. One of the largest differences between FORTH and conventional languages is the handling of temporary data storage. Almost all contemporary languages use variables. FORTH uses a data stack. Using the stack is simple and a major part of FORTH fundamentals. Unfortunately, many new students of FORTH, who have programmed in other high level languages before, decide that the stack hinders their efforts to ever successfully use FORTH. Beginning programmers often adapt to stack based operations more quickly than experienced programmers because they have not learned prejudices based on variable based languages. A brief look of the beginnings of the two philosophies may be of benefit. Many of the basic computing concepts came from the days of calculators. Most calculations are performed one step at a time. With standard four function calculators there are only two numbers, the last result and the number now being entered. (More advanced calculators have a memory for temporary storage of results.) In this way, one result can be held while another is entered. Then the two can be operated on together. This is the point at which the two philosophies split. If more than one memory and one entry are to be maintained, there are two ways to handle it. Either each memory locations can be given names (i.e., 1, 2, 3, ... or A, B, C etc.) or the entire memory can be treated as a single sequential file. With the latter method, if two memory locations are in use and another is needed, the third location is automatically selected. If contents from two memory locations are to be taken, the contents of the third and then the second locations are retrieved. The second location is now available for use again. Both methods are widely used by calculator manufacturers today. The first method (widely used by Texas Instrument) is closest in format to the teaching of modern algebra. Unknown or temporary values are given names. By using mid-fix notation, calculations bear a strong resemblance to algebraic statements, i.e., to solve A = B + C the following entries would by made : B + C = . This result is displayed on the calculator (instead of being assigned to A). Assignments to B and C would already have been assigned values. The more complex equation A = (B + C) * (D + E) requires parenthesis to indicate the correct precedence of operation. The second method (extensively used by Hewlett-Packard) is more difficult to give examples for, since quantities go without names, but are ordered by time and level of entry. Although midfix operators and even prefix notation (called Reverse Polish Notation) are possible with this method, the most commonly used is post fix notation (sometimes called Reverse Polish Notation or RPN). To illustrate the first example given for the algebraic method, you will have to imagine that the results B and C are already in the first and second sequence memory locations. To add them only the entry of + is required, since + always adds the last two numbers entered, or "on the top of the stack". To illustrate the more complex example a method of entering numbers into memory locations is necessary. For the purpose of this example merely stating the number will enter it into the next available memory location. Instead of using actual numbers, we will use substitute names. Remember these names are substitutes for the numbers, not the memory location that the numbers go in. Entering B C + carriage return (ret for short) would put the number " B " in the first memory location. " C " would follow in the next. The + would add the top two numbers on the stack, " B " and " C " , and place the result in the now unused first location. Further entry of D E + ret would store " D " in the open second location and " E " in the third with the " + " operator completing the addition. The result is stored in the once again vacant second location. Finally, entry of * would multiply the two temporary results together (again these are the top two on the stack) and leave the results in the first location. The total entry was B C + D E + * No parentheses were required because the stack of memory locations itself provided for even the machines temporary results. This is the total complexity of the stack. If the previous example can be understood, FORTH stack operation can be understood. FORTH uses a data stack and RPN almost exclusively for all operations. Variables and constants are provided in FORTH for your use but are for storage of a more permanent nature. Temporary storage using the stack is much more efficient. By using post fixed notation (RPN) there is no ambiguity concerning priority of operations, without the use of cumbersome nested parenthesis. In summary, in learning FORTH you must first understand a little syntax, a little about stack operations and quite a few words. With over 200 words, there must be at least 2000 ways of grouping them into categories. In order to allow you to start learning FORTH quickly, the first group to be presented to you in this book will be the basic words. As they are mastered, later chapters will include more words until all have been presented. Beginning Words Almost all computer courses at one point or another list the major parts of a computer as being input, output, the central processor and memory. In previous discussion, the method of entering words and numbers in the input stream, separated by spaces, was explained. It is fitting, then, that the first word to be decribed is . (pronounced as "dot"). This word is an important FORTH word used to output a numerical value. When the dot word is executed by the interpreter, the last number entered or calculated will be output. Although the computer works only in binary, the number will be printed in the current number base. When your FORTH system is first turned on, the numbering system will be base 10 or decimal. That means that the numbers will be accepted as inputs or printed as outputs like common decimal numbers. Later you will learn how to change the base so input and output can be in other bases. It is possible to use binary, octal, hexadecimal and many other number based systems. Once the . is executed, the number that is printed is no longer in memory. It has been taken off the stack. To try an example of using . try the following. Enter 5 . ret After the return is entered, FORTH begins interpreting the line looking for words and numbers. When the 5 is encountered, FORTH picks it out of the input buffer and puts it in a temporary location. There, it will be compared to all the names in FORTH's entire dictionary of names. When no match can be found for it, FORTH assumes it to be a number and tries to convert the current number base to binary. This is possible with the 5 entered. If the entry was not a valid entry, FORTH would give an error and wait for a new line of input. Once converted to binary, the 5 is placed on the top of the stack, the first available location in the temporary data file. No further action is required for numbers. The interpreter continues to process the line. FORTH next picks up the . and searches the dictionary for a match. A match is found and the interpreter turns execution control over to the instructions that make the . function. As described, this word finds the top value on the stack and converts that binary number into an output. The location on the stack is now free again for further use. The result of the example is as follows: 5 . 5 OK After the . returns control to the interpreter, the result of the carriage return will be processed. Since that indicates the end of the line of entry, FORTH puts up the message OK . The purpose of this message is to inform you that the previous commands have been completed successfully. FORTH is ready for another line of input. Now try a longer line of input. Enter the following: 5 . 6 . 7 . ret the interpreter will process this line by entering the 5 on the stack and then printing it. Then the 6 and printing it and finally the 7, likewise. The result looks like this: 5 . 6 . 7 . 5 6 7 OK Note that no more than one location is used on the stack. Each number is entered on the stack and immediately output before the next is added. Note also that no action is taken by the interpreter until the ret is entered. Changing the order will change the action taken. To illustrate, try the following: 5 6 7 . . . ret The 5, 6 and 7 go on the stack in order. The 7 is on the top. When the first . is executed 7 is output since it is on top. The next . removes and prints the 6 . The last . prints the 5 and the stack is empty. If all three . had not been used, the numbers would have been left on the stack. For instance, 5 6 7 . ret would show 5 6 7 . 7 OK As a result, a later entry of . ret would draw the 6 out of the stack and show . 6 OK The 5 will remain on the stack until used or an error clears the remaining numbers from the stack. Another word which would be useful to learn now is .S . This word not only outputs the value of the top number on the stack but all other numbers on the stack as well. Unlike . , it only copies the value on the stack which is not removed. This command is sometimes likened to a snapshot because a non-destructive print of the content of the stack is made. Entering .S ret will show .S 5 OK The 5 was left on the stack from the last example. Now enter a word that is not in the dictionary. If it is not a number, it will cause an error. QWERTY ret FORTH will respond with QWERTY QWERTY ? meaning that the word entered was neither a valid word nor number. Now use the .S word. The stack was emptied when the error was encountered and the 5 typed earlier is now lost. The .S word is a very useful diagnostic tool. To try one more example with it, enter 5 6 .S ret and check the result: 5 6 .S 6 5 OK The 5 and 6 are still on the stack and can be further manipulated by other words or printed using . words. Now that you have learned how to input and output numbers, it is time to learn something to do with them. One of the nicer features of FORTH is the interactive way that computations can be done. In the last example, a 5 and a 6 were left on the stack. We could cause the sum of those two numbers to be computed by entering the + word. The action taken by + when executed is to pick the top word from the stack and add it to the second number down. Like the . , when + word uses numbers from the stack, they are removed. The result of the addition after computation is put in temporary storage for further use. It is the new top number on the stack. The . word entered now will cause the result to be printed. The response should be like this: + . 11 OK To try another example, enter the following: 2 3 4 .S ret shows 2 3 4 .S 4 3 2 OK This action entered three numbers on the stack and then displayed them. These numbers are still on the stack since the .S does not remove them. It will take two + words to add the three numbers. + + . ret shows + + . 9 OK The execution of the first + adds the top number, 4, to the second number, 3, from the stack. Three numbers were on the stack. When the + returns its resulting value (7) to the stack there are two left. The second + causes the two values left on the stack (2 and 7) to be added and the result (9) returned to the stack. The result is the final remaining value, the only number on the stack. It is, of course, the top number on the stack which the . caused to be printed. The stack is then empty. It is important to remember that FORTH can only recognize words if they are separated from other words and numbers by spaces (delimiters). If there are no spaces, FORTH will try to make a single word out of the entry. For instance, 5 6+ ret as an entry would give an error. FORTH look for a word named 6+ in the dictionary. When it cannot be found, FORTH will try to convert 6+ into a number which will also fail. The order in which numbers are entered on the stack makes no difference in the result of an addition. This is because of commutative property of addition. The operation of 6 2 + . will produce the same answer as 2 6 + . which is 8. The same is not true of all operations. The next word to be learned is logically, -. The word that allows subtraction operations to be performed. The commutative property does not apply to subtraction, therefore, 6 2 - . will give a result different from 2 6 - . . The function performed by - is to subtract the top number on the stack from the second number on the stack. The process removes both numbers from the stack and returns the resulting value as the new top of stack. The result of 6 4 - . ret is 6 4 - . 2 OK written algebraically, the calculation would look like this: 6 - 4 = 2 An easy way to remember the order of operation is to visualize the two numbers to be operated on in relationship to the stack. Although they could have been computed or manipulated by earlier operation, imagine you just entered them by hand. Since we write left to right, imagine the stack contents displayed with the left side being the deepest or earliest entry and the right side the latest. To understand what the operator will do, imagine the two numbers (written as you would enter them) with the operator between the two numbers. As an example, if the 6 is on the second number down (meaning it went on first, then became second) and the 4 is on the top of the stack, you should be able to envision the problem in algebraic format like this: 6 - 4 . This method of visualizing the numbers from the stack and the operator between them will help you to understand how - works as well as all other two number operators, all the math related words and relational operators that compare values. While multiplication is a function which is covered by the commutative law, division is not. The word to cause the the second number on the stack to be multiplied by the top number is * . The word / causes the second word on the stack to be divided by the top number on the stack. Just as with addition, there is no difference between the results of 2 3 * and 3 2 * . In algebraic notation, these two equations look like this 2 x 3 = 6 and 3 x 2 = 6 Again, to translate from RPN notation to algebraic, imagine the operator to be between the second and top value from the stack in that order. In the case of division, the order of the two numbers on the stack determines which number is the divisor and which is the dividend. There is indeed a difference in the result between 24 6 / and 6 24 / . The division word, / , will cause the top number to be divided into the second number on the stack. That is, the top number is the divisor. The two numbers are removed from the stack, the quotient is left on the top of the stack in their place. There will, of course, be occasions when numbers on the stack will be in the wrong order. For instance: in a lengthy calculation, an intermediate value may already be on the stack. To find the final value that result must be divided into 100 . Entering 100 / . will not give the correct answer. The value would be divided by 100 rather than into 100. A correct result can be obtained by printing the intermediate value and entering 100 and then reentering the printed value and doing the division. This, however, is not a very reasonable approach. Fortunately, there is a handy word available in FORTH to manage such problems. The word is SWAP . The execution of SWAP causes the top value n on the stack to be "swapped" with the second value on the stack. The old top value becomes the second value and vice versa. In the example, the solution to divide the intermediate value into 100 looks like this 100 SWAP / . ret Words such as SWAP are called stack management words because their entire functions deal with "grooming" the stack. Another important word in stack management is DUP . This word is used to duplicate the top of stack and places that value on the new top of the stack. The original value is the second number on the stack and its copy is the new top value. The two numbers are exactly identical. This is very useful when it is necessary to use a copy of a number to be printed, displayed or used in further calculation. The copy will be used for the operation rather than the original value which remains ready for further use on the stack. There are occasions when excess values are left on the stack by operations. These unwanted leftovers can be removed from the stack by the word DROP . To see how these stack management words work, try the following. Enter 2 3 4 .S ret which will display 2 3 4 .S 4 3 2 OK these numbers are still on the stack, now enter SWAP .S ret which displays SWAP .S 3 4 2 OK Note that the position of the top number and second number have changed. Now type DUP .S ret which displays DUP .S 3 3 4 2 OK The top value was duplicated and the copy added to the stack. Finally, try DROP SWAP .S ret which shows DROP SWAP .S 4 3 2 OK The copied 3 was dropped from the stack leaving a 3 on top and a 4 then a 2 below it. The SWAP reversed the order of the 4 and 3 and coincidentally restored the numbers on the stack to their original order. A few more words should be introduced before leaving this chapter. You may sometimes want to put different numbers on separate lines. The word that will finish an existing line on the CRT or printer and starts a new one CR . This is short for "carriage return" and has the same meaning as if you hit the carriage return button on an electric typewritter. The printing head is returned to the left margin and the platten advanced to the next empty line of paper. If you are working on a CRT, the cursor will advance down the screen or cause a scroll to make room for a new line. Try the following entry 1 . CR 2 . CR CR Ret The FORTH interpreter will place the 1 on the stack and print it and encounter a CR . A new line will be used to print the following 2 which first goes on the stack and then is input by . . If there were no further entries on that line, the 2 would be immediately followed by FORTH's comment "OK". There are however two CR's to be processed. Two additional lines follow the 2 before the familiar "OK" is seen. The ability to title an output may be very handy. There are also times when you may just want to output a message to indicate how the program is doing or to prompt an operator for an input. The word .( is provided for this purpose. To use .( in a program you must have at least one space in front of . and one space following the " just like the other words. This word is a special case, however, because it accepts a string following it (trailing by one space!) and outputs every character in the string until it finds a ) . The ) is not a word, therefore it does not have to be proceeded by a space. It is a special character, that .( looks for, to indicate that it is time to quit and turn control over to the interpreter again. The interpreter will begin looking for more words starting in the space after the ending ) . To illustrate try .( HELLO) ret which shows .( HELLO) HELLOOK Starting the output on another line will improve the readability, so try the following: CR .( HELLO) CR ret which produces CR .( HELLO) CR HELLO OK More than one .( may be used to construct a line CR .( HELLO) .( THERE ) ret which produces CR .( HELLO) .( THERE ) HELLOTHERE OK Notice that there is no spare between the HELLO and THERE . This is because the first .( stopped outputting when the ) was found. The second .( started outputting again with the character following the next space after it. That space was necessary so that the interpreter could separate .( from the rest of the text and look for it in the dictionary. If you forgot the space in this case, the interpreter would try to find .(THERE in the dictionary. That of course would be unsuccessful and cause an error to output. There was a space after the end of the word THERE before the ending ) . This is what separated the THERE and the OK in the printout. If you want a space between HELLO and THERE , an extra space can be left after HELLO or before THERE , like CR .( HELLO ) .( THERE ) ret or CR .( HELLO) .( THERE ) ret If you want to separate two outputs by blanks, there is an easier way than typing. .( followed by a number of spaces and then an ending .( . The word SPACE outputs one blank space. Another similar word SPACES takes the top number from the stack and outputs that many blank spaces. To see this, enter .( HELLO) SPACE .( THERE ) ret which outputs .( HELLO) SPACE .( THERE ) HELLO THERE OK and then CR .( HELLO) 10 SPACES .( THERE ) ret and see .( HELLO) 10 SPACES .( THERE ) ret HELLO THERE OK With the words you have learned now, you can use FORTH to perform and function as a standard four function calculator can. You can also put titles and spaces in your result. Every time you wish to compute a result, though, the entire process must be typed again. You are only using the words provided in FORTH in sequence. It is time you learned how to define your own words instead. Definitions To program in FORTH is to create new words. To learn the power of FORTH you must learn how to define your own words designed to perform the functions you want. So far you have only seen the first level of FORTH, using words already defined in the dictionary. The outer FORTH interpreter turned control over to a word only when found in the dictionary. After the word is complete it returns control back to the interpreter which then looked for the next word. The second level of understanding in mastering FORTH is being able to use a special group of words, called "defining words". Defining words allow you to enter new words of your choosing into the language. When you first initialize the language FORTH, there are a fixed number of words defined in the dictionary. Most of those words can be used directly from the keyboard. Included are the defining words. To see all of the words available, enter the word WORDS . This word will cause the names of all the words in the language to be typed on the terminal. The name of this word WORDS is taken from its function which is to list all the names of words in FORTH's vocabulary. The vocabulary list will not only show the words that were originally provided in FORTH but also any words you may have added to the FORTH dictionary by using defining words. Notice the first word in the list. Remember the name. This is where FORTH starts looking for a match between a word you enter and the words of the entire vocabulary. This word is at the top of the dictionary. Any new words written into the language with defining words will go above it in the dictionary. To understand this concept you will now define a word. The actual function for this word will be to turn control back to the controlling interpreter. Since when you enter the word, the outer interpreter finds and executes the word and this word will turn control right back to the outer interpreter the net result of using this word will essentially be of no effect on the outcome of anything (except a brief delay while the computer finds and runs the word). Therefore, an excellent name for this word will be NO-EFFECT . To define this word you must use the defining word : (pronounced "colon") and the word used to terminate the effects of : which is called ; (pronounced "semi-colon"). More will be said about these new words in a bit, but first try this: : NO-EFFECT ; ret FORTH should respond to your entry with a courteous "OK". The word NO-EFFECT is now a part of the FORTH language in the computer. To run this new word, type its name into input stream. FORTH will run the word and respond with "OK". Try using NO-EFFECT with this example 5 NO-EFFECT 4 NO-EFFECT + NO-EFFECT . ret After which FORTH will print 9 OK . The word NO-EFFECT was executed once per entry and had, of course, no effect on the final printed result of 9. Now type WORDS again. Notice the first word listed is NO-EFFECT . As you can see it is now part of this vocabulary just as + , - , and . are. The defining word : entered the name NO-EFFECT into the library for later use. (A brief note on the "NOT UNIQUE" warning message you may recieve when defining new words. FORTH allows redefinition of existing words using the same name. This allows all later references to the new definition with an old name. All previously defined references to the old word will remain unchanged. Sometimes the "NOT UNIQUE" message may be issued when there seems to be no match. For instance, : FLAGS ; , gives a not unique message. This is an anomolly of the shortened names in the internal ROM of Max-FORTH. A potential match has been found between FLAGS and FLUSH , since FLUSH is stord as "a count of 5 with first two letters FL___ . Do not worry about these occurances. The system is not harmed by the warning message. FLUSH can still be found in the dictionary, as can FLAGS .) It is useful to remember that the ultimate interpreter of your FORTH system is the computer itself executing machine code. There is nothing else the CPU can run directly but machine code. Any higher level program to be run must be translated into its machine code equivalents. Naturally, FORTH is written in machine code so that the computer can run it as a program. This is not as accurate a statement as might be supposed, though. It is true that the most primitive words in FORTH are written in machine code. These account for less than a quarter of the memory space used by FORTH language. That is because most of FORTH is written in FORTH. In other words, not every entry in the FORTH dictionary is written in machine code. It may have instead been written in terms of other words already defined. Since the computer can not execute this instructions directly, each word defined in terms of other FORTH words or any structures other than machine code must have an interpreter. This interpreter will be used to "unscramble" the high level words and execute the appropriate machine code routines to accomplish the actions indicated. These interpreters are themselves machine code routines, called `inner interpreters'. Each defining word that enters the new words into the dictionary has its own inner interpreter routines associated with it. The defining word assigns its own inner interpreter to the word it creates in the dictionary. These inner interpreters are what the outer interpreter actually gives control to, in order to execute a word found in the dictionary. When the inner interpreter finishes the functions indicated by the entered word, control is passed back to the calling routine. If a word is entered in machine code the CPU itself can translate the word directly. This type word must end by returning control back to the calling interpreter so the next word in line can be executed (there is a machine code defining word that allows machine code routine to be entered). All the defining words available in FORTH will be discussed in coming sections, however, you first should know that they all have some things in common. Since the purpose of making a new word is to have it available for later use. Every defining word creates a place for its new word in the FORTH dictionary. No matter which defining word actually created it, the new word has a few elements of structure in common with the rest of the language. Their descriptions follow. The Name Field contains the characters that make up the name assigned to the action of the word. It is this field that is used by the outer interpreter to determine if an entry you have made matches any in the dictionary. Closely associated with the Name Field is the Length Field which holds a count of the numbers of letters in the words name. It also usually contains two flags used in the compilation process. The Link Field holds a pointer that points to the previous word in the dictionary. By the use of this field the outer interpreter can move from word to word in the dictionary, taking each in sequential order. Only the location of the latest word added to the vocabulary need be saved. Any other word in the dictionary can be found by searching from there to the next, etc. Definitions, therefore, do not have to be limited to any particular length. The pointer will always allow enough room for the parameters and fields used in definitions. The Parameter Field Pointer is the field that Max-FORTH uses to link the seperated heads sections (consisting of Length, Name, Link and Parameter Field Pointer) and the codes sections (consisting of Code Field and Parameter Field). The Code Field contains the address of the inner interpreter. All inner interpreters are written in machine code. Remember, the computer can execute machine code and nothing else. Each defining word has its own inner interpreter already written in machine code as part of the inner portion of the language (this portion of FORTH is often called the "KERNEL"). The Code Field then will identify the interpreter of the word that entered it into the dictionary as the one to decode and perform the functions it was defined to do. The actual functions which will be performed depends on the parameter(s) assigned to the word during the defining process. The Parameter Field contains the information placed in it by the defining word and required by the inner interpreter assigned to it. In other words, the Parameter Field contains specially encoded entries that the inner interpreter of that defining word will understand. Now that you have been introduced to the common elements of every FORTH language, (with the exception of the Parameter Field Pointer which is unique to Max-FORTH and RSC-FORTH) it is time to look into the defining words one at a time and learn each ones function. Since : has already been introduced and is the most commonly used, it will be taken first. When the word : is executed (i.e., found in the input stream by the outer interpreter), it creates a place for a new word in the dictionary and looks in the input stream for a string following it. This string will be used as the name of the new word. The Code Field is made to point at the inner interpreter of : (note: although this inner interpreter does not have a FORTH name, it is usually refered to by its assembly label, DOCOL or DOCOLON ). Since most of the words defined in the FORTH language itself are themselves products of colon definitions DOCOLON is the most commonly used of all inner interpreters. Besides some elementary error checking, the execution of : does one significant thing. It changes the state of the outer interpreter from its normal function to the compilation state. This is done by setting a flag. When in the compilation state, the outer interpreter checks each word found in the input stream to see if it is an "immediate" word. More will be said on immediate words in a bit, however, suffice it to say that very few words in the language are "immediates". If the word is not immediate, the more common case, instead of executing the word taken from the input stream, the outer interpreter will place the address of that word's Code Field into the next empty spot in the dictionary. Since : already put the head of a word to be defined into the dictionary, this new entry will be a part of the definition being built. The inner interpreter, DOCOLON , will use the parameters so constructed to execute the function of this word later on. Each non-immediate word following the : will have the address of its Code Field inserted into the definition until the outer interpreter is taken out of the compilation state. The way to end a : definition is by using the word ; . This word, pronounced "semicolon", is an immediate word. As implied earlier, immediate words are not compiled into definitions, they are rather executed immediately by the outer interpreter regardless of its current state. The execution of ; causes some error checking to be performed to see if the definition in progress has any detectable loose ends. If none are found a terminator is added to the definition so that DOCOLON will not pass out the parameters of this word during execution and accidentally try to use a following word's fields. Like DOCOLON , this terminator has no assigned FORTH name but is refered to in conversations as SEMIS . Finally, the finishing touches are put on the newly defined colon word and FORTH pointers are updated so this word can be found when the dictionary is searched and the outer interpreter is taken out of the compilation state. In the first example where NO-EFFECT was defined, all the elements of the preceding descriptions were used. When the outer interpreter encountered : it created a spot in the dictionary built around the name NO-EFFECT with a link to the previous name in the dictionary and Code Field contents that pointed to DOCOLON . The parameter field received only one entry, that of SEMIS when ; was found immediately following the name. It is just as easy to define words that do have a significant effect using the : and ; pair. If you were working on a formula and calculating the sum of a variable and constant, it might be useful to define a word that enters the constant and adds it to the value on the stack. For the sake of simplicity, suppose the constant was 3. To define a word to substitute for entering 3 + every time a new calculation was started, a single word could be used instead. You would use the colon definition structure to create it. For example : CALC 3 + ; ret If you have entered this example, CALC is now a new word in your FORTH that can be used instead of 3 + . To try the new word, enter 2 CALC ret and FORTH will respond with 5 OK CALC is fully functional and as much part of the language now as any other word. In fact, once you have created a word such as CALC it can be used in other definitions. In this way, large programming tasks can be broken up into very small segments which can each be programmed and tested until the entire task can become a combination of smaller, already defined words built up in pyramid style. For further illustration, assume that adding 3 to the variable was only part of the required work to arrive at the computed answer. The complete function also requires the sum to be multiplied by a constant, for this example 2 . Based on the word already done, a new word could be defined to perform this more complex function. : FUNCTION CALC 2 * ; ret The word FUNCTION , here defined , when executed causes CALC to operate, adding 3 to the number on the stack. Control returns to FUNCTION when CALC is finished (i.e., DOCOLON finds SEMIS ), a 2 is placed on the stack and that number and the previously calculated mid term are multiplied. To try the new definition, enter 2 FUNCTION ret The response will be 10 which is 2 with 3 added and then multiplied by 2. Try other numbers of your choice to verify to your satisfaction how well FUNCTION works. To try another example the following word will plot an asterisk in the column numbered by the value on the stack. The definiton using the colon structure is as follows: : PLOT CR SPACE ." *" ; ret The CR starts the output on a new line. The number from the stack is used by SPACES to put the spaces between the start of the line and the asterisks displayed by the ." *"structure. As you can see, with only a very few words from the original dictionary combined with numbers and use of the stack, very powerful new words can be made. Any previously defined word can be used in a current definition. The : defining word provides a place in the dictionary, enters the name, and causes the following words to be compiled, adding meaning to the new word under construction. The next defining word to be studied is CONSTANT . Sometimes in programming, a single number maybe used several places in a program in performing calculations because of its significance as a parameter. It is often much easier to assign a name to the number for later use than to repeat the entry of the number at every occurence. This is particularly true in cases where the value of the number may be changed to another value after the program is tested. Rather than requiring several editing changes whenever the number is resident in the body of the program, only one line would need be modified. The assignment of a new value to the name and recompilation of the program would be the only effort required. Such an assignment could be made using a : definition, for instance : MULTIPLIER 300 ; . When MULTIPLIER is executed, it would leave its assigned value of 300 in the stack for use in the following computations. This is not, however, very efficient use of the computers memory space because : causes three times storage to be used in MULTIPLIER 's Parameter Fields as are really required to hold the number 300 of this example. In order to store numbers inside a : definition, the Code Field Address of a word called LIT (short for literal value) is inserted in the parameters indicating that the following location is not a Code Field Address, but instead a number to be entered on the stack. Of course, the parameter field of MULTIPLIER must be terminated with the address of SEMIS because MULTIPLIER is a : definition. This takes up a third place in this words parameter field. A better use of the computer's resources would be to use the defining word CONSTANT to enter such values into the program. Like all defining words CONSTANT creates a place in the dictionary for the word under construction with the name assigned by the programmer. Unlike : , when CONSTANT is used to enter a word, the inner interpreter assigned to the word is a routine refered to as DOCON or DOCONSTANT . This routine performs only one function. It takes the first location in the parameter field (the only location in the parameter field, by the way) and treating it as a number, puts a copy of it on the stack. The number was assigned by the defining word CONSTANT when the word was created. To make a CONSTANT definition, the value to be assigned to the name is first put on the stack. The word CONSTANT is entered followed by the name to be assigned. Execution of a constant creates a name in the dictionary with the address of DOCON in the Code Field Address and the top value from the stack in the parameter field. The new definition is then complete. No equivalent to ; is required with CONSTANT because the state of the Outer Interpreter is not changed and DOCOL looks for only one parameter. The word written earlier with : could be rewritten as follows 300 CONSTANT MULTIPLIER ret In this format, MULTIPLIER is not only more memory efficient, it is also faster. No time is spent executing DOCOL , LIT and SEMIS . All the actions needed to put the value on the stack are programmed in DOCON which is more efficient. Once a word is defined using CONSTANT , there is no direct single word way of changing its value. Unlike other languages, however, it is possible to change a constant's value without recompiling the entire program. If the program is stored in RAM (alterable computer memory) and not ROM (permanent computer storage) and the address of the defined word's parameter field can be found, the contents of that address can be changed. In that way, at some future point when it becomes necessary to redefine the value of a constant, it is possible without major effort. In fact, the values of constants can be dynamically altered under program control if the program is in RAM. Although this is not a recommended procedure, there is no effort made to to FORTH to "protect" the programmer from "himself". In order to learn how to alter a FORTH constant, it will be necessary to learn the use of three other words. These words allow the Parameter Field Address Pointer of an Max-FORTH named word to be found, the contents of a memory location to be brought from memory to stack, and a value from the stack to be stored at a specific address in memory. The first word is ' (pronounced "tick"). This word is always followed by a string. The purpose of ' is to search the dictionary for the name of the word represented by the string that follows ' . Its action is much like that of the outer interpreter when it searches the dictionary. The word ' , however, returns the value of the Parameter Field Address Pointer on the top of the stack when the word is found, rather than to actually execute the word. Assuming the word MULTIPLIER has been added to FORTH as shown above with the defining word CONSTANT , its Parameter Field Address Pointer can be found by ' . Entering ' MULTIPLIER . will cause some number to be printed. The value of the number may or may not hold significance to you, depending on your familiarity with your computer installation. This is, however, the address where the parameter assigned by CONSTANT to MULTIPLIER was stored. All computer memory locations are assigned with numbers called addresses. By using the addresses, any information in the computers memory can be found. Knowing the address of a piece of data is only the first step. The actual data that is kept in that address is entirely a different matter. By knowing the address where data is stored in memory, it is possible to call up that data or fetch it from its address. The word that allows memory to be read is @ (pronounced "fetch"). You will be able to fetch the value from MULTIPLIER's paramemter field using @ . To try this, you must again use ' to find that address. Once the address is on the stack, rather than printing the address, it can be used as the input to @ to first find out where the pointer is pointing, and then, to actually get the value for the memory read. Entering ' MULTIPLIER @ @ . will display 300, the value assigned when the word was created. The word @ always takes the top number from the stack and using it as an address, replaces it with the contents of that address. This is a form of indirection, using a number (i.e., address) to find a number (i.e., contents of an address). Reread the above description if you do not understand the difference between an address and the contents of that address. With addition of one more word you will learn how to actually modify memory to be whatever you want. The word ! (pronounced "store") is used for this purpose. Unlike @ which required only one parameter from the stack, ! requires two. Not only is an address needed to tell where to store a value, but the value itself must precede the address on the stack. To actually modify the way the previously defined word MULTIPLIER works, you need only enter the value you wish to change it to, its Parameter Field Address and issue a store command as follows: 50 ' MULTIPLIER @ ! OK Typing MULTIPLIER . will cause a 50 to be printed rather than the originally defined value 300. With knowledge of @ and ! also comes a grave responsibility. Indiscriminate use of these commands will surely cause a system crash. Much like the knowledge of good and evil, the ability to read and modify memory directly changes the status of the user. Responsibility for their use comes with the knowledge. If you do not thoroughly understand the significance of reading or writing some location, it is exceedingly prudent not to do so. By using @ and ! with ' it is possible to change the value of an already defined constant. Sometimes during programming, it is necessary to have an easily alterable storage without using the stack. A printing program for example may need to count the number of lines sent to the printer, but may not know the nature of "what's on the stack where" when it is called by a higher level program. A variable is needed in such ocassion. The defining word VARIABLE allows for the creation of such storage structures. The structure of VARIABLE is quite similar in nature to that of CONSTANT just described. The word VARIABLE creates a place in the dictionary for the name contained in the string following it. The interpreter pointed to by the new variable's Code Field Address is called DOVAR or DOVARIABLE . This interpreter is similar to DOCOL with a subtle but exteremely important difference. The parameter field of the new VARIABLE defined word contains the value of the variable, just as a CONSTANT defined word. DOVAR , however, does not cause that value to be brought to the stack when the variable is called. Instead the address of that value is brought out by a fetch or modified by a store. A variable created by VARIABLE COUNT could be useful in maintaing the number of lines printed without typing out the stack. In the program where the number of lines printed was desired, COUNT @ would bring the value to the top of stack. The value could be incremented by a 1+ COUNT ! or cleared by putting a zero into the variable with 0 COUNT ! . The entry COUNT . is not particularly useful. This would cause the address of the data of count to be printed. The programmer is usually much more interested in what is stored in a variable, than where it is stored. The word VARIABLE creates storage for the data in the dictioanary itself. This may or may not be particulary desirable. If you are working in an entirely RAM based system, that is all the memory locations that can be read as well as written to. Using VARIABLE is fine. If you are, however, preparing your program for permanent storage in ROM, memory that will be set up once and can never be rewritten (Read Only Memory), using the variable structure may cause serious hardships. In such a situation, there are two possible working solutions. In both, the actual data is placed outside of the dictionary proper. If a free area of RAM is known to exist, the programmer can define a constant that will point at it. For example, if free RAM is available to the user at location 16038, the following step will give this address to the name FREE-VAR : 16384 CONSTANT FREE-VAR ret Now, the name FREE-VAR will be used as the address of the usable data. Using a constant in a ROM coded program is quite suitable as long as it is not to be changed, which is again not recommended practice. FREE-VAR can be used just as the variable defined COUNT can. Entering FREE-VAR @ will bring the data to the stack and FREE-VAR ! will put data away in that storage place. The second method is provided in most ROM based FORTH systems. Since FORTH itself maintains a number of variables in RAM, a special area is reserved to temporary storage called a user area. System variables that contain the number base for input and output functions, the length of characters that can be contained in a name , etc., are kept there for FORTH . The user can also take advantage of some of the unassigned portion of that area by defining "user variables". The defining word USER is designed for this purpose. When a word defined with USER is called, the address of the data is left on the stack for fetch and store operations, just as the one defined with VARIABLE . Beyond this, the similarities of these two defining words end. When a user variable is defined, it is the offset into the user area that is taken from the stack rather than its preliminary value. The interpreter DOUSE is assigned to these words. DOUSE takes the offset to compute the actual address where the data lies. For example, if COUNT were to be designed to make use of the user area, it could be written as 64 USER COUNT , which means COUNT is kept in the sixty fourth location in the user area. Note that it is necessary to pick where in the user area each newly defined user variable is to go. It is important also to avoid conflicts with the system user variables which are usually in the first few locations in the user area. Once defined, user variables can be normally used in exactly the same way as any ordinary variable. The final defining words in FORTH will only be mentioned now. They are and a few others to be covered later. Let us suffice to say for the moment that their remarkable structure not only allow you to define new words, but also define new words that can be used to define new defining words. This proves the amazing nature of FORTH. The third level of understanding in FORTH is that, it is possible to create words which can further create new words. In this way a new data structures and other types of definition can be added as easily as the words that will eventually use them. The process of defining new words, called extensibility, of FORTH is truly remarkable. Structures At this point, you have learned how to define new words in order to program your problem in the FORTH language. Perhaps, if you are familiar with programming in some other language, you recognize the fact that all the examples shown thus far have been "straight line" code. That is, there have been no examples where conditional decisions have been made. Neither has there been any use of repetitive loops. Without these structures, programming is relatively useless. If the computer is not allowed to make decisions and take definitive actions based on those decisions, problems in general are more quickly solved with a hand calculator without the time-consumming process of programming. It is well known that the computer's power comes not from being able to make large monumental decisions at once, but rather that it takes many small iterative steps in arriving at a final solution. In order to access this aspect of programming in the FORTH programming language, you must now learn the use of structures. One of the reasons that structures were not taught earlier in this discourse is that, in FORTH they can only be used in defined words. They cannot be used directly from the keyboard the same way that + and - are. The reason for this lies in the way the Outer Interpreter works. In order for this interpreter to work, only one word can be recognized at a time. It can not parse out two names at once and has no way of remembering other names that have been used before hand. This ability to establish the location of the code for two different routines is necessary to make decisions. Based on the result of a decision one block of code or another will be executed. This is called "branching". Structures can be set up inside of FORTH words at the time of their compilation, however. When the Outer Interpreter is in the compilation mode rather than the execution mode it uses the Return Stack in order to remember where in the definition a branch is to be made later. The simplest form of a structure is perhaps the IF THEN construct. It will be introduced first. Quite often when making a decision, it is useful to look at the problem with all the possible alternatives carefully laid out. The simplest decision is one where, if one thing is true, a specific action will be taken. If it is not true, no special action is needed. An example of those in the English language would be "If it is raining, I will take my umbrella." The basis of the decision rests on the status of the weather. If it is raining, a special action must be performed. If it is not raining, no such action is demanded. Taking the umbrella is the particular action in question at the time. In FORTH, there is a word IF that causes an action to be taken based on the determined truth of a predefined term. This word is always used with the word THEN which is used to indicate the termination of the required action. IF makes its decision of whether to branch or not by taking a type of value from the stack, referred to as Boolean. A Boolean value has only two possible values, true or false. Since the computer deals in 0's and 1's and doesn't understand concepts as abstract as right and wrong or true and false, the input to an IF word must be a number. The way FORTH handles true and false is to assign the Boolean false to the number "0". Of course, if there are only two Boolean values in existence and the number "0" is one of them, it is totally arbitrary what the actual numerical value is assigned to true. In fact this is exactly the way FORTH treats the true Boolean value. If it is not "0" and therefore false, it must be true. To illustrate the use of the decision making power of the word IF the folowing example is exhibited: : TODAY IF ." TAKE YOUR UMBRELLA AND" THEN ." GO TO THE OFFICE" ; This definition called TODAY takes a truth value from the stack and prints the comment in the ." field if it is true. Otherwise, program control is passed to the instruction after the THEN . Here is another ." that has a comment that will be printed regardless of the value taken from the stack. To true this example, type the word TODAY preceded by a number that represents a Boolean truth value, i.e, 0 TODAY . The value 0 is false, meaning that it is not raining if that is what has been decided upon. The printed result will read, TODAY GO TO THE OFFICEOK If you were able to hook a rain gauge to your computer and read it with a word named CHECK which would leave a zero when it was not raining and a non-zero when it was, entering CHECK TODAY would give you your morning marching orders. Sometimes a more complex form of conditional is required than a simple IF THEN combination. It maybe necessary to take one action when a thing is true and an entirely different one if it is false. In FORTH, the structure that allows this kind of conditional is the IF ELSE THEN combination. Applied to English, it is similar to the biforcated statement "If it is cold I will take my fur hat, else I'd rather take my straw hat instead". An example similar to the one used for the simple IF THEN is presented as follows: : LOWTEMP ." THIS TIME I'LL TAKE MY" IF ." FUR " ELSE ." STRAW " THEN ." HAT! " ; To test the operation of the IF ELSE THENstructure enter: 1 LOWTEMP ret and notice the comment about the fur hat. To use a false value with LOWTEMP will ellicit a remark instead about a straw hat. Much more complex actions could be defined for execution between the IF and ELSE as well as the ELSE and THEN . These ." messages are used only for simplicity. Although the IF was said to always be used with the the THEN earlier, there is actually another word that can be used with the IF instead. The word END and can replace the word THEN . There is no difference between the action of the words, however. The other spellings are provided in the language only to make certain structures more readable. Which one to use is left to the discretion of the programmer. It would be ridiculous of course, if you had to hand feed every truth value to the computer as was the case above before it could make a decision. For this reason, the language FORTH has a number of relational operators. Such words allow testing of numbers on the stack and determination of their status in comparison with others. The relationship of less than, greater than, equal to and a special less than that disregards the positive/negative sign of the numbers can be derived from comparison of two stack numbers. A single stack entry can be checked for less than zero or equal to zero. Finally, a Boolean takes two numbers from the stack and leaves a single remaining truth value in their place. The truth value will be a "1" if the deeper value on the stack is less than the later entered number. That is to say, that the truth value will indicate true if the lower value is less than the value on the Top of Stack. If this is not the case, i.e., they are equal or the Top of Stack is the lesser of the two, the < word will leave a false value of "0" on the stack in their place. It would probably be useful to review a moment the way the - word was detailed to work in FORTH as compared to algebraic notation. The second value down on the stack was the object of the subtraction, the Top of Stack value was subtracted from it. You were told to visualize the two numbers in the order they were entered on the stack and then imagining the operator between them to reconstruct the algebraic syntax. This method of visualization will be quite useful when working with these relative value operators. Before experimenting with < operator, enter the following: : T-OR-F IF ." TRUE" ELSE ." FALSE" THEN ; ret This word will allow you to see the resultant truth value left on the stack by a relational operator. Hopefully, the words "TRUE" and "FALSE" will have more graphic significance than would 1's and 0's printed. Now try entering : 6 9 < .S T-OR-F ret The result should be a 1 printed by the .S and the word "TRUE" following it. Other cases can be explored with entries of 9 6 < T-OR-F and 6 6 < T-OR-F which are both false. The greater than relation is tested by the word > . Again if you should ever have trouble remembering the order in which the operands are taken in respect to the operator, try the algebraic translation method of visualization. After some practice, the order of these operations will become second nature to you. Try all three of the above examples with the 6 and 9 entries to become familiar with the > word. To determine if two values on the stack are identical, the word = may be used. Try the above examples replacing the < with = instead. Remember that these operators always take two numbers off the stack and leave a truth value in their place. If the original values are to be preserved for use in a later routine, it will be necessary to make copies of them with DUP , etc. for the operator to work within their place. The unsigned unrelational operator mentioned earlier is the word U< . To experiment with this word do the above examples replacing the < with U< . The results will be the same as before for the 6 and 9 entries. Repeat both sets of examples with -6 and -9 instead and the difference between the two less than's should be apparent. Often it is desirable to test a pair of numbers for the opposite direction from that of the provided operators. The NOT word is provided to invert truth values for such occassions. Try to find if two numbers are not equal with this entry: 6 9 = NOT T-OR-F ret The NOT word actually has the same effect as the single number operator 0= . Try the example substituting 0= in the place of NOT and see the results are identical. The last remaining relational operator to be mentioned is 0< . This structure will run faster on most FORTH implementations than using a separate 0 and < entry sequence, but has virtually the same effect. Relational operators are usually used in consonance with IF's in programming. An example follows: : SIZE> DUP 10 > IF ." TOO LARGE" THEN . ; ret This word, SIZE> , checks the number passed to it to make sure it is not greater than 10. If it is, a warning message is printed first. A very common structure used in programming is the loop. Conceptually, a loop is a string of instruction that are repeated in order for a given number of times. This eliminates the need to write the same instructions over and over again in sequence when writing the program. Say for example you wanted to write a program that listed all the numbers from 0 to but not including 10, with their squared value beside them. If you were to write all the individual instructions to make this table, it would look like this: : SQ-TBL 1 1 1 . * . CR 2 2 2 . * . CR 3 3 3 . * . CR 4 4 4 . * . CR 5 5 5 . * . CR 6 6 6 . * . CR 7 7 7 . * . CR 8 8 8 . * . CR 9 9 9 . * . CR ; ret As you can see the program is long and tedious because of the constant repetition. There is another disadvantage as well, in that, changing the program to make the same table up to 19 is twice as much work. The work already done is of little more use than as a pattern to the programming for the extended numbers above 9. By using a looping structure, it is possible to save a good deal of effort in writing programs of this type and write a much more useful program as well. Writing a loop structure with only the relational operators and the condition IF ELSE THEN words is very difficult. This is because FORTH's very nature encourages structured programming. One of the main requirements of structured programming is that no "GO TO" like commands be used when programming. There are no "GO TO" words in FORTH. Although it is possible to create them, it is not necessary as you will see shortly. The only way to write a loop with IF ELSE THEN's without "GO TO" commands is by using a method called "reentrant code" where one of the routines called in a words definitions is itself. That is, the word being defined will be set up to call itself when it runs. It will continue to recall itself as many times as necessary to do the looping desired. There are two powerful reasons why this is not a useful solution at this point. First, to actually make a definition available to be called before it even finishes, takes some sophisticated manipulation on the FORTH compilation process, which is beyond the understanding of most moderately competent FORTH users. Secondly, most FORTH systems limit the number of times words can call other words. This is usually below a hundred. Many applications where loops are used can exceed several thousand iteration of the loop, precluding the use of reentrant coding structures for solution. If you are discouraged by the number of methods that are not effective in creating loops, take heart, FORTH offers quite a large number of versatile structures that will just fit the bill. The first to be presented works wonderfully for reworking the last example. The structure is made up of the two words DO and LOOP . When a loop is desired two numbers are passed to the DO word. They are the upper limit of the loop and the number to start the looping with. The count of the loop will start at the top value on the stack and continue until the top limit is met. Any words between the DO and the LOOP will be executed as many times as it takes to meet the upper limit. It is the run-time part of the word LOOP that actually does the counting. Each time LOOP is encountered in the execution, the count has one added to it. It is then tested to see if it is equal to or greater than the upper limit. If it is, the loop is terminated. If not, it branches back to the word immediately following the DO . The looping continues until the final condition is met before execution continues with the rest of words following the LOOP . The squaring table example follows: : SQ-TBL 10 1 DO I I I . * . CR LOOP ; ret TOUR OF THE 68HC11 Max-FORTH MEMORY MAP A first step in preparing to use a dedicated computer system is to learn the system's memory map. This is an easy task with the use of the Max-FORTH DUMP command. Remember that DUMP displays one or more lines each containing 16 memory locations (8 words) which are most easily read when in hex mode, so begin by entering HEX . Starting in low memory, examine the contents of the first three words (six memory locations --- one byte or two hex digits per location which means two locations per word) by entering 0 6 DUMP . (This displays a full dump-line of 16 memory locations --- 8 words, $0000-$000F. Leading zeros at each location are not displayed.) Examine the first three words ($0000-$0006), ignoring the others for the moment. From the manual's Appendix ???, it is seen that these locations contain the system variables of Max-FORTH, namely: W (Word Pointer, $0000-$0001) IP (Instruction Pointer, $0002-$0003); and UP (User Pointer, $0004-$0005). Any two bytes of memory reserved to hold only the address of a particular item (word, block, stack, etc.) is refered to as a pointer. Thus, W and IP are pointers whose contents change every time FORTH executes a new definition. Programmers rarely have need to use W or IP . Advanced programmers might use them in code level definitions when making multitaskers, etc.. UP points to the USER area. By modifying UP to point to another area, the values that user variables return will be a different set. This again is useful in multitaskers. Be sure that the new USER area is initialized with its set of values before changing UP to point to it, otherwise, the systems will crash and be difficult to recover. It is worth mentioning that if you experience a system crash from which it is difficult to recover with a simple reset, a -G key combination in the Serial Communications Interface input register will force a cold reset. (-G is the ASCII "BELL" character, $07 hex.) By entering -G and hitting reset again, you should recover from any badly modified variable, blown dictionary links, crashed processor, or similar problems. A bad autostart, however, can only be rectified by removing or disabling the offending memory device. Notice that UP points to the current USER memory area starting at $0006. To examine this area, enter 6 74 DUMP . The first four words ($0006, $0008, $000A and $000C) are zero'ed by the cold download. They represent DNLINK , UPLINK , PRIORITY and RPSAVE which are user variables reserved for multitasking. These variables are not used by the Version 1.0 Max-FORTH implementation. The following two words ($000E and $0010) are the default stack values, R0 and S0, assigned by ABORT . They can be modified to point into RAM if larger stack areas are desired. They will not be put into effect until ABORT is executed. Normally, the stacks should stay in internal RAM. TIB , PAD and the dictionary areas can be moved to external RAM which will allow room for 28 Return Stack words and 39 Data Stack words. The next two word locations ($0012 and $0014), KEY-CB-PTR and EMIT-CB-PTR, point to control blocks that determine how the built-in I/O routines work. Alternate control blocks can be constructed to handle alternate I/O devices without modifying the I/O routines. Each control blocks are six bytes long and contains the following: 1) a two-byte address of the I/O device status register to be read, 2) a one-byte mask with which the status value read will be AND'ed to screen out extraneous bits, 3) a one-byte mask with which the AND'ed result will be XOR'ed to obtain a non-zero result when the device is ready for transfer, and 4) a two-byte address of the I/O device data register. These pointers (KEY-CB-PTR and the EMIT-CB-PTR) are initialized to point to the beginning of the default Serial Communications Interface control blocks. The pointer can be modified to point to control blocks that handle LCD displays and keypad controllers or alternate serial chips, etc. to redirect system I/O. The next three word locations ($0016, $0018 and $001A) are the actual machine level vectors to the I/O subroutines that provide the functions mentioned above. If a control block solution is not sufficient, you may write your own machine code subroutine. Its address is installed in UKEY , UEMIT or U?TERMINAL as appropriate. Following is the pointer (at $001C) to the Terminal Input Buffer, TIB, and normally contains an address pointing to the RAM just beyond the bottom of the Return Stack. It is limited by UC/L ($001E) to 16 characters. TIB can be moved to external RAM and made larger by modifying these USER variables. The USER variable which indicates that a COLD reset has been performed is called CLD/WRM ($0020). As long as it contains a $A55A pattern and there is no -R in the SCI, the system will not do a cold download of system variables at every reset. PAD in most FORTH systems is a fixed distance above the dictionary pointer, but in Max-FORTH that would be impossible with the limited internal RAM, so PAD is restricted to be at a "fixed" location, which can be "moved" by changing UPAD ($0022). Since the user may work "above" PAD with temporary variables and the system works "below" PAD when doing output number conversions, ensure that PAD has free RAM on both sides of its new setting. BASE , the current number base, is kept in the next location ($0024) and performs as per most other FORTH's. The next location ($0026) is used in conjunction with the Timer Output Capture 5 in EEPROM programming words to time the number of cycles to program the EEPROM. It is called C/10MS for "Cycles Per 10 Milliseconds delay". You should decrease this value from the default decimal value of 20000 if your system has a clock slower than 2 Mhz. The line termination character can be changed from a carriage return to any other character by modification of the next location ($0028). Similarly, the backspace character can be changed from a backspace to a delete by modifying the following location ($002A). The Dictionary Pointer, DP , and the heads dictionary pointer follow ($002C and $002E). The location after them ($0030) is the EEPROM dictionary usage pointer that is added to when a word is moved into EEPROM with EEWORD . The flag that controls headerless code generation follows ($0032). Additional standard FORTH USER definitions follow ($0034 through $0070). Following are four USER variable locations ($0072, $0074, $0076 and $0078) which are reserved for mass storage requirements. Only the first location ($0072) has any reference in the internal code. It is used to set the base address of the RAMDSK mass storage simulator. To use RAMDSK, which is pointed to by the default setting of UR/W ($0056), set the first location to the base address of free RAM (ie: C400 72 ! ) and clear the buffers (which are at default locations $D7FC through $E000 ) (ie: EMPTY-BUFFERS ). The RAM screens can then be listed, loaded and saved, etc.. This ends the USER area while the default location of the dictionary begins at $007A. When a cold reset occurs, TASK is moved to the beginning of the dictionary. New entries in the dictionary will build up from TASK ($0083 and up). The Data Stack is above the dictionary. It grows down as more entries are added ($00C7 and down). There aren't many locations between the dictionary and the stack, so some care should be exercised. Needless to say, running the stack into the dictionary or vice versa is a very bad idea. The dictionary can be moved after a cold reset simply by forgeting task and storing the address of the new dictionary RAM in DP (ie: FORGET TASK HEX C004 DP ! ). The area immediately above the data stack ($00C8 down from $00CF) is used by the system numeric output routines. The usage builds down from just below PAD until the number of output characters for a given print or "dot word" is reached. (Note: only 8 digit numbers are provided for in the default setting.) (The two lowest locations are used as "secret" storage places for the settings of BLK ($00C8) and >IN ($00CA) after an error message is generated so you can look up the location of the error on mass storage after the crash. Better get them before you print any numbers after a crash... ) The beginning of TIB and PAD are both at the same location ($00D0), the idea is to prevent PAD from being used in internal RAM if TIB is in use. Sixteen bytes are reserved for TIB ($00D0 through $00DF). The Return Stack occupies the upper end of internal RAM ($00E0 through $00FF). The next location of interest in the 68HC11 map is the first location that an autostart pattern can be located ($0400). Versions 2.0 and greater do autostart pattern searches in EEPROM and then on every 1K boundary starting there and on. Since reset puts the register block of the 68HC11 at $1000 in the "middle of things", the Max-FORTH V2.x or V3.x operating system moves them to $B000. (The Max-FORTH V1.0 operating system move them to $9000. Originally, it was intended to put them at $B000, but the EVB has a special write latch from $A000 to $BFFF that precluded proper functioning there. References to the register block at $B000 often shut off the serial channel on the EVB. Later versions of the EVB were changed to correct the oversight.) The write that moves the register block will still affect external memory when the move is performed, so, always watch out for location $103D which will have $0B (or $09) stored into it with every reset. The registers are moved into $B000 to $B03F for versions V2.x and V3.x ($9000 to $903F for version V1.0). See the later section on programming the I/O or the appropriate Motorola documentation for their description. To look at them enter B000 40 DUMP (or 9000 40 DUMP). The EEPROM is the next natural occurrence in the memory map ($B600 through $B7FF). The first word location ($B600) may hold the autostart pattern. This location is the first high level autostart location checked after power up. If the first location is the autostart pattern, the next ($B602) is the address of the CFA (code field address) of the word to be autostarted. If interrupts are not used, the next 247 bytes of EEPROM are unassigned. If interrupts are to be used, the particular interrupt enable must have a machine code program at its EEPROM target location. Starting at location $B7BF and thereafter for each interrupt vector in ROM, three bytes are reserved. They will normally contain a jump instruction to another portion of memory which performs the appropriate interrupt function. It can return to the interrupted program by doing an RTI at its completion. At the very end of EEPROM, a word location ($B7FE) is checked by the reset routine for an autostart pattern which means that there is a machine code instruction in the previous three bytes ($B7FB) to be executed at power up before the write-once-only registers are modified. If that autostart pattern is present, the system jumps to subroutine to the code address. It will normally contain a jump instruction to another portion of memory which sets the OPTIONS and INIT registers as desired. It can reenter the start up procedures by doing an RTS at it completion. To look at the EEPROM enter B600 200 DUMP . (On the Motorola EVB the area from $C000 to $DFFF is RAM. This can be used for mass storage buffers and screens, or program space or for TIB and PAD etc.) The Max-FORTH ROM runs from $E000 through $FFFF and contains the heads of Max-FORTH, followed by non-runtime words, followed by the runtime kernel. The DUMP command can be used to explore any portion of the ROM. It will be noted that the heads are made up mostly of ASCII characters and pointers. The non runtime codes are mostly pointers. The runtime codes are a mix of pointers, machine code and miscellaneous tables, etc.. PROGRAMMING THE INPUT / OUTPUT OF THE F68CH11 All of the F68HC11 onboard input/output features are controlled by a single register block of 64 locations. Understanding the use of those registers means understanding all the I/O features of the F68HC11. The location of this register block is controlled (you might have guessed) by a register. Upon reset this register establishes the register block at $1000. Although the Max-FORTH operating system allows modification, the register set will normally be moved by the operating system to $B000 for Rev 2 parts ($9000 for Rev 0 and Rev 1) to give the most consistantly contiguous memory map possible. (At $B000, the registers are in the same 4K block of memory already partitioned by the EEPROM.) The following discussion assumes the register set is a $B000. The number of register may seem formidable. It will be easier to understand them by first grouping them by their function. There are five major groups: port, timer, serial channel, A/D and miscelaneous. The 68HC11 includes a 40 I/O pins in five 8-bit ports. All of these pins serve multiple functions depending on the operating mode and the internal control registers. These registers are in memory from $B000 to $B00A. PORTA $B000 PIOC $B002 PORTC $B003 PORTB $B004 PORTCL $B005 DDRC $B007 PORTD $B008 DDRD $B009 PORTE $B00A The first register, PORTA at $B000, is used to read and write Port A. When Port A is used for general purpose I/O bits, bits 0, 1 and 2 are configured for input-only and writes to these bits have no meaning or effect. Bits 3, 4, 5 and 6 of Port A are configured for output-only. Reads of these bits return the levels sensed at the inputs to the pin drivers. Port A bit 7 (PA7) can be configured as a general-purpose I/O using the DDRA7 bit in the PACTL register. Port A may also be configured as: three input capture functions (IC1, IC2, IC3), four output compare functions (OC2, OC3, OC4, OC5), with a pulse accumulator input (PA1) or a fifth output compare functions (OC1). Each port A that is not used for a capture or compare function may be used as a general purpose input or output line. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | PA7 | PA6 | PA5 | PA4 | PA3 | PA2 | PA1 | PA0 | $B000 PORTA |-----|-----|-----|-----|-----|-----|-----|-----| The second location at $B001 is reserved and has no function currently. The Port I/O Control register, PIOC at location $B002, has a collection of control bits dealing largley with handshake control. With the except bit 7, which is read only, the PIOC is a read/write register. Due to the complexity of the bits in the PIOC each bit will be described separately. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | STAF| STAI| CWOM| HNDS| OIN | PLS | EGA | INVB| $B002 PIOC |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 STAF Strobe A Interrupt Status Flag. This bit is set when a selected edge of strobe A occurs. Clearing it depends on the state of HNDS and OIN bits. STAF is cleared by reset. |------|-----|--------------------------------------------------- ---------| | HNDS | OIN | Clearing Mechanism | |------|-----|--------------------------------------------------- ---------| | 0 | X | Reading PIOC (with STAF Set) Followed by a Read of PORTCL | | 1 | 0 | Reading PIOC (with STAF Set) Followed by a Read of PORTCL | | 1 | 1 | Reading PIOC (with STAF Set) Followed by a Write to PORTCL | |------|-----|--------------------------------------------------- ---------| Bit 6 STAI Strobe A Interrupt Enable Mask. When this bit is set and the I bit in the condition code register is clear, STAF (when set) will request an interrupt. STAI is cleared by reset. Bit 5 CWOM Port C Wire-OR Mode. When clear, port C operates normally. When set, port C behaves as open-drain outputs. CWOM is cleared by reset. Bit 4 HNDS Handshake Mode. When clear, strobe A acts as a simple input strobe to latch data into PORTCL, and strobe B acts as a simple output strobe which pulses after a write to port B. When set a handshake protocol involving port C, STRA and STRB is selected (see the definition of the OIN bit). Bit 3 OIN Output or Input Handshaking. This bit has no meaning when HNDS=0. Otherwise, when OIN is clear, input handshake mode is selected. When OIN is set, output handshake mode is selected. OIN is cleared by reset. Bit 2 PLS Pulse/Interlocked Handshake Operation. This bit has no meaning if HNDS=0. When PLS is clear, interlocked handshake operation is selected. In this mode, strobe B, once activated, stays active until the selected edge of strobe A is detected. When PLS is set, strobe B is pulsed for two E cycles. This bit is undefined coming out of reset. Bit 1 EGA Active Edge for Strobe A. When clear, falling edge of STRA is selected. When output handshake is selected, port C bits obey the DDRC while STRA is low, but port C is forced to output when STRA is high. When set, rising edge of STRA is selected. When output handshake is selected, port C bits obey the DDRC while STRA is high, but port C is forced to output when STRA is low. This bit is set by reset. Bit 0 INVB Invert strobe B. When clear, the active level on strobe B is a logic zero. When set, the active level on strobe B is a logic one. It is set by reset. Location $B004, PORTC, is the used to read and write the Port C pins. All Port C pins are general-purpose input/output pins. The direction of the Port C lines are controlled by a direction register, DDRC. Port C inputs can be latched by the STRA input. Port C may also be used in full handshake modes of parallel I/O where the STRA input and STRB output act as handshake control lines. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | PC7 | PC6 | PC5 | PC4 | PC3 | PC2 | PC1 | PC0 | $B003 PORTC |-----|-----|-----|-----|-----|-----|-----|-----| Location $B005, PORTB, is the used to read and write Port B. All of the port B pins are general-purpose output pins. During reads of this port, the level sensed at the input side of the port B output drivers is read. Port B may also be used in a simple strobed output mode where the STRB pulses each time port B is written. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | PB7 | PB6 | PB5 | PB4 | PB3 | PB2 | PB1 | PB0 | $B004 PORTB |-----|-----|-----|-----|-----|-----|-----|-----| Location $B005, PORTCL, is the used to read Port C, but it returns the value latched at the time of the last significant edge on STRA. All Port C pins are general-purpose input/output pins. The direction of the Port C lines are controlled by a direction register, DDRC. Port C inputs can be latched by the STRA input. Port C may also be used in full handshake modes of parallel I/O where the STRA input and STRB output act as handshake control lines. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | PC7 | PC6 | PC5 | PC4 | PC3 | PC2 | PC1 | PC0 | $B005 PORTCL |-----|-----|-----|-----|-----|-----|-----|-----| The next location at $B006 is reserved and has no function currently. A data direction register, DDRC at $B007, determines if individual Port C pins are input or outputs. The data direction register itself can be read, or written to set the Port C I/O directions. Each bit in PORTC data register has a bit in the position the DDRC register. When a bit is configured for output by being set, the value returned by a read is the value at the input to the pin driver. When a line is configured as an input, by clearing the DDRC bit, the pin becomes a high impedance input. If a write is executed to a line that is configured as an input, the value does not affect the I/O pin, but the bit is stored in an internal latch so that if the line is later reconfigured as an output, then this value appears at the I/O pin. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit 7|Bit 6|Bit 5|Bit 4|Bit 3|Bit 2|Bit 1|Bit 0| $B007 DDRC |-----|-----|-----|-----|-----|-----|-----|-----| Location $B008, PORTD, is the used to read and write Port D. Port D bits 0-5 may be used for general I/O or with the serial communications interface (SCI) and serial pheripheral interface (SPI) subsystems. Bits 6 and 7 are used as handshake control signals for ports B and C. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | | | PD5 | PD4 | PD3 | PD2 | PD1 | PD0 | $B008 PORTD |-----|-----|-----|-----|-----|-----|-----|-----| A data direction register, DDRD at $B009, determines if the five individual general purpose Port D pins act as input or outputs. The data direction register itself can be read, or written to set the Port D I/O directions. Each bit in PORTD data register has a bit in the position the DDRC register. When a bit is configured for output by being set, the value returned by a read is the value at the input to the pin driver. When a line is configured as an input, by clearing the DDRD bit, the pin becomes a high impedance input. If a write is executed to a line that is configured as an input, the value does not affect the I/O pin, but the bit is stored in an internal latch so that if the line is later reconfigured as an output, then this value appears at the I/O pin. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | | |Bit 5|Bit 4|Bit 3|Bit 2|Bit 1|Bit 0| $B009 DDRD |-----|-----|-----|-----|-----|-----|-----|-----| Note that bits 6 and 7 of Port D are dedicated to bus control (AS and R/W) while in expanded mode or parallel I/O strobes (STRA and STRB) while in single chip modes. For this reason, bits 6 and 7 of Port D are not available as general purpose I/O lines and the associated bits in the DDRD and PORTD registers are not implemented. Location $B00A, PORTE, is the used to read Port E. In all operating modes, Port E is used for general-purpose inputs and/or analog-to-digital (A/D) channel inputs. Port E should not be read while an A/D conversion is actually taking place. Writes to the PORTE address have no meaning or effect. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | PE7 | PE6 | PE5 | PE4 | PE3 | PE2 | PE1 | PE0 | $B00E PORTE |-----|-----|-----|-----|-----|-----|-----|-----| The largest of the five groups of registers concern the timer functions. CFORC $B00B OC1M $B00C OC1D $B00D TCNT $B00E TIC1 $B010 TIC2 $B012 TIC3 $B014 TOC1 $B016 TOC2 $B018 TOC3 $B01A TOC4 $B01C TOC5 $B01E TCTL1 $B020 TCTL2 $B021 TMSK1 $B022 TFLG1 $B023 TMSK2 $B024 TFLG2 $B025 PACTL $B026 PACNT $B027 The timer has a single 16-bit free-running counter which is clocked by the output of a four-stage prescaler (divide by 1, 4, 8 or 16), which is in turn driven by the MCU E clock. Input functions are called input captures. These input captures record the count from the free-running counter in response to a detected edge on an input pin. Output functions, called output compares, can automatically affect output pins when there is a match between a 16-bit output-compare register and the free-running counter. Additionally, one output compare can affect any or all of the five output pins (Bits 7-3) in Port A at once, as a result of a successful compare. This function allows control of multiple I/O pins automatically with a single output compare. This timer system has a total of three input capture register and five output compare registers. The first register in the group deals with the output compare function. The write-only register, CFORC at $B00B, allows output compares to be forced by writing is done to CFORC with the associated bit set for each output compare that is to be forced. The action taken as a result of a forced compare is the same as if there was a match between the OCx register and the free-running counter, except that the corresponding interrupt flag status bits are not set. Reads of this location have no meaning or effect and always return logic zeros ($00). Five of the bit positions in the CFORC register, bits 7 - 3, correspond to the five output compares. Bits 2, 1 and 0 of the CFORC register are not implemented. Note that the compare force function is not generally recommended for use with the output toggle function because a normal compare occuring immediately before or after the force may result in the undesirable operation. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | FOC1| FOC2| FOC3| FOC4| FOC5| - | - | - | $B00B CFORC |-----|-----|-----|-----|-----|-----|-----|-----| FOC1-FOC5 Force Output Compare x Action 0 - has no meaning 1 - causes the action which is programmed for output compare except that the OCxF is not set. Bits 2-0 Not implemented. Read as a logic zeros. The next register, OC1M at $B00C, is used in conjunction with Output Compare 1 to specify the bits of port A which are to be affected as a result of a successful OC1 compare. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |OC1M7|OC1M6|OC1M5|OC1M4|OC1M3| - | - | - | $B00C OC1M |-----|-----|-----|-----|-----|-----|-----|-----| The bits of OC1M register correspond bit-for-bit with the output bits of Port A (bits 7 through 3 only). For each bit that is affected by the successful Output 1 Compare, the corresponding bit in OC1M should be set to one. Bits zero through two are not implemented and always read as zeros. This register is cleared by reset. The register immediately following, OC1D at $B00D, is also used in conjunction with Output Compare 1. It specifies the data which is to be stored to the affected bits of Port A as the result of a successful OC1 compare. Bits zero through two are not implemented and always read as zeros. This register is not affected by reset. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |OC1D7|OC1D6|OC1D5|OC1D4|OC1D3| - | - | - | $B00D OC1D |-----|-----|-----|-----|-----|-----|-----|-----| The bits of 0C1D correspond bit-for-bit with the bits of port A (bits 7 through 3 only). When a successful OC1 compare occurs, for each bit that is set in OC1M, the corresponding data bit in OC1D is stored in the corresponding bit of port A. If there is a conflicting situation where an OC1 compare and another output compare function occur during the same E cycle with both attempting to alter the same port A bit, the OC1 action overrides. (Note that the pulse accumulator function shares bit 7 of port A. If the DDRA7 control bit in the PACTL register is set, then Port A bit 7 is configured as an output and OC1 can obtain access by setting OC1M bit 7. Further, if the PAEN control bit in the PACTL register is set, enabling the pulse accumulator, OC1 compares cause the pulse accumulator to take the appropriate action of the pulse counting or gating mode). The next two locations, TCNT at $B00E and $B00F, can be used to read the counter at any time without affecting its value because it is clocked and read during opposite half cycles of the MPU E clock. A counter read should first address the most significant byte. An MPU read of this address causes the least significant byte to be transferred to a buffer. This buffer is not affected by reset and is accessed when reading the least significant byte of the counter. For double byte read insructions, the two accesses occur on consecutive bus cycles. The counter is cleared to $0000 during reset and is a read-only register in all but the test mode. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B00E \ |-----|-----|-----|-----|-----|-----|-----|-----| > TCNT |Bit 7| - | - | - | - | - | - |Bit 0| $B00F / |-----|-----|-----|-----|-----|-----|-----|-----| The input capture registers are 16-bit read-only registers which are not affected by reset and are used to latch the value of the counter when a defined transition is sensed by the corresponding input capture edge detector. (The level transition which triggers counter transfer is defined by the corresponding input edge bits, EDGxB and EDGxA, in TCTL2.) B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B010 \ |-----|-----|-----|-----|-----|-----|-----|-----| > TIC1 |Bit 7| - | - | - | - | - | - |Bit 0| $B011 / |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B012 \ |-----|-----|-----|-----|-----|-----|-----|-----| > TIC2 |Bit 7| - | - | - | - | - | - |Bit 0| $B013 / |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B014 \ |-----|-----|-----|-----|-----|-----|-----|-----| > TIC3 |Bit 7| - | - | - | - | - | - |Bit 0| $B015 / |-----|-----|-----|-----|-----|-----|-----|-----| The result obtained by an input capture corresponds to the value of the counter one cycle after the transition which triggered the edge-detection logic. The selected edge transition sets the ICxF in TFLG1 and can cause an interrupt if the corresponding ICxI bit(s) is (are) set in the TMSK1 register. A read of the Input Capture Register's MSB inhibits captures for one E cycle to allow a double-byte read of the full 16-bit register. The output compare registers are 16-bit read/write registers which are initialized to $FFFF by reset. They can be used as output waveform controls and as elapsed time indicators. If an output compare is not utilized, the unused registers may be as storage locations. All output compare registers have a separate dedicated comparator for comparing against the free-running counter. If a match is found, the corresponding output compare flag (OCxF) bit in TFLG1 is set and a specified action is automatically taken. For output compare functions two through five, the automatic action is controlled by pairs of bits in the TCTL1 control register (OMx and OLx). Each pair of control bits are encoded to specify the output action taken as a result of a successful OCx compare. An interrupt can also accompany a successful output compare, provided that the corresponding interrupt enable bit (OCx1) is set in TMSK1. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B016 \ |-----|-----|-----|-----|-----|-----|-----|-----| > TIC1 |Bit 7| - | - | - | - | - | - |Bit 0| $B017 / |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B018 \ |-----|-----|-----|-----|-----|-----|-----|-----| > TIC2 |Bit 7| - | - | - | - | - | - |Bit 0| $B019 / |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B01A \ |-----|-----|-----|-----|-----|-----|-----|-----| > TIC3 |Bit 7| - | - | - | - | - | - |Bit 0| $B01B / |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B01C \ |-----|-----|-----|-----|-----|-----|-----|-----| > TIC4 |Bit 7| - | - | - | - | - | - |Bit 0| $B01D / |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit15| - | - | - | - | - | - |Bit 8| $B01E \ |-----|-----|-----|-----|-----|-----|-----|-----| > TIC5 |Bit 7| - | - | - | - | - | - |Bit 0| $B01F / |-----|-----|-----|-----|-----|-----|-----|-----| After an MPU write cycle to the most significant byte, output compares are inhibited for one E cycle in orded to allow writing two consecutive bytes before making the next comparison. If both bytes of the register are to be changed, a double-byte write instruction should be used in order to take advantage of the compare inhibit feature. MPU writes can be made to either byte of the output compare register without affecting the other byte. Timer Control Register 1, TCTL1, is an 8-bit read/write register. All bits in this register are cleared to zero during reset. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | OM2 | OL2 | OM3 | OL3 | OM4 | OL4 | OM5 | OL5 | $B020 TCTL1 |-----|-----|-----|-----|-----|-----|-----|-----| Bits 7, 5, 3, 1 - OMx Output Mode. Bits 6, 4, 2, 0 - OLx Output Level. These two control bits (OMx and OLx) are encoded to specify the output action to be taken as a result of a successful OCx compare. OMx OLx Action Taken Upon Successful Compare 0 0 Timer disconnected from output pin logic 0 1 Toggle OCx output line 1 0 Clear OCx output line to zero 1 1 Set OCx output line to one Timer Control Register 2, TCTL2, is an 8-bit read/write register except for bits 6 and 7 which are not implemented. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | - | - |EDG1B|EDG1A|EDG2B|EDG2A|EDG3B|EDG3A| $B021 TCTL2 |-----|-----|-----|-----|-----|-----|-----|-----| Bits 7, 6 Not implemented. Read as logic zeros. Bits 5, 3, 1 EDGxB Input Capture x Edge Control. These two bits (EDGxB and EDGxA) are cleared to zero by Bits 4, 2, 0 EDGxA reset and are encoded to configure the input sensing logic for input capture x as follows: EDGxB EDGxA Configuration 0 0 Capture disabled 0 1 Capture on rising edges only 1 0 Capture on falling edges only 1 1 Capture on any (rising or falling) edge The timer interrupt mask register, TMSK1, is a read/write register. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | OC11| OC21| OC31| OC41| OC51| IC11| IC21| IC31| $B022 TMSK1 |-----|-----|-----|-----|-----|-----|-----|-----| Bits 7-3 OCxI Output Compare x Interrupt. If the OCxI mask bit is set when the OCxF flag bit is set, a hardware interrupt sequence is requested. Bits 2-0 ICxI Input Capture x Interrupt. If the ICxI mask bit is set when the ICxF flag bit is set, a hardware interrupt sequence is requested. The Timer System Flag Register 1, TFLG1, is used to indicate the occurence of timer system events and together with the TMSK1 register allows the timer sub-system to operate in a polled or interrupt driven system. For each bit in the timer flag register 1 (TFLG1), there is a corresponding bit in the timer mask register 1 (TMSK1) in the same bit position. If, and only if, the mask bit is set each time the conditions for the corresponding flag are met, a hardware interrupt sequence is requested as well as the flag bit being set. To clear a flag in this register a pattern of ones should be written to the bits to be cleared. The zeros in that pattern will not affect the state of any bit. Bit manipulation instructions would be inappropriate for flag clearing because they are read-modify-write instructions. Even though the instruction mask implies that the programmer is only interested in some of the bits in the manipulated location, the entire 8-bit location is actually read and rewritten which may clear other bits in the register. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | OC1F| OC2F| OC3F| OC4F| OC5F| IC1F| IC2F| IC3F| $B023 TFLG1 |-----|-----|-----|-----|-----|-----|-----|-----| Bits 7-3 OCxF Output Compare x Flag. This flag bit is set each time the timer counter matches the output compare register x value. A write of zero does not affect the state of this bit. A write of a one causes this bit to be cleared. Bits 2-0 ICxF Input Capture x Flag. This flag bit is set each time a selected active edge is detected on the ICx input line. A write of a zero does not affect this bit. A write of a one causes this bit to be cleared. The Timer System Mask Register 2, TMSK2, is used to control wether or not a hardware interrupt sequence is requested as a result of a status bit being set in timer system flag register 2. In addition, two timer prescaler bits are included in this register. For each of the four most significant bits in timer flag register 2 (TFLG2), there is a corresponding bit in the timer mask register 2 (TMSK2) in the same bit position. All bits in the TMSK2 Register are cleared by reset. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | TOI | RTII|PAOVI| RAII| - | - | PR1 | PR0 | $B024 TMSK2 |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 TOI Timer Overflow Interrupt Enable. This read/write bit is cleared by reset. If this bit is set, a timer overflow interrupt request is initiated each time the TOF bit (in TFLG2) is set as a result of a timer counter overflow. Bit 6 RTI Interrupt Enable. This read/write bit is cleared to zero by reset and is used to enable or inhibit RTIF interrupt flags from causing hardware interrupt sequences. When RTII is clear, the RTIF flag is masked (inhibited). When RTII is set, the RTIF flag is enabled to cause a hardware interrupt. Bit 5 PAOVI Pulse Accumulator Overflow Interrupt Enable. This read/write bit is cleared to zero by reset and is used to enable or inhibit PAOVF interrupt flags from causing hardware interrupt sequences. When it is set, a hardware interrupt results when the PAOVF bit is set. Bit 4 PAII Pulse Accumulator Input Interrupt Enable. This read/write bit is cleared to zero by reset and is used to enable or inhibit PAIF interrupt flags from causing hardware interrupt sequences. When it is set, a hardware interrupt results if the PAIF bit is set. Bit 3-2 These bits are not implemented. Reads of these bits will always return a logic zero. Bit 1-0 PR1,PR0 Timer Prescaler Selects. These two bits may be read at any time but may only be written during initialization. Reset clears these bits. Writes are disabled after the first write or after 64 E cycles out of reset. If the MCU is in special test or special bootstrap mode, then these two bits may be written any time. These two bits specify the timer prescaler divide factor. PR1 PR0 Divide-by-Factor 0 0 1 0 1 4 1 0 8 1 1 16 Timer System Flag Register 2, TFLG2, is used to indicate the occurence of timer system events and together with the TMSK2 register, allows the timer sub-systems to operate in a polled or interrupt driven system. For each bit in timer flag register 2 (TFLG2), there is a corresponding bit in timer mask register 2 (TMSK2) in the same bit position. If the mask bit is set each time the conditions for the corresponding flag are met, a hardware interrupt sequence is requested, as well as the flag bit being set. The timer system status register indicates when interrupt conditions have occurred. To clear a bit or bits, a logic one is written to it, or them. Bit manipulation instructions would be inappropriate for flag clearing because they are read-modify-write instructions. Even though the instruction mask implies that the programmer is only interested in some of the bits in the manipulated location, the entire 8-bit location is actually read and rewritten which may clear other bits in the register. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | TOF | RTIF|PAOVF| PAIF| - | - | - | - | $B025 TFLG2 |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 TOF Timer Overflow. This bit is cleared by reset. It is set to one each time the 16-bit free-running counter advances from a value of $FFFF to $0000. In order to acknowledge (clear) the TOF flag the user must perform a write operation to TFLG2 with bit 7 set. Bit 6 RTIF Real Time Interrupt Flag. This bit is cleared by reset. RTIF is set at each rising edge of the selected tap point. To clear the RTIF flag, a software write is performed to the TFLG2 register with bit 6 set to one. Bit 5 PAOVF Pulse Accumulator Overflow Interrupt Flag. This bit is cleared by reset and becomes set when the count in the pulse accumulator rolls over from $FF to $00. This bit is cleared by a write to the TFLG2 register with bit 5 set. Bit 4 PAIF Pulse Accumulator Input Edge Interrupt Flag. This bit is cleared by reset and becomes set when an active edge is detected on the PAI input pin. This bit is cleared by a write to the TFLG2 register with bit 4 set. Bits 3-0 These bits are not implemented and they read as logic zeros. When the count changes from $FFFF to $0000, the timer overflow flag (TOF) bit is set in TFGL2. An interrupt can be enabled by setting the interrupt enable bit (TOI) in TMSK2. The real time feature on the 68HC11 is configured and controlled by two bits in the PACTL control register (RTR1 and RTR0) to select one of four interrupt rates. The RTII bit in TMSK2 enables the interrupt capability. Every timeout causes the RTIF bit to be set in TFLG2 and if RTII is set, an interrupt request is generated. After reset, one entire real time interrupt period elapses before the RTIF flag is set for the first time. The pulse accumulator is an 8-bit counter which can operate in etiher of two modes depending on the state of the PAMOD control bit in PACTL. In the event, counting mode, the 8-bit counter is clocked to increasing values by an external pin. In the gated time accumulation mode, an E/64 clock drives the 8-bit counter, but only while the external PAI input pin is in a selected state. The pulse accumulator uses port A bit 7 as its PAI input, but this pin also shares function as a general purpose I/O pin and as a timer output compare 1 output. Although the port A bit 7 would normally be configured as an input when being used for the pulse accumulator, it still drives the pulse accumulator system even when it is configured for use in its alternate capacities. Four bits in this register are used to control an 8-bit pulse accumulator system and two other bits are used to select the rate for the real time interrupt system. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |DDRA7| PAEN|PAMOD|PEDGE| - | - | RTR1| RTR0| $B026 PACTL |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 DDRA7 Data Direction for Port A Bit 7. This read/write bit is cleared by reset and is used to enable or disable the output driver for the Port A bit 7 pin. When DDRA7 is zero, the Port A bit 7 pin is configured for input only and when DDRA7 is one, Port A bit 7 is configured for output. Note that even when Port A bit 7 is configured for output, this pin still acts as the input to the pulse accumulator system. Bit 6 PAEN Pulse Accumulator System Enable. This read/write bit is cleared by reset and is used to enable or disable the pulse accumulator system. When it is set, the pulse accumulator is enabled, and when clear, the pulse accumulator system is disabled. Bit 5 PAMOD Pulse Accumulator Mode. This read/write bit controls whether the pulse accumulator is to operate in the external event counting mode or the gated time accumulation mode. When it is zero, the pulse accumulator counts pulses on the PAI input pin (port A bit 7). When it is set, the pulse accumulator operates in the gated time accumulation mode and the PAI input allows the pulse accumulator counter to count. The PAMOD bit is cleared to zero by reset. PAMOD PEDGE Action on Clock 0 0 PAI Falling Edge Increments the Counter 0 1 PAI Rising Edge Increments the Counter 1 0 A '0' on PAI Inhibits Counting 1 1 A '1' on PAI Inhibits Counting Bit 4 PEDGE Pulse Accumulator Edge Control. This read/write bit has different meanings depending on the state of the PAMOD control bit. This bit is cleared by reset. Bit 3-2 These bits are not implemented and read as logic zeros. Bit 1-0 RTR1,RTR0 RTI Interrupt Rate Selects. These two read/write bits select one of four rates for the real time period interrupt circuit. Reset clears these two bits and after reset, a full RTI periods elapses before the first RTI interrupt. |----------------------------------------------------------| | R R | | Xtal = | Xtal = | Xtal = | | T T | | 223 | 8.0 Mhz | 4.0 Mhz | | R R |Divide | | | | | 1 0 | E by | | | | |----------------------------------------------------------| | 0 0 | 213 | 3.91 ms | 4.10 ms | 8.19 ms | | 0 1 | 214 | 7.81 ms | 8.19 ms | 16.38 ms | | 1 0 | 215 | 15.62 ms | 16.38 ms | 32.77 ms | | 1 1 | 216 | 31.25 ms | 32.77 ms | 65.54 ms | |----------------------------------------------------------| | E = | 2.1 Mhz | 2.0 Mhz | 1.0 Mhz | |----------------------------------------------------| SPCR $B028 SPSR $B029 SPDR $B02A BAUD $B02B SCCR1 $B02C SCCR2 $B02D SCSR $B02E SCDR $B02F The serial peripheral interface (SPI) is a synchronous interface built into the 68HC11 MCU which allows several several 68HC11 MCUs or a 68HC11 plus peripheral devices, to be interconnected. In an SPI, separate wires (signals) are required for data and clock as the clock is not included in the data stream. An SPI system may be configured as a master or as a slave. The four basic signals (MISO, MOSI, SCK and SS) used to transmit data by the serial peripheral interface are discussed in the following paragraphs. Each signal is described for both the master and slave modes. Any SPI outputs has to have its corresponding data direction bit in DDRD set. If this bit is clear, the pin is disconnected from the SPI logic and becomes a general-purpose input. There are three registers in the serial peripheral interface which provide control, status and data strorage functions. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | SPIE| SPE | DWOM| MSTR| CPOL| CPHA| SPR1| SPR0| $B028 SPCR |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 SPIE When the serial peripheral interrupt enable bit is set, SPI interrupts are allowed. Interrupts are masked when this bit is cleared. The SPIE bit is cleared by reset. Bit 6 SPE When serial peripheral enable bit is set, it enables the SPI system by connecting it to the external pins. Because the SPE bit is cleared by reset, the SPI system is not connected to the external pins upon reset. Bit 5 DWOM If the DWOM bit is set, Port D output pins function as open-drain outputs, and when the DWOM is clear, Port D output pins function normally. The DWOM bit is cleared by reset. Bit 4 MSTR If the MSTR bit is set, the SPI is a master device. If cleared, the SPI is a slave device. Bit 3 CPOL When the clock polarity bit is cleared and data is not being transferred, a steady state low value is produced at the SCK pin of the master device. Conversely, if this bit is set, the SCK pin will idle high. This bit is also used in conjunction with the clock phase control bit to produce the desired clock-data relationship between master and slabe. The CPOL bit is cleared by reset. Bit 2 CPHA The clock phase bit, in conjunction with the CPOL bit, controls the clock-data relationship between master and slave. In general, the CPHA bit selects which clock edge captures data and allows it to change states. The CPHA bit is set by reset. Bit 1-0 SPR1 SPR0 These two serial peripheral rate bits select one of four baud rates to be used as a SCK if a device is a master; however, they have no effect in the slave mode. The SPR1 and SPR0 bits are not affected by reset. |------|------|--------------------| | | | Internal Processor | | SPR1 | SPR0 | Clock Divide By | |------|------|--------------------| | 0 | 0 | 2 | | 0 | 1 | 4 | | 1 | 0 | 16 | | 1 | 1 | 32 | |------|------|--------------------| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | SPIF| WCOL| - | MODF| - | - | - | - | $B029 SPSR |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 SPIF The serial peripheral data transfer flag bit is set upon completion of data transfer between the processor and external device. If SPIF goes high and if SPIF is set, a serial peripheral interrupt is generated. While SPIF is set, all writes to the serial peripheral data register are inhibited. Clearing the SPIF bit is accomplished by reading the SPSR (with SPIF set) followed by an access of the SPDR. The SPIF bit is cleared by reset. Bit 6 WCOL The write collision bit is set when an attempt is made to write to the serial peripheraldata register while data transfer is taking place. Clearing the WCOL bit is accomplished by reading th SPSR (with WCOL set) followed by an access to SPDR. The WCOL bit is cleared by reset. Bit 5 Not implemented and reads as zero. Bit 4 MODF The mode fault flag indicates that there may have been a multi-master conflict for system control and allows a proper exit from system operation to a reset or default system state. The MODF bit is normally clear, and is set only when the master device has its SS pin pulled low. Setting the MODF bit affects the internal serial peripheral interface system in the following ways: 1. An SPI interrupt is generated if SPIE = 1 2. The SPE bit is cleared. This disables the SPI. 3. The MSTR bit is cleared, thus forcing the device into the slave mode. Clearing the MODF bit is accomplished by reading the SPSR (with MODF set), followed by awrite to the SPCR. Control bits SPE and MSTR maybe restored to their original set state after the MODF bit has been cleared. The MODF bit is cleared by reset. Bit 3-0 These bits are not implemented and read as zeros. 7 6 5 4 3 2 1 0 |--------------------------------------------------| | SERIAL PERIPHERAL DATA I/O REGISTER | $B02A SPDR |--------------------------------------------------| The serial peripheral data I/O register is used to transmit and receive data on the serial bus. Only a write to this register will initiate transmission/reception of another byte and this will only occur in the master device. At the completion of transmitting a byte of data, the SPIF status bit is set in both the master and slave devices. When the user reads the serial peripheral data I/O register, a buffer is actually being read. The first SPIF must be cleared by the time a second transfer of data from the shift register to the read buffer is initiated or an overrun condition will exist. A write to the serial peripheral data I/O register is not buffered and places data directly into the shift register for transmission. A full-duplex asynchronous Serial Communications Interface (SCI) is provided with a standard NRZ format (one start bit, eight or nine data bits and one stop bit) and a variety of baud rates. The SCI transmitter and receiver are functionally independent, but use the same data format and bit rate. "Baud" and "bit rate" are used synonymously in the following description. Receive data (RxD) or transmit data (TxD) is the serial data which is transfered to the internal data bus from the input pin (RxD) and from the internal bus to the output pin (TxD). The user has option bits in serial communications control register 1 (SCCR1) to determine the "wake-up" method (WAKE bit) and data word length (M bit) of the SCI. Serial communications control register 2 (SCCR2) provides control bits which individually enable/disable the transmitter or receiver (TE and RE, respectively) enable system interrupts (TIE, TCIE, ILIE) and provide the wake-up enable bit (RWU) and the send break code bit (SBK). The baud rate register bits allow the user to select different baud rates which may be used as the rate control for the transmitter and receiver. Data transmission is initiated by a write to serial communications data register (SCDR). Provided the transmitter is enabled, data stored in the SCDR is transferred to the transmit serial shift register. This transfer of data sets the TDRE bit of the SCI status register (SCSR) and may generate an interrupt if the transmit interrupt is enabled. The transfer of data to the transmit shift register is synchronized with the bit rate clock. All data is transmitted bit zero first. Upon completion of data transmission, the TC (transmission complete) bit of the SCSR is set (provided no pending data, preamble or break is to be sent) and an interrupt may be generated if the transmit complete interrupt is enabled. If the transmitter is disabled and the data, preamble or break (in the transmit shift register) has been sent, the TC bit will also be set. This will also generate an interrupt is the TCIE bit is set. When the SCDR is read, it contains the last data byte received, provided that the receiver is enabled. The RDRF bit of the SCSR is set to indicate that a data byte has been transfered from the input serial shift register to the SCDR, which can cause an interrupt if the receiver interrupt is enabled. The data transfer from the input serial shift register to the SCDR is synchronized by the receiver bit rate clock. The OR (overrun), NF (noise), or FE (framing) error bits of the SCSR may be set if data reception errors occured. An idle line interrupt is generated if the idle line interrupt is enabled and the IDLE bit (which detects idle line transmission) of SCSR is set. This allows a receiver that is not in the wake-up mode to detect the end of a message, the preamble of a new message or to resynchronize with the transmitter. The baud rate register, BAUD, provides the means for selecting different baud rates which may be used as the rate control for the transmitter and receiver. The SCP0-SCP1 bits function as a prescaler for the SCR0-SCR2 bits. Together, these five bits provide multiple baud rate combinations for a given crystal frequency. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | - | - | SCP1| SCP0| - | SCR2| SCR1| SCR0| $B02B BAUD |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7-6 These two bits are not implemented. Bit 5 SCP1,SCP0 Table below shows the prescale values attained from the E clock. Reset clears SCP1-SCP0 bits (divide-by-one). |------|------|--------------------| | | | Internal Processor | | SCP1 | SCP0 | Clock Divide By | |------|------|--------------------| | 0 | 0 | 1 | | 0 | 1 | 3 | | 1 | 0 | 4 | | 1 | 1 | 13 | |------|------|--------------------| Bit 3 Not implemented. Bit 2-0 SCR2 SCR1 SCR0 These three bits select the baud rate of both the transmitter and the receiver. Table below shows the prescaler value that divides the output of the first stage. Reset does not affect the SCR2-SCR0. |------|------|------|------------------| | | | | Prescaler Output | | SCR2 | SCR1 | SCR0 | Divide By | |------|------|------|------------------| | 0 | 0 | 0 | 1 | | 0 | 0 | 1 | 2 | | 0 | 1 | 0 | 4 | | 0 | 1 | 1 | 8 | | 1 | 0 | 0 | 16 | | 1 | 0 | 1 | 32 | | 1 | 1 | 0 | 64 | | 1 | 1 | 1 | 128 | |------|------|------|------------------| Note that there is a fixed rate divide-by-16 between the receive clock (RT) and the transmit clock (Tx). The actual divider chain is controlled by the combined SCP0-SCP1 and SCR0-SCR2 bits in the baud rate register as illustrated. |-----|----|----------------------------------------------------- --------------| | SCP |CLK*| | | Bit | Dvd| Crystal Frequency (MHz) | |-----| By |-------------|-------------|------------|-------------|--------- ---| | 0 1 | | 8.3886 | 8.0 | 4.9152 | 4.0 | 3.6864 | |-----|----|-------------|-------------|------------|------------ -|------------| | 0 0 | 1 |131.072 KBaud|125.000 KBaud| 76.80 KBaud| 62.50 KBaud| 57.60 KBaud| | 0 1 | 3 | 43.690 KBaud| 41.666 KBaud| 25.60 KBaud| 20.833 KBaud| 19.20 KBaud| | 1 0 | 4 | 32.768 KBaud| 31.250 KBaud| 19.20 KBaud| 15.625 KBaud| 14.40 KBaud| | 1 1 | 13 | 10.082 KBaud| 9600 Baud| 5.907 KBaud| 4800 Baud| 4430 Baud| |-----|----|-------------|-------------|------------|------------ -|------------| * The clock in the "Clock Divided By" column is in theinternal processor clock. Note: The divided frequencies shown above represent baud rates which are the highest transmit baud rate (Tx) that can be obtained by a specific crystal frequency and only using the prescaler division. Lower baud rates may be obtained by providing a further division using the SCI rate select bits as shown on Table for some representative prescaler outputs. |-------|-------|------------------------------------------------ ------------| | SCP | | | | Bit | CLK* | Crystal Frequency (MHz) | |-------|Divided|-------------|------------|-----------|--------- --|---------| | 2 1 0 | By |131.072 KBaud|32.768 KBaud|76.80 KBaud|19.20 KBaud|9600 Baud| |-------|-------|-------------|------------|-----------|--------- --|---------| | 0 0 0 | 1 |131.072 KBaud|32.768 KBaud|76.80 KBaud|19.20 KBaud|9600 Baud| | 0 0 1 | 2 | 65.536 KBaud|16.384 KBaud|38.40 KBaud| 9600 Baud|4800 Baud| | 0 1 0 | 4 | 32.768 KBaud| 8.192 KBaud|19.20 KBaud| 4800 Baud|2400 Baud| | 0 1 1 | 8 | 16.384 KBaud| 4.096 KBaud| 9600 Baud| 2400 Baud|1200 Baud| | 1 0 0 | 16 | 8.191 Kbaud| 2.048 KBaud| 4800 Baud| 1200 Baud| 600 Baud| | 1 0 1 | 32 | 4.096 KBaud| 1.024 KBaud| 2400 Baud| 600 Baud| 300 Baud| | 1 1 0 | 64 | 2.048 KBaud| 512 Baud| 1200 Baud| 300 Baud| 150 Baud| | 1 1 1 | 128 | 1.024 KBaud| 256 Baud| 900 Baud| 150 Baud| 75 Baud| |-------|-------|-------------|------------|-----------|--------- --|---------| Note: This illustrates how the SCI select bits can be used to provide lower transmitter baud rates by further dividing the prescaler output frequency. The five examples are only representative samples. In all cases, the baud rates shown are transmit baud rates (transmit clock) and the receiver clock is 16 times higher in frequency than the actual baud rate. The Serial Communications Control Register 1, SCCR1, provides the control bits which: 1. determine the word length and 2. selects the method used for the wake-up feature B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | R8 | T8 | - | M | WAKE| - | - | - | $B02C SCCR1 |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 R8 If the M bit is set, then this bit provides a storage location for the ninth bit in the receive data word. Reset does not affect this bit. Bit 6 T8 If the M bit is set, then this bit provides a storage location for the ninth bit in the transmit data word. Reset does not affect this bit. Bit 5 This bit is not implemented and reads as zero Bit 4 M This bit selects the word length. Reset clears this bit. 0 = 1 start bit, 8 data bits, 1 stop bit 1 = 1 start bit, 9 data bits, 1 stop bit Bit 3 WAKE This bit allows the user to select the method for receiver "wake-up". When clear, an idle line condition (10 consecutive ones if M=0 or 11 consecutive ones if M=1) will wake-up the receiver. When set, detection of a one in last data bit (eight data bit if M=0, ninth data bit if M=1) will wake-up the receiver. Bit 2-0 These bits are not implemented and read as zeros. The serial communications control register 2, SCCR2, provides control bits which individually enable/disable the SCI functions. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | TIE | TCIE| RIE | ILIE| TE | RE | RWU | SBK | $B02D SCCR2 |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 TIE When the transmit interrupt enable bit is set, the SCI interrupt occurs when TDRE is set. When TIE is clear, the TDRE interrupt is disabled. Cleared by reset. Bit 6 TCIE When the transmission complete interrupt enable bit is set, the SCI interrupt occurs when TC is set. When TCIE is clear, the TC interrupt is disabled. Cleared by reset. Bit 5 RIE When the receive interrupt enable bit is set, the SCI interrupt occurs when OR or RDRF are set. When RIE is clear, the OR and RDRF interrupts are disabled. Cleared by reset. Bit 4 ILIE When the idle line interrupt enable bit is set, the SCI interrupt occurs when IDLE is set. When ILIE is clear, the IDLE interrupt is disabled. Cleared by reset. Bit 3 TE When the transmit enable bit is set, the transmit shift register output is applied to the TxD line. Depending on the state of control bit M (SCCR), a preamble of 10 (M=0) or 11 (M=1) consecutive ones is transmitted when software sets the TE bit from a cleared state. After loading the last byte in the serial communications data register and receiving the interrupt from TDRE, the user can clear TE. Transmission of the last byte will then be completed before the transmitter gives up control of the TxD pin. Cleared by reset. Bit 2 RE When the receive enable bit is set, the receiver is enabled. When RE is clear, the receiver is disabled and all of the status bits associated with the receiver (RDRF, IDLE, OR, NF and FE) are inhibited. Cleared by reset. Bit 1 RWU When the receiver wake-up bit is set, it enables the "wake-up" function. If the WAKE bit is cleared, RWU is cleared after receiving 10 (M=0) or 11 (M=1) consecutive ones. If the WAKE bit is set, RWU is cleared after receiving a data word whose MSB is set. Cleared by reset. Bit 0 SBK If the send break bit is toggled set and cleared, the transmitter sends 10 (M=0) or 11 (M=1) zeros and then reverts to idle or sending data. If SBK remains set, the transmitter will continually send whole blocks (sets of 10 or 11) zeros until cleared. At the completion of the break code, the transmitter sends at least one high bit to guarantee recognition of a valid start bit. Reset clears the SBK bit. The serial communications status register, SCSR, provides inputs to the interrupt logic circuits for generation of the SCI system interrupt. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | TDRE| TC | RDRF| IDLE| OR | NF | FE | - | $B02E SCSR |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 TDRE The transmit data register empty bit is set to indicate that the content of of the serial communications data register have been transferred to the transmit serial shift register. This bit is cleared by reading the SCSR (with TDRE=1) followed by a write to the SCDR. Reset sets the TDRE bit. Bit 6 TC The transmit complete bit is set at the end of a data frame, preamble, or break condition if: 1. TE= 1, TDRE = 1 and no pending data, preamble or break is to be transmitted; or 2. TE = 0 and the data, preamble, or break (in the transmit shift register) has been transmitted. The TC bit is a status flag which indicates that one of the above conditions have occured. The TC bit is cleared by reading the SCSR (with TC set) followed by a write to the SCDR. Reset sets the TC bit. Bit 5 RDRF The receive data register full bit is set when the receiver serial shift register is transferred to the SCDR. The RDRF bit is cleared when the SCSR is read (with RDRF set) followed by a read of the SCDR. Reset clears the RDRF bit. Bit 4 IDLE The idle line detect bit, when set, indicates a receiver idle line is selected. The IDLE bit is cleared by reading the SCSR with IDLE set followed by a read of the SCDR. The IDLE bit is inhibited when the RWU bit is set. Reset clears the IDLE bit. Bit 3 OR The overrun bit is set when the next byte is ready to be transferred from the receive shift register to the SCDR which is already full (RDRF bit is set). The only valid data is located in SCDR when OR is set. The OR bit is cleared when the SCSR is read (with OR set), followed by a read of the SCDR. Reset clears the OR bit. Bit 2 NF The noise flag bit is set if there is noise on any of the received bits, including the start and stop bits. The NF bit is not set until the RDRF flag is set. The NF bit is cleared when the SCSR is read (with NF set), followed by a read of the SCDR. Reset clears the NF bit. Bit 1 FE The framing error bit is set when no stop bit was detected in the data string received. The FE bit is set at the same time as the RDRF is set. If the byte received causes both framing and overrun errors, the processor will only recognize the overrun error. The framing error flag inhibits further transfer of data into SCDR until it is cleared. The FE bit is cleared when the SCSR is read (with FE=1) followed by a read of the SCDR. Reset clears the FE bit. Bit 0 Not implemented. Reads as zero. The serial communications data register, SCDR, performs two functions, i.e., it acts as the receive data register when it is read and as the transmit data register when it is written. B7 B6 B5 B4 B3 B2 B1 B0 |------------------------------------------------| | SERIAL COMMUNICATIONS DATA REGISTER | $B02F SCDR |------------------------------------------------| ADCTL $B030 ADR1 $B031 ADR2 $B032 ADR3 $B033 ADR4 $B034 The 68HC11 includes an 8-channel multiplexed-input successive approximation analog-to-digital (A/D) converter with sample and hold to minimize conversion errors caused by rapidly changing input signals. Two dedicated pins (VRL, VRH) are provided for the reference supply voltage inputs. These pins may be connected to a lower noise power supply to assure full accuracy of the A/D conversion. The 8-bit A/D converter has a linearity error of 1/2 LSB and accepts analog inputs which range from VRL to VRH. Smaller analog input ranges can also be obtained by adjusting VRH and VRL to the desired upper and lower limits. Each conversion is accomplished in 32 MCU E clock cycles, provided the E rate is equal to or greater than 1 MHz. For systems which operate at clock rates less than 1.0 MHz, an internal R-C oscillator must be used to clock the A/D system by setting the CSEL bit in the OPTION register. All bits in the ADCTL register may be read or written, except bit 7 which is a read-only status indicator and bit 6 which always reads as zero. Bit 7 is cleared at reset but the other bits are not affected by reset. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | CCF | - | SCAN| MULT| CD | CC | CB | CA | $B030 ADCTL |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 CCF Conversion Complete Flag. This read-only status indicator is set when all four A/D result registers contain valid conversion results. Each time the ADCTL register is written, this bit is automatically cleared to zero and a conversion sequence is started. In the continuous modes, conversions continue in a round-robin fashion and the result registers continue to be updated with current data even though the CCF bit remains set. Note: The user must write to register ADCTL to initiate conversion. Bit 6 Not implemented. Reads as zero. Bit 5 SCAN Continuous Scan Control. When this control bit is cleared, the four requested conversions are performed once to fill the four result registers. When this control bit is set, conversions continue in a round-robin fashion with the result registers being updated as data becomes available. Bit 4 MULT Multi-Channel/Single Channel Control. When this bit is cleared, the A/D system is configured to perform four consecutive conversions on the single channel specified by the four channel select bits CD through CA (bits 3-0 of ADCTL). When this bit is set, the A/D system is configured to perform a conversion on each of four channels where each result register corresponds to one channel. Bit 3-0 CD CC CB CA Channel Select D, Channel Select C, Channel Select B, Channel Select A. Bits 3 through 0 are used to select one of 16 A/D channels. When a multiple channel mode is selected (MULT = 1), the two least-significant select bits (CB and CA) have no meaning and the CD and CC bits specify which group of four channels to be converted. The signals selected by the four channel select control bits are shown in the table below. |----|----|----|----|----------------|----------------| | | | | | | Result in ADRx | | CD | CC | CB | CA | Channel Signal | if MULT=1 | |----|----|----|----|----------------|----------------| | 0 | 0 | 0 | 0 | AN0 | ADR1 | | 0 | 0 | 0 | 1 | AN1 | ADR2 | | 0 | 0 | 1 | 0 | AN2 | ADR3 | | 0 | 0 | 1 | 1 | AN3 | ADR4 | |----|----|----|----|----------------|----------------| | 0 | 1 | 0 | 0 | AN4* | ADR1 | | 0 | 1 | 0 | 1 | AN5* | ADR2 | | 0 | 1 | 1 | 0 | AN6* | ADR3 | | 0 | 1 | 1 | 1 | AN7* | ADR4 | |----|----|----|----|----------------|----------------| | 1 | 0 | 0 | 0 | RESERVED | ADR1 | | 1 | 0 | 0 | 1 | RESERVED | ADR2 | | 1 | 0 | 1 | 0 | RESERVED | ADR3 | | 1 | 0 | 1 | 1 | RESERVED | ADR4 | |----|----|----|----|----------------|----------------| | 1 | 1 | 0 | 0 | VRH Pin | ADR1 | | 1 | 1 | 0 | 1 | VRL Pin | ADR2 | | 1 | 1 | 1 | 0 | (VRH)/2 | ADR3 | | 1 | 1 | 1 | 1 | RESERVED | ADR4 | |----|----|----|----|----------------|----------------| There are two variations of single-channel operation. In the first variation (SCAN=0), the single-selected channel is converted four consecutive times with the first result being stored in the ADR4 register/ After the fourth conversion is complete, all conversion activity is halted until a new conversion command is written to the ADCTL control register. In the second variation (SCAN=1), conversions continue to be performed on the selected channel with the fifth conversion being stored to the ADR1 register (overwriting the first conversion result), the sixth conversion overwrites ADR2, and so on continuously. There are two variations in multiple-channel operation. In the first variation (SCAN=0), the selected group of four channels are converted, one each each, with the first result being stored in the ADR1 result register and the fourth result being stored to the ADR4 register. After the fourth conversion is complete, all conversion activity is halted until a new conversion command is written to the ADCTL control register. In the second variation (SCAN=1), conversions continue to be performed on the selected group of channels with the fifth conversion being stored in the ADR1 register (replacing the earlier conversion result for the first channel in the group), the sixth conversion overwrites ADR2, and so on continuously. The A/D result registers are read-only registers used to hold an 8-bit conversion result. Writes to these registers have no effect. Data in the A/D result registers is not valid unless the CCF flag bit in ADTCL is set, indicating conversion complete. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit 7| - | - | - | - | - | - |Bit 0| $B031 ADR1 |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit 7| - | - | - | - | - | - |Bit 0| $B032 ADR2 |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit 7| - | - | - | - | - | - |Bit 0| $B033 ADR3 |-----|-----|-----|-----|-----|-----|-----|-----| B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit 7| - | - | - | - | - | - |Bit 0| $B034 ADR4 |-----|-----|-----|-----|-----|-----|-----|-----| The next four locations at $B035 through $B038 are reserved and have no function currently. OPTION $B039 COPRST $B03A PPROG $B03B HPRIO $B03C INIT $B03D TEST1 $B03E CONFIG $B03F The Configuration Options Register (OPTION) is a special purpose 8-bit register that is used (optionally) during initialization to configure internal system configuration options. With the exception of bits 7, 6 and 3 (ADPU, CSEL and CME) which may be read or written at any time, this register may be written to only once after a reset and thereafter is a read-only register. If no write is performed to this location within 64 E-clock cycles after reset, then bits 5, 4, 1 and 0 (IRQ, DLY, CR1 and CR0) will become read-only to minimize the possibility of any accidental changes to the system configuration. While in special test modes, the protection mechanism on this register is overridden and all bits in the OPTION register may be written. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | ADPU| CSEL| IRQE| DLY | CME | - | CR1 | CR0 | $B039 OPTION |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 ADPU A/D Powerup. This bit is cleared by reset and controls operation of the on-chip analog-to-digital converter. When ADPU is clear, the A/D system is powered down and conversion requests will not return meaningful information. To use the A/D system, this bit should be set. Bit 6 CSEL A/D Clock Source Select. This bit is cleared by reset and determines the clocking source for the on-chip A/D. When this bit is zero, the MCU E clock drives the A/D system. When CSEL is one, an on-chip R-C oscillator is enabled and clocks the A/D system at about 1.5 MHz rate. When running with an E clock less than 1 MHz, CSEL must be high to program or erase the EEPROM. Bit 5 IRQE IRQ Edge/Level Sensitive. This read/write bit is cleared at reset. When it is clear, the IRQ pin is configured for level sensitive wired-OR operation (low level) and when it is set, the IRQ is configured for edge-only sensitivity (falling edges) on the IRQ pin. Bit 4 DLY STOP Exit Turn-On Delay. This bit may only be written under special circumstances as described above. This bit is set to one during reset and controls whether or not a relatively long turn-on delay will be imposed before processing can resume after a STOP period. If an external clock source is supplied this delay can be inhibited so that processing can resume within a few cycles of a wake up from STOP mode. When DLY is a one, delay is imposed to allow oscillator stabilization and when DLY is a zero, this delay is bypassed. Bit 3 CME Clock Monitor Enable. This control bit may be read or written at any time and controls whether or not the internal clock monitor circuit will trigger a reset sequence when a slow or absent system clock is detected. When it is clear, the clock monitor circuit is disabled and when it is set, the clock monitor circuit is enabled. Systems operating at or below 200 KHz should not use the clock monitor function. Reset clears the CME bit. Bit 2 Not implemented and reads as a logic zero. Bit 1-0 CR1-CR0 COP Timer Rate Selects. |----------------------------------------------------------| | | | Xtal = | Xtal = | Xtal = | | C C | E/215 | 223 | 8.0 Mhz | 4.0 Mhz | | R R |Dvd'ed | Timeout | Timeout | Timeout | | 1 0 | by | -0/ +15.6 ms | -0/ +15.6 ms | -0/ +15.6 ms | |----------------------------------------------------------| | 0 0 | 1 | 15.625 ms | 16.384 ms | 32.768 ms | | 0 1 | 4 | 62.5 ms | 65.536 ms | 131.07 ms | | 1 0 | 8 | 250 ms | 262.14 ms | 524.29 ms | | 1 1 | 16 | 1 s | 1.049 s | 2.1 s | |----------------------------------------------------------| | E = | 2.1 Mhz | 2.0 Mhz | 1.0 Mhz | |----------------------------------------------------| The clock monitor function is enabled by the CME control bit in the OPTION register. When CME is zero, the function is disabled and when CME is a one, the clock monitor function detects the absence of an E clock for more than a certain period of time. The timeout period is dependent on processing parameters and will be between 5 and 100 microseconds. This means that an E-clock rate of 200 KHz or more will never cause a clock monitor failure and an E-clock rate of 10 KHz or less will definitely cause a clock monitor failure. This implies that systems operating near or below an E-clock rate of 200 KHz should not use the clock monitor function. Upon detection of a slow or absent clock, the clock monitor circuit (if enabled by CME=1) will cause a system reset to be generated. This reset is issued to the external system via the bidirectional RESET pin. Special considerations are needed when using a STOP function and clock monitor in the same system. Since the STOP function causes the clocks to be halted, the clock monitor function will generate a reset sequence if it is enabled at the time the STOP mode is entered. The 68HC11 includes 512 bytes of EEPROM located in the area $B600 through $B7FF which has the same read cycle time as the internal ROM. PPROG Register (EEPROM Programming Control) register is used to control programming and erasure of the 512-byte internal EEPROM. Reset clears this register to $00 so EEPROM is configured so EEPROM is configured for normal reads. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | ODD | EVEN| - | BYTE| ROW |ERASE|EELAT|EEPGM| $B03B |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 ODD Used to Program Odd Rows (TEST) Bit 6 EVEN Used to Program Even Rows (TEST) Bit 5 - Not Implemented Bit 4 BYTE Used for Erasing Bytes - Overrides Bit 3 0 = Row or Bulk Erase 1 = Erase Only One Byte Bit 3 ROW Used for Row Erasing 0 = Bulk Erase 1 = Row Erase Bit 2 ERASE Enables the Erase 0 = Normal Read or Program 1 = Erase Mode Bit 1 EELAT EEPROM Latch Control 0=EEPROM Address and Data configured for Read 1=EEPROM Address and Data configured for Programming Bit 0 EEPGM Program Command 0 = Switched Off 1 = Turned On The operating modes for the 512-byte EEPROM are as follows: NORMAL READ - In this mode, the ERASE bit in the PPROG register must be clear (not programming mode). While these two bits are cleared, the ROW and EEPGM bits in the OPTION register have no meaning or effect, and the 512-byte EEPROM may be read as if it were a normal ROM. PROGRAMMING - During EEPROM programming, the ROW bit is not used. If the E clock frequency is less than 1 MHz the CSEL bit in the OPTION register must be set. Normal sequence of events in programming the EEPROM : 1) Write xxxx x010 to the PPROG register. This specifies program normal mode (ERASE bit=0), address/data buses configured to latch address and data information (EELAT bit=1), and erase voltage turned off (EEPGM bit=0). 2) Write data to be programmed to the desired EEPROM address. This write causes the address and data to be latched in a parallel internal latch. 3) Write EEPGM bit to one (xxxx x011). This couples the EEPROM programming supply voltage to the EEPROM array, to program the specified data into the specified data address in EEPROM. 4) Delay for 10 milliseconds. 5) Write xxxx x010 to the PPROG register to turn off the programming voltage. 6) Repeat steps 2 through 5 until all desired locations have been programmed. 7) Write EELAT bit back to zero to allow the programmed data to be verified. ERASE - If the E clock frequency is less than 1 MHz, the CSEL bit in the OPTION register must be set when erasing the EEPROM. Three erase modes of EEPROM: 1) full 512-byte simultaneous "bulk" erase 2) "row" erase where only one row (16 bytes) is erased at a time and 3) "byte" erase where a single specified byte is erased. NOTE The erased state of all EEPROM cell is logic one. On early parts, byte and row erase are not implemented. Normal procedures for erasure of the entire EEPROM: 1) Write xxxx 0110 to the PPROG register. This specifies the "all" erase mode (ROW bit=0), erase mode (ERASE bit=1), EEPROM configured for address/data latching (EELAT bit=1), and erase voltage turned off (EEPGM bit=0). 1a) A write must be done to any EEPROM address after Step 1. 1b) Optionally, if the CONFIG register is also to be erased, a write to the address ofthe CONFIG register must be performed after "bulk" erase was specified by the write, in step 1 above, and before programming voltage is turned on in step 2 below. In the case of erasure, the data involved in this write operation is unimportant and the write is needed only for the addressing information it provides. 2) Write xxxx 0111 to the PPROG register toturn on the the erase voltage to the EEPROM array. 3) Wait for 10 milliseconds to allow the erasure to complete. 4) Write xxxx 0110 to the PPROG register to turn off the erase voltage. 5) Write xxxx 0000 to the PPROG register to return the EEPROM to the normal read configuration. Normal procedure for erasure of a row of EEPROM: 1) Write xxxx 1110 to the PPROG register. This specifies the "row" erase mode (ROW bit=1), erase mode (ERASE bit=1), address/data buses configured to latch row address information (EELAT bit =1), and erase voltage turned of (EEPGM=0). 2) Write to an address in the EEPROM row to be erased (each row is 16 bytes). This latches the row addressing information for the row to be erased. 3) Write xxxx 1111 to the PPROG register to turn on the erase voltage to the EEPROM array. 4) Wait for 10 milliseconds to allow the erasure to complete. 5) Write xxxx 1110 to the PPROG register to turn off the erase voltage. 6) Write xxxx 0000 to the PPROG register to return the EEPROM to the normal read configuration. Normal procedure for erasure of a single byte of EEPROM: 1) Write xxx1 x110 to the PPROG register. This specifies the byte erase mode (BYTE=1; ROW=x), erase mode (ERASE bit=1), address/data buses configured to latch address information (EELAT bit=1), and erase voltage turned off (EEPGM bit=0). 2) Write to the address in the EEPROM to be erased (data is ignored). This latches the address of the byte to be erased. 3) Write xxx1 x111 to the PPROG register. This turns on the erase voltage to the EEPROM array. EEPGM was not changed to one in the same write operation as the write that configured ROW, ERASE, and EELAT because of the possibility of enabling the erase voltage before the erase mode specification was stable. 4) Wait for 10 milliseconds to allow the erasure to complete. 5) Write xxx1 x110 to the PPROG register to turn off the erasure voltage. 6) Write xxx 0000 to the PPROG register to return the EEPROM to the normal read configuration. The COPRST Register is used to reset the watch dog timer. The sequence required to accomplish this is : 1) write $55 to the CORPST register at $B03A, followed by 2) write $AA to the same address. Both writes must occur in correct order prior to timeout but,any number of instructions may be executed between the writes. The elapsed time between adjacent software reset sequences must never be greater than the COP timeout period. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |Bit 7|Bit 6|Bit 5|Bit 4|Bit 3|Bit 2|Bit 1|Bit 0| $B03A COPRST |-----|-----|-----|-----|-----|-----|-----|-----| The HPRIO register is used to select one of the I bit related interrupt sources to be elevated to the highest I bit masked position in the priority resolution circuit. In addition, four miscellaneous system control bits are included in this register. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| |RBOOT| SMOD| MDA | IRV |PSEL3|PSEL2|PSEL1|PSEL0| $B03C HPRIO |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7 RBOOT The read bootstrap ROM bit only has meaning when the SMOD bit is a logic one (special bootstrap mode or special test mode). At all times, this bit reverts to its logic zero disabled state and may not be written. When set, upon reset in bootstrap mode only, the small bootstrap loader program is enabled. When clear, by reset in the other three modes, this ROM is disabled and accesses to this area are treated as external accesses. Bit 6 SMOD The special mode write-only bit reflects the status of the MODB input pin at the rising edge of reset. It is set if the MODB pin is at or above 1.8 times VDD volts during reset. Otherwise, it is cleared or under software control from the special modes. Bit 5 MDA The mode select A bit reflects the status of the MODA input pin at the rising edge of reset. While the SMOD bit is a logic one (special test or special bootstrap mode in effect), the MDA bit may be written, thus, changing the operating mode of the MCU. When the SMOD bit is a logic zero, the MODA bit is a read-only bit and the operating mode cannot be changed without going through a reset sequence. The table below summarizes the relationship between the SMOD and MDA bits and the MODB and MODA input pins at the rising edge of reset. |-------------|-------------------------------|------------| | | | Latched at | | Inputs | | Reset | | | Mode Description | | |------|------| |------|-----| | MODA | MODB | | SMOD | MDA | |------|------|-------------------------------|------|-----| | 0 | 1 | Single Chip (Mode 0) | 0 | 0 | | 1 | 1 | Expanded Multiplexed (Mode 1) | 0 | 1 | |------|------|-------------------------------|------|-----| | 0 | * | Special Bootstrap | 1 | 0 | | 1 | * | Special Test | 1 | 1 | |------|------|-------------------------------|------|-----| 1 = logic high 0 = logic low * = 1.8 * = 1.8 times VDD(or higher) Bit 4 IRV The internal read visibility bit is used in the special modes (SMOD=1) to affect visibility of internal reads on the expansion data bus. IRV is writable only if SMOD=1 and returns to zero of SMOD=0. If the bit is zero, visibility of internal reads are blocked. If the bit is one, internal reads are visible on the external bus. Bit 3-0 PSEL3,PSEL2,PSEL1,PSEL0 These four select bits are used to specify one I bit related interrupt source which becomes the highest priority I bit related source. |-----|-----|-----|-----|------------------------------------| |PSEL3|PSEL2|PSEL1|PSEL0| Interrupt Source Promoted | |-----|-----|-----|-----|------------------------------------| | 0 | 0 | 0 | 0 | Timer Overflow | | 0 | 0 | 0 | 1 | Pulse Accumulator Overflow | | 0 | 0 | 1 | 0 | Pulse Accumulator Input Edge | | 0 | 0 | 1 | 1 | SPI Serial Transfer Complete | |-----|-----|-----|-----|------------------------------------| | 0 | 1 | 0 | 0 | SCI Serial System | | 0 | 1 | 0 | 1 | Reserved (Default to IRQ) | | 0 | 1 | 1 | 0 | IRQ (External Pin or Parallel I/O) | | 0 | 1 | 1 | 1 | Real Time Interrupt | |-----|-----|-----|-----|------------------------------------| | 1 | 0 | 0 | 0 | Timer Input Capture 1 | | 1 | 0 | 0 | 1 | Timer Input Capture 2 | | 1 | 0 | 1 | 0 | Timer Input Capture 3 | | 1 | 0 | 1 | 1 | Timer Output Compare 1 | |-----|-----|-----|-----|------------------------------------| | 1 | 1 | 0 | 0 | Timer Output Compare 2 | | 1 | 1 | 0 | 1 | Timer Output Compare 3 | | 1 | 1 | 1 | 0 | Timer Output Compare 4 | | 1 | 1 | 1 | 1 | Timer Output Compare 5 | |-----|-----|-----|-----|------------------------------------| Note: During reset, PSEL3, PSEL2, PSEL1 and PSEL0 are initialized to 0:1:0:1 which corresponds to "Reserved (default to IRQ)" being the highest priority I bit related interrupt source. Interrupts in the 68HC11 obey a fixed hardware priority circuit to resolve simultaneous requests; however, one I bit related interrupt source may be elevated to the highest I bit priority position in the resolution circuit. The first six interrupt sources are not masked by the I bit in the condition code register and have the fixed priority interrupt relatioship of: reset, clock monitor fail, COP fail, illegal opcode and XIRQ. (SWI is actually an instruction and has highest priority other than reset in the sense that once the SWI opcode is fetched no other interrupt can be honored until the SWI vector has been fetched). Each of these sources is an input to the priority resolution circuit. The highest I bit masked priority input to the resolution circuit is assigned under software control (of the HPRIO register) to be connected to any one of the remaining I bit related interrupt sources. In order to avoid timing races, the HPRIO register may only be written while the I bit related interrupts are inhibited (I bit in condition code register is a logic one). An interrupt that is assigned to this high priority position is still subject to masking by any associated control bits or the I bit in the condition code register. The interrupt vector address is not affected by assigning a source to this higher priority position. The INIT Register is special purpose 8-bit register is used (optionally) during initialization to change the default locations of RAM and internal registers in the MCU memory map. It may be written to only once within the initial 64 E cycles after a reset and thereafter becomes a read-only register. B7 B6 85 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | RAM3| RAM2| RAM1| RAM0| REG3| REG2| REG1| REG0| $B03D INIT |-----|-----|-----|-----|-----|-----|-----|-----| The default starting address for internal RAM is $0000 and the default starting address of the 64 byte internal register space is $1000 (the INIT register is initialized to $01 by reset). The upper four bits of the INIT register specify the starting address for the internal 256 byte RAM and the lower four bits of INIT specify the starting address for the 64 byte internal register space. The four bits reflect the upper nibble od the 16-bit address. The Max-FORTH operating system moves the registers to $B000 at reset for all versions with Revision 2 ($9000 for Rev 0 - 1). The TEST1 Register at $B03E is only available in the test mode, so is not included in this section. The 68HC11 allows an end user to configure the MCU system to his specific requirements through the use of hardwired options such as the mode select pins, semi-permanent EEPROM control bit specification. The CONFIG control register is implemented in EEPROM cells and controls the presence of ROM and EEPROM in the memory map, as well as the COPON COP watchdog system enable. An optional security feature is available intended to allow user protection of data in 68HC11 EEPROM and RAM. B7 B6 B5 B4 B3 B2 B1 B0 |-----|-----|-----|-----|-----|-----|-----|-----| | - | - | - | - |NOSEC|NOCOP|ROMON| EEON| $B03F CONFIG |-----|-----|-----|-----|-----|-----|-----|-----| Bit 7-4 Not implemented. Read as logic zero. Bit 3 NOSEC Security Mode Option Bit. When the security mask option is specified, this bit can be used to enable a software antitheft mechanism. When cleared, this bit forces the MDA mode control bit to zero so that only single-chip modes of operation can be selected. If the bit is cleared when the MCU is reset in the special bootstrap mode, EEPROM and RAM are erased before the boot loading process continues. Bit 2 NOCOP COP System OFF. When this bit is clear, the COP watchdog forced reset function is enabled. When this bit is set, the COP watchdog circuit is disabled. Bit 1 ROMON Enable On-Chip ROM Select Bit. When this bit is clear, the 8K internal ROM is disabled and that memory space becomes externally accessed space. Bit 0 EEON Enable On-Chip EEPROM Select Bit. When this bit is clear, the 512-byte internal EEROM is disabled and that memory space becomes externally accessed space. Since the CONFIG register is implemented with EEPROM cells, special provisions must be made to erase and program this register. The normal EEPROM control bits in the PPROG register are used for this purpose. USING EXTERNAL MEMORY The internal RAM and EEPROM of the 68HC11 is limited. Many applications will require more RAM for program development. In V3.3, using a Terminal Input Buffer longer than 16 characters is also desireable. The following brief listing moves the internal pointers for TIB , and the dictionary to use external memory. The input line is also extended to 80 (decimal) characters. For the sake of autostarting later, it's a good idea to move the dictionary just beyond the first autostart address, at $0404. If the RAM is installed at 0100-1FFF (factory default for single 8K RAM in the NMIX-0021, etc.) the following will accomplish that. HEX 100 TIB ! ( Do not use on V3.5! TIB already moved 50 TIB 2+ ! ( Do not use on V3.5! TIB already moved 404 DP ! In the next example, the memory is located at $C000 (as in the case with the Motorola EVB, and as can be set on the NMIX-0023 boards as well). PAD is moved as well. Other addresses for RAM could be accomodated by changing the listed $Cxxx constants accordingly. HEX C004 1C ! ( TIB MOVE ) 50 1E ! ( C/L CHANGE ) C060 22 ! ( PAD MOVE ) FORGET TASK C080 DP ! ( DICTIONARY MOVE ) Note that the first four locations at $C000 are left unassigned so that an autostart pattern can be placed there ($C000 is a 1K boundary) after the program is complete. If a Battery RAM were used in that socket, the program would be saved through power down. If autostarting is not done, the address of the main routine to be run can be EXECUTE'ed from the terminal, or it can be run by its name if the dictionary pointers are intact. To be able to use the Battery RAM words' heads, the USER area must be battery backed, otherwise, the dictionary pointers must be relinked. If the program is ROM'ed later, it should allow for the locations $C004 through $C080 to become "unwritable". Of course applications that will have one RAM for variables and one RAM that will be later ROM'ed will probably assigned TIB to the low RAM with other variables (see Preparing a Program for ROM) and the Dictionary Pointer to the high RAM. The USER area can also be moved to give more room in the data stack, although, it is not normally necessary to do so. AFTER THE CRASH You may occasionally experience a system crash, from which it is difficult to recover. A simple reset may give you a Max-FORTH Vx.x prompt and a carriage return may even give you an "OK", however, Max-FORTH doesn't seem to understand anything typed in that's over 1 character long. (A no-Max-FORTH-prompt condition probably means an autostart problem or hardware failure not related to the problem described here.) This is usually the result of a blown dictionary link. If the linked list of the dictionary is opened (ie: one of the link fields is erased, written over, badly manipulated, etc.), Max-FORTH will accept your input and then go on a wild goose chase looking for a match with your word all over memory until it finds a $0000 in a link field which indicates "end of dictionary" (which, coincidentally, may never be found). It will either lock up or echo the entry with a question mark. This can be simulated by doing: 0 LATEST PFAPTR LFA ! . You might want to wait a minute before you try this, however, until you know how to recover ... Another problem can be experienced when the dictionary pointer gets out of RAM if, for instance, you did a HEX E000 DP ! (which puts the dictionary pointer in ROM). The problem is that the outer interpreter takes your input line in TIB and parses a word at a time out of it. It moves the parsed word to HERE which is an exceptionally bad idea if DP is in ROM. ROM is funny that way, no matter what you write to it, it never takes it. When the dictionary search compares the dictionary list with the word at HERE , the result has nothing to do with the characters (and number of them) of word you typed in. It prints junk and a question mark. A similar thing can happen if a word is moved to EEPROM with EEWORD and then forgotten. Guess where DP ends up? Putting a bad value in UP can be interesting. Changing UEMIT or UKEY to some erroneous values can have some extremely quiet results, too. If any of the above conditions occur, the only way to recover is to power down and re-power or to force a cold reset. A -G key combination in the Serial Communications Interface input register will force a cold reset. (-G is the ASCII "BELL" character, $07 hex.) By entering the -G and hitting reset again, one should recover from any badly modified variable, blown dictionary links, crashed processor, etc. problems. A bad autostart, however, can only be rectified by disabling the offending memory device. If the autostart pattern is in the part's EEPROM, it may be erased using a Motorola EVM for recovery. The software package WIPE can be run on a PC to erase an internal EEPROM autostart. It works by using the 68HC11's special bootstrap mode to down load an EEPROM altering program into internal RAM. DOWNLOADING SOURCE CODE Development with the Max-FORTH system will normally be done using a host computer. (One alternative would be to add sufficient RAM and use the internal RAMDSK. Another alternative would be hooking up mass storage to the system and writing a user mass storage handler that would replace RAMDSK in the USER variable UR/W. Either method requires you to live with the limited FORTH line editors available or to write your own.) Source code text can be edited on a host PC with a familiar editor. The code can be down loaded and tested a portion at a time using a communications package. This can be continued until the program is complete. PC's are usually graced with printer, etc., so all in all, using a PC as a host can save development time. Any editor that produces an ASCII text file (ie: non-document mode) should be suitable. Communications packages should be able to handle 9600 baud transfers (or you have to run the XTAL slower) and should have file send and capture capabilities. The file send program should have a wait-for-echo'ed-character setting and a wait-at-end-of-line-for-return-character. The character to be waited for at the end of line should be a LINE FEED, ASCII $0A ( -J ). In Microstuff's Crosstalk these settings are the CWait Echo and LWait CHaracter '^J' . With those settings, a smooth down load of a code file by the SEnd command should be possible. Be sure to watch the down load as it occurs to spot any error messages returned from the Max-FORTH system. Unfortunately, communication packages have become more and more complex. Along the way they have lost some of the basic functionality needed to do this simple downloads. SoftKlone's "Mirror II" was an excellent package which rarely showed a glitch downloading in this fashion and had the added advantage of a built-in editor, but has since been taken off the market. The most popular communications package, Procomm does not have an exact match to the needs of this download protocol. It does have a pace character setting for the ^J but can't do both character echo and pace at teh same time. As a result, lines will be occassionally lost during the download. Windows TERMINAL program also has the wait for ^J feature, but often looses lines during download in completely unpredictable moments. To ease development under these changing circumstances, NMI has contracted to have packages written with these download protocols included. While not "fancy" communications packages, they are useful tools for development. The program MAXTALK is available for DOS and NMITERM for Windows. Contact NMI for further details. USING COMPILATION ADDRESSES The hearerless code feature of the Max-FORTH language is not available in many other versions of FORTH, so it is necessary to point ot the significance of the PFAPTR, and how it can affect the use of a word's compilation address in an application program. The use of the Parameter Field Address is common place in Max-FORTH and other FORTH's as well. Max-FORTH's dictionary structure is slightly different because of its PFAPTR, which allows headerless code generation and testing. Words such as ' do not return a PFA, but rather a PFAPTR. The word's PFAPTR is a part of its head. It serves as the connection between a words head -------------------------------------------------------- length : name : link : parameter-field-pointer -------------------------------------------------------- Word's Head Components --------------------------------- code field : parameter field --------------------------------- Word's Code Components and its code. To covert a PFAPTR to the actual PFA of a word, only a @ is required. Some care must be used in a compiled program to be sure the address of the PFAPTR which is in the head is available to be fetched. If the program is taget compiled and the heads discarded, there will be a mysterious error haunting the headerless program. For example: : INITI ' NEW-KEY-RTN @ ( note @ changes PFAPTR to PFA ) UKEY ! ; works fine if the program is not headerless, or if the heads are still in memory. But if the program is headerless, and the program is in ROM and the heads go away with a powerdown, the program will not work at power up. It is suggested the following format be used instead. : INITI [ ' KEW-KEY-RTN @ ] LITERAL UKEY ! ; Note in this situation the [ causes the ' and @ to be executed in the immediate mode. The ] returns to the compile mode and the LITERAL compiles a literal with the value from the stack left by the [ ] . All the indirection involving the head is done at compilation time, rather than at run time. CODE DEFINITIONS Although the 8K versions of Max-FORTH do not have an included assembler, code definitions can still be added. Three key words, CODE , END-CODE and CODE-SUB have been added to facilitate this. CODE is a defining word that creates a head for the name string that follows it. The Code Field of the created word points to its own Parameter Field. This causes control to transfer to the code in the Parameter Field when the word is executed. CODE does not set the compilation mode but does leave security values on the stack for END-CODE , which ends the code definition. Usually, in systems with assemblers, what goes between the CODE and END-CODE, is assembly mnemonics and their parameters. Although there is an ASSEMBLER vocabulary, as required by the Assembler Extension Word Set, there was not enough room for a full assembler, so the vocbulary is empty. Inorder to enter machine code, the code must be hand assembled and placed in the dictionary using , and C, . At the end of the code definition's execution, control must be transfered back to the Max-FORTH system. This will usually be done by a JMP NEXT instruction. Ofcourse, not knowing the address of NEXT can be a big drawback to using machine code definitions. For that very reason, the defining word, CODE-SUB , was added to Max-FORTH. It allows the entry of a machine coded subroutine to be entered as a FORTH definition. Like CODE , CODE-SUB creates a head for its name string, and leaves security for END-CODE . CODE-SUB , however, puts the address of an interpreter in the new definitions Code Field. The interpreter will JSR to the new defintions Parameter Field when it is called, and will JMP NEXT after the called routine returns. The normal way to finish a CODE-SUB definition, is by compiling a RTS and using the standard END-CODE definition termination. The CODE-SUB definition can either be executed by name from high level FORTH or called from a machine code routine by JSR'ing to its Parameter Field. The following example illustrates the creation of a code definition that causes the processor to go into the wait mode. It takes advantage of the previously described CODE-SUB word. CODE-SUB WAIT 3E C, ( WAIT INSTRUCTION ) 39 C, ( RTS ) END-CODE It should be noted certain registers have significance to the virtual FORTH machine and require special treatment in code definitions. The Y register is used for the Data Stack Pointer. It should be left alone for the most part. (Note: the Data Stack grows down in memory.) If something is to be removed from the stack, it should be removed and THEN the Y register should be incremented twice (ie: LDD 0,Y INY INY). If something is to be put on the stack, the Y register should FIRST be decremented twice and then the value should be put on (ie: DEY DEY STD 0,Y). If this order is not observed, the code produced may not be preemptable, and could cause high-level interrupt and multitasking failures. The SP register is used for the FORTH Return Stack Pointer. No values can be taken from, or left on, the machine stack by the end of the definition. While a value can be temporarily pushed on the stack, it must come off before the return to NEXT. The A, B, D, X and CC registers can be used without consequence. Since the address of NEXT varies from version to version and revision to revision, a CODE-SUB is again used in the next example. Using a CODE definition, in the following example, would require providing the address of NEXT for all versions and revisions. Then, if a new revision was released with a different NEXT, this example might not work. Using the CODE-SUB defining word here, assures that this example will be able to return control to FORTH easily in all versions and revisions. The example reads the first four A/D channels and places them on the stack. CODE-SUB READ-A/D-CH0-3 CE C, B030 , ( LDX $B030 ) ( SET ADCTL FOR MULT READINGS, STRT CONV ) 86 C, 10 C, ( LDAA # 10 ) A7 C, 00 C, ( STAA 0,X , $B030 ) ( WAIT UNTIL CCF SET ) ( SPIN ) 1F C, 00 C, 80 C, FC C, ( BRCLR 0,80,SPIN ) 4F C, ( CLRA ) ( TAKE DATA, OPEN STACK, STORE DATA ) E6 C, 01 C, ( LDAB 1,X ) 18 C, 09 C, ( DEY ) 18 C, 09 C, ( DEY ) 18 C, ED C, 00 C, ( STD 0,Y ) E6 C, 02 C, ( LDAB 2,X ) 18 C, 09 C, ( DEY ) 18 C, 09 C, ( DEY ) 18 C, ED C, 00 C, ( STD 0,Y ) E6 C, 03 C, ( LDAB 3,X ) 18 C, 09 C, ( DEY ) 18 C, 09 C, ( DEY ) 18 C, ED C, 00 C, ( STD 0,Y ) E6 C, 04 C, ( LDAB 4,X ) 18 C, 09 C, ( DEY ) 18 C, 09 C, ( DEY ) 18 C, ED C, 00 C, ( STD 0,Y ) 39 C, ( RTS ) END-CODE One other requirement of the Assembler Extension Word Set is the ;CODE word. This word (in conjuction with a newly defined defining word) causes later defined words to use the machine code interpreter following the ;CODE . As an example the following program segment simulates the set up for a two engine monitoring program that uses identically names for both engine's parameters. A variable CHANNEL is used to control a new type variable created by the defining word CHANNEL-VARIABLE . 0 CONSTANT PORT 1 CONSTANT STBD VARIABLE CHANNEL ( VALUE SHOULD BE 0 OR 1 ) : MAKE-CHANNEL-VARIABLE < FF AND ] LITERAL B7EA EEC! ( HI BYTE ) [ ' IRQRTN @ FF AND ] LITERAL B7EB EEC! ( LO BYTE ) CLI ; In this example, ENABLE-IRQ's puts the JMP op-code in the address ($B7E9) pointed to by the External IRQ Pin Vector ($FFF2). It gets the address of the interrupt routine that will handle the IRQ Pin's requests, IRQRTN, and puts it in after the JMP op-code. This is accomplished one byte at a time as follows. First the compilation mode is left. The interrupt routine's name is ticked. This returns its PFAPTR. The PFAPTR is converted to a PFA by the @ . The appropriate high byte or low byte of the result is masked out. The compilation mode is then reentered. The value on the stack is compiled as a literal to be programmed into EEPROM at run time. A routine is then called that clears the Interrupt Disable bit in the Condition Codes Register. The EEPROM has a limited life cycle, usually rated at 10,000 writes. Therefore, a better method of initializing the vectors would only write them if they needed to be changed. This will be shown in the next example. High level interrupts can easily be handled in Max-FORTH. Low level interrupt handlers can be written that call high level interrupts with only 3 or 4 lines of machine code. This is possible because of the inclusion of a subroutine called ATO4 which can start a high level word from machine code. To run a high level word, all that is necessary is to first load the D Register with the Code Field Address of the word to be run, for versions earlier than V3.5, load the Y Register with a pointer to free memory area that can be used as data stack and to then jump subroutine to ATO4 . This routine catches the system after the completion of the called high level word and does an RTS to return to the machine code that called it. Of course, the high level word will probably use the Data and Return Stacks, but since Max-FORTH has been written to be totally preemptable, this should pose no problem, other than the additional depth needed during interrupts. The SP register should not need adjustment. (In many instances, the Y Register would not need to be modified either. Only the FIND routine in Max-FORTH versions earlier than V3.5 uses the Y Register for anything except a very carefully maintained stack pointer. If the foreground program is not using FIND or in other words the outer interpreter, but is instead a dedicated program itself, and the user has not entered any machine coded definitions that tamper with Y's purpose as a data stack pointer, no concern need be paid to Y's contents during interrupt.) There is a built-in constant that returns the address of this special subroutine. To acquire this address simply enter ATO4 . : HI-LEVEL-IRQRTN ( HANDLE EXT PIN IRQ'S ) ( ... ) ( ... ) ( ... ) ; CODE LO-LEVEL-IRQRTN CC C, ' HI-LEVEL-IRQRTN CFA , ( LDD # CFA-OF-HI-LEVEL-IRQRTN ) ( FOLLOWING LINE MAY BE NECESSARY FOR VERSIONS PRIOR TO V3.5 ( 18 C, CE C, XXXX , ( LDY # XXXX, WHERE XXXX = FREE D.S. AREA ) BD C, ATO4 , ( JSR ATO4 ) 3B C, ( RTI ) END-CODE CODE-SUB CLI 0E C, ( CLI ) 39 C, ( RTS ) END-CODE CODE-SUB SEI 0F C, ( SEI ) 39 C, ( RTS ) END-CODE VARIABLE VEC-TABLE -2 ALLOT 7E C, FFFE @ , ( B7BF SCI SER SYS ) 7E C, FFFE @ , ( B7C2 SPI SER ) 7E C, FFFE @ , ( B7C5 PLS ACC OVFL ) 7E C, FFFE @ , ( B7C8 PLS ACC EDGE ) 7E C, FFFE @ , ( B7CB TMR OVERFLOW ) 7E C, FFFE @ , ( B7CE TMR OUT CMP 5 ) 7E C, FFFE @ , ( B7D1 TMR OUT CMP 4 ) 7E C, FFFE @ , ( B7D4 TMR OUT CMP 3 ) 7E C, FFFE @ , ( B7D7 TMR OUT CMP 2 ) 7E C, FFFE @ , ( B7DA TMR OUT CMP 1 ) 7E C, FFFE @ , ( B7DD TMR IN CAP 3 ) 7E C, FFFE @ , ( B7E0 TMR IN CAP 2 ) 7E C, FFFE @ , ( B7E3 TMR IN CAP 1 ) 7E C, FFFE @ , ( B7E6 REAL TIME ) 7E C, LO-LEVEL-IRQRTN @ , ( B7E9 IRQ ) 7E C, FFFE @ , ( B7EC XIRQ ) 7E C, FFFE @ , ( B7EF SWI ) 7E C, FFFE @ , ( B7F2 OP-CODE TRAP ) 7E C, FFFE @ , ( B7F5 COP FAILURE ) 7E C, FFFE @ , ( B7F8 CLK MON ) HERE CONSTANT VEC-TABLE-END : VEC-INIT ( CHECK AND MOVE VECTORS IF NECESSARY ) VEC-TABLE-END VEC-TABLE - 0 ( RANGE ) DO B7BF I + C@ VEC-TABLE I + C@ = NOT IF VEC-TABLE I + C@ B7BF I + ." ." EEC! THEN LOOP ; : ENABLE-IRQ'S VEC-INIT CLI ; AUTOSTARTING All Max-FORTH versions have autostarting capabilities. The autostart capability is the means by which the language or the designated user program is started at power-up or reset. It makes up the better part of the Max-FORTH's operating system. In Version 2.x and greater releases, there are three distinct actions in the autostart sequence. In brief summary, the first autostart attempt allows a machine code routine to alter the INIT, OPTION and TMSK2 registers immediately after reset. The second autostart attempt checks the beginning of EEPROM and then all 1K memory map boundaries for a temporary autostart pattern. The third autostart attempt checks the beginning of EEPROM and all memory map 1K boundaries for a primary autostart pattern. Now each will be discussed in detail. The first autostart occurs within a few cycles after reset. It looks at the EEPROM at $B7FE for an primary autostart pattern, $A55A. If that pattern is found, a JSR to location $B7FB is executed. At that location three empty bytes allow the insertion of a jump instruction. Control can be there by passed to a designated machine code routine. The routine can alter the INIT ( REG 3-0 & RAM 3-0 bits), OPTIONS (IRQE, DLY, CR1 & CR0 bits) and TMSK2 (PR1 & PR0 bits) registers which must be establish in the first 64 clock cycles following reset. Since they can only be written once and only in the 64 cycle period, any settings made in that routine will not be affected by later system initialization action. Normally, the machine code routine will return to the system initialization and autostart functions by performing an RTS. Of course, when the rest of the system initialization is not required, control could be maintained by user machine code programs thereafter. The second autostart attempt checks the beginning of EEPROM, $B600, and then searches all 1K memory map boundaries, starting at location $0400 and continuing through $FC00, for a temporary autostart pattern, $A44A. If the temporary autostart pattern is found at a given location $XX00, the next word location following the autostart pattern, $XX02, is taken to be the CFA of the word to be run. This word could be anywhere in the memory map, although this program will typically be in the memory device positioned at the boundary. The autostarted routine can be a either a high level or code definition. The unique value of this autostart attempt and the temporary autostart pattern is that the autostarted definition need not be an endless loop. It can terminate normally with a ; for high level words or a JMP NEXT for code definitions. When the system turns control over to a temporary autostart word, the IP is set to return control to the third autostart attempt. In this manner, normal termination of a temporary autostart word will cause initiation of the primary autostart search. The third autostart attempt checks the beginning of EEPROM, $B600, and then searches all 1K memory map boundaries, starting at location $0400 and continuing through $FC00, for a primary autostart pattern, $A55A. If the primary autostart pattern is found at a given location $XX00, the next word location following the autostart pattern, $XX02, is taken to be the CFA of the word to be run. This word could be anywhere in the memory map, although this program will typically be in the memory device positioned at the boundary. The autostarted routine can be a either a high level or code definition. The autostarted definition will normally be an endless loop. If it terminates, with a ; for high level words or a JMP NEXT for code definitions, the system again returns control to the beginning of the third autostart attempt. In this case, the same word will be found and autostarted again and again. If no user autostarts are found, however, a primary autostart pattern should be found at $E000, the beginning of the Max-FORTH ROM. If by some circumstance it is not there, the search will begin again at the third step. It will so continue until an autostart pattern is found. This three level autostart system gives a great deal of flexibility to the system user. With no interference, the Max-FORTH operating system will find and run itself. A user program can intercept the primary autostart search by having an autostart pattern at a lower memory location than the Max-FORTH ROM. A specific application to be started and the system thereby dedicated to its operation, instead of the running the Max-FORTH outer interpreter. On the other hand, a user may simply want to modify the normal start up procedure, without taking permanent system initialization responsibilities. The temporary autostart option might allow linking of additional ROM's and command vocabularies into Max-FORTH or even multitasking without interfering with the primary autostart abilities. The temporary autostart option is also useful to modify baud rates, etc., when there is no opportunity to catch the primary autostart by being "lower" in memory (i.e.: primary autostart pattern located at $B600 or $0400). A ROM higher in the memory map can still do its thing and then allow the primary search to find its mark. MOVING THE USER AREA The USER area normally resides in memory from $0006 to $0079. It contains 58 word locations that hold the variables describing how Max-FORTH uses the rest of memory and how it interfaces to the outside world. When a cold reset occurs, the operating system initializes the first 41 words with values needed to start with a cleanly linked system. There are several reasons why it could be advantageous to move the USER area. One might to be to give the data stack more room in low memory. (Ofcourse the dictionary would also have to be completely moved out in this case, too.) Another might be to put the USER area into battery backed RAM, so the operator could modify one location (the UP) to recover the complete dictionary and configuration. As an alternative, the user could create several USER areas, and thereby have several dictionaries or configurations in memory at once, switching back and forth by manipulating of a single variable. The following example creates an second user area at $C000. The easiest way to create a new USER area is to copy the reset initialized RAM area to the new location. The new copy can then be edited to remove all references to its origin. This is done in this example by adding an offset to the existing values in the USER area to accomodate its new location. After the new area is initialized, placing its address in the user area pointer (UP) completes the transfer. Notice in this example the new user has different stack initializtion values as well. Execution of ABORT installs these new stack locations, and breaks the last ties with the original configuration. COLD HEX 0000 C000 100 ( Move copy of system RAM to new area ) CMOVE C000 C00E +! ( Alter R0 for return stack init ) C000 C010 +! ( Alter S0 for data stack init ) C000 C01C +! ( Alter the location of the TIB ) C000 C022 +! ( Alter the location of the PAD ) C000 C02C +! ( Alter the dictionary pointer ) C000 C034 +! ( Alter the vocabulary link ) C000 C038 +! ( Alter the FORTH pointer ) C000 C040 +! ( Alter the EDITOR vocabulary linkage ) C000 C046 +! ( Alter the ASSEMBLER " " " " ) C000 C04A +! ( Alter the FENCE limit ) C000 C06A +! ( Alter CURRENT ) C000 C06C +! ( Alter CONTEXT ) C006 04 ! ( Alter the UP to point to new area ) ABORT ( Install R0 and S0 values ) MULTITASKING Although Max-FORTH does not directly support multitasking, multitasking is possible. The user may add on a multitasking program with relative ease since Max-FORTH was written to be totally preemptable. When Max-FORTH was created, user variable were reserved to specify each task's priority, record the task's state and allow for a double linked list of tasks to be created. Using these variables and interrupts, the user can create round robin or priority multitaskers, or combinations thereof. Possibly the simplest structured multitasker is the round robin time sliced scheme. The following example demonstarts such a system. For simplicity sake only one task is open to communicate with the terminal. (The other tasks' USER variables, KEY-BC-PTR and EMIT-BC-PTR, could have been modified to allow them to talk to their own terminal.) (In order to find the value of NEXT2 in your revision of Max-FORTH, tick the address of COLD and DUMP the following 100 hex bytes. The address of NEXT2 is held in the two bytes immediately following the first 7E op-code in the that listing, about 90 hex bytes down.) COLD HEX FORGET TASK ( MAKE NEW ) ( USER AREA ) ( FOR TASK #1 ) 0000 C000 100 CMOVE C000 C00E +! C000 C010 +! C100 C01C ! 50 C01E ! C160 C022 ! C180 C02C ! C000 C034 +! C000 C040 +! C000 C046 +! C000 C06A +! C000 C06C +! D006 C006 ! C806 C008 ! ( MAKE NEW ) ( USER AREA ) ( FOR TASK #2 ) 0000 C800 100 CMOVE C800 C80E +! C800 C810 +! C900 C81C ! 50 C81E ! C960 C822 ! C980 C82C ! C800 C834 +! C800 C840 +! C800 C846 +! C800 C86A +! C800 C86C +! C006 C806 ! D006 C808 ! ( MAKE NEW ) ( USER AREA ) ( FOR TASK #3 ) 0000 D000 100 CMOVE D000 D00E +! D000 D010 +! D100 D01C ! 50 D01E ! D160 D022 ! D180 D02C ! D000 D034 +! D000 D040 +! D000 D046 +! D000 D06A +! D000 D06C +! C806 D006 ! C006 D008 ! C006 04 ! ABORT ( Assumes three tasks and 8K of RAM at $C000 ) ( The first task at $C000 slowly counts up on PB ) ( The second task at $C800 acts as a thermostat: reads AN0 output PA6 ) ( The third task at $D000 runs the normal Max-FORTH outer interpreter ) ( the task will also be master task, starting & handling of others ) ( Begin with simple task first ) : TASK ; : WAIT 1000 0 DO LOOP ; : RUN-TASK-1 0 BEGIN 1+ DUP B004 C! DUP C00A ! ( THIS LINE IS ONLY TO LEAVE A TRACE IN MEM ) WAIT AGAIN ; ' RUN-TASK-1 CFA C002 ! ( SAVE CFA TO RUN IN AUTOSTART POS FOR LATER ) ( Switch to define the second task ) C806 04 ! ABORT : TASK ; VARIABLE LO-SET-POINT VARIABLE HI-SET-POINT VARIABLE HEATER-STATE VARIABLE TEMP : READ-A/D 0 B030 C! ( Start conversion for PE0 ) BEGIN B030 C@ 80 AND UNTIL ( Wait for conversion complete ) B031 C@ TEMP ! ; : CHK-LO? TEMP C@ LO-SET-POINT C@ < ; : HEATER-ON 1 HEATER-STATE ! FF B000 ! ; : CHK-HI? TEMP C@ HI-SET-POINT C@ > ; : HEATER-OFF 0 HEATER-STATE ! BF B000 ! ; : RUN-TASK-2 70 LO-SET-POINT ! 74 HI-SET-POINT ! BEGIN READ-A/D HEATER-STATE @ C80A ! ( THIS LINE IS ONLY TO LEAVE A TRACE IN MEM ) CHK-LO? IF HEATER-ON THEN CHK-HI? IF HEATER-OFF THEN AGAIN ; ' RUN-TASK-2 CFA C802 ! ( SAVE CFA TO RUN IN AUTOSTART POS FOR LATER ) ( Switch to define the third task ) D006 04 ! ABORT : TASK ; CODE IRQRTN 86 C, 40 C, ( LDAA # $40 CLEAR THE INTERRUPT SOURCE ) B7 C, B025 , ( STAA $B025 BY KNOCKING DOWN BIT TFLG2 ) DE C, 02 C, ( LDX IP SAVE IP ON CONTEXT'S STACK ) 3C C, ( PSHX ) DE C, 00 C, ( LDX W SAVE W ON CONTEXT'S STACK ) 3C C, ( PSHX ) DE C, 04 C, ( LDX UP GET THIS TASK PTR AT $0004 ) AF C, 06 C, ( STS RPSAVE,X SAVE OLD CONTEXT ) EE C, 02 C, ( LDX UPLINK,X FIND NEXT TASK ) DF C, 04 C, ( STX UP AND SAVE FOR NXT IRQ ) AE C, 06 C, ( LDS RPSAVE,X SWITCH CONTEXT ) 38 C, ( PULX ) DF C, 00 C, ( STX W RECOVER W CONTEXT'S STACK ) 38 C, ( PULX ) DF C, 02 C, ( STX IP RECOVER IP CONTEXT'S STACK ) 3B C, ( RTI ) END-CODE CODE-SUB CLEAR-CC-MASKS 86 C, 00 C, ( LDAA # 0 ) 06 C, ( TAP ) 39 C, ( RTS ) END-CODE : ENABLE-MULTITASKING ( INSTALL THE REAL-TIME-INTERRUPT JUMP TABLE ENTRY ) 7E B7E6 EEC! ( JMP OP-CODE ) [ ' IRQRTN @ >< FF AND ] LITERAL B7E7 EEC! ( HI BYTE ) [ ' IRQRTN @ FF AND ] LITERAL B7E8 EEC! ( LO BYTE ) ( CREATE CONTEXTS FOR THE OTHER TASKS ON THEIR STACKS ) ( TASK 1 START UP CONTEXT ) FE54 C0FE ! ( PROGRAM COUNTER = NEXT2 ) C010 @ C0FC ! ( Y REGISTER = XXXX ) C002 @ C0FA ! ( X REGISTER = CFA TO RUN ) 0000 C0F8 ! ( B&A REGISTERS ) 00 C0F7 C! ( CC REGISTER ) 0000 C0F5 ! ( IP ) 0000 C0F3 ! ( W ) C0F2 C00C ! ( RPSAVE ) ( TASK 2 START UP CONTEXT ) FE54 C8FE ! ( PROGRAM COUNTER = NEXT2 ) C810 @ C8FC ! ( Y REGISTER = XXXX ) C802 @ C8FA ! ( X REGISTER = CFA TO RUN ) 0000 C8F8 ! ( B&A REGISTERS ) 00 C8F7 C! ( CC REGISTER ) 0000 C8F5 ! ( IP ) 0000 C8F3 ! ( W ) C8F2 C80C ! ( RPSAVE ) ( ENABLE THE HARDWARE TO GIVE REAL TIME IRQ'S ) 40 B024 C! ( RTII SET ) CLEAR-CC-MASKS ; : TASK1? BEGIN C00A @ U. ?TERMINAL UNTIL ; : TASK2? BEGIN C80A @ U. ?TERMINAL UNTIL ; A P P E N D I C E S WORDS LIST FOR Max-FORTH V3.5 The following words list was captured from a Max-FORTH V3.5 system. To conserve ROM space, only the character count and the non-underlined characters actually exist in the internal ROM, i.e., SPACES and SPACEZ are not differentiated. Unless you set WIDTH to three (number of characters --- maximum is 31) the names you enter will be normal length. F88F TASK EBE3 ( FE22 @ FDFC C@ FDEF ! FDE2 C! FA0A 2@ F9F4 2! E7C4 : E7DA ; FDCB + FDC0 - FA9B 1-! FA8C 1+! FA7D +! F887 * F87D / FD43 >< FD4E SWA_ F9DC 2OV__ F9E8 2SW__ FD8B DUP F9D4 2DU_ FD3B OVE_ FD27 ROT F9C6 2RO_ FA6F PIC_ FA29 ROL_ FA49 -R___ FD7F DRO_ F9C4 2DR__ FD76 >R FD6F R> FC05 = FC36 NOT FC24 0= F966 D0= FC1B 0> FC12 0< FBF9 U< FBE4 < F976 DU< F96E D< F95E D= FBDC > FDAF AND FDA1 OR FD93 XOR EF4F IF EF43 THE_ EF2D ELS_ EF23 BEG__ EF15 UNT__ EF03 REP___ EEFB WHI__ EEED AGA__ EF15 END EE55 DO EE82 LOO_ EE61 +LO__ FAE2 K FADA J FAD2 I FAD2 R@ EEA3 LEA__ FEB6 EXI_ F8F8 KEY F8F0 EMI_ F8E8 ?T_______ FBD4 S->_ FBC5 ABS F93E DAB_ FBA9 MIN F92A DMI_ FB99 MAX F918 DMAX F75F SPA___ FA19 DEP__ F6DA CR F6BA TYP_ F6AE COU__ F686 -TR______ FC7C 1+ FC71 2+ FC66 1- FC5B 2- FC4C 2/ FC41 2* F9A4 D+ F97E D- F903 D2/ F839 /MO_ F831 MOD F825 */M__ F81B */ FB35 UM* FB01 UM/___ FAF6 NEG___ F952 DNEG___ E802 CON_____ E7F2 VAR_____ E810 2C_______ E7E8 2V_______ DCA0 SF! DC39 SF@ DC2B FTAN DC21 FCOS DBD3 FSIN DBAD FATA__ DB79 FATA_ DAC2 F? DAAE FSQR_ DAA4 F2/ DA9A F2* DA63 F.S DA0F FNUM___ DA05 E. D9FB F. D9E1 (E.) D9B9 (F.) D93F F** D92F FALO_ D91F FEXP D8DB 2**X D88E FLN D87E FLOG D851 LOG2 D7EA ODD-____ D7CA POLY D7C4 FLOO_ D739 FROU__ D729 FLIT____ D6B8 PI D6AE e D6A6 PLAC__ D684 FLOAT+ D67B FLOATS D66E FVAR_____ D662 FCON_____ D655 F, D632 F! D60B F@ D5FC FABS D5E6 FMIN D5D0 FMAX D5C8 F< D5AC F0< D590 F0= D583 FNEG___ D516 F>D D50E S>F D4BD D>F D39E F/ D288 F* D279 F- D20D F+ D0A5 FDRO_ D070 FSWA_ D057 FOVE_ D03E FDUP D023 FNIP D006 FDEP__ D003 FSP D000 FSP0 FB8A TO____ F57C SP! FD5F RP@ F573 RP! F521 UAB___ F52D WAR____ F4E2 R0 EC48 SMU___ EA9F DL______ EB59 MES____ EB2D ERR__ EA69 ?ER___ EA5C ?CO__ EA51 ?EX__ EA46 ?PA___ EA35 ?CS_ EA81 ?ST___ FE13 @! FE07 @@ FAEA EXE____ FD66 SP@ F7B5 CMO___ F7DF CMO__ FEB6 ;S E846 COD_____ E83A COD_ E82A END-C___ E81C USE_ F596 . F5A8 .R F5B4 D. F58E U. F59E U.R F5BE D.R F615 #S F623 # F604 SIG_ F5F4 #> F5EA <# F586 ? F6E8 EXP___ E70E QUE__ F646 BL F554 STA__ F551 CUR____ F54E CONT___ F54B SCR F548 BLK F506 DP F52A OFF___ F53F FLD F53C DPL F533 >IN F4FA BAS_ F4E5 S0 F4EE TIB F539 #T__ F536 SPA_ F56B C/L F1C8 FIR__ F1C0 LIM__ F563 PAD EF83 HER_ EF7B ALL__ EF6F , EF63 C, F777 SPA__ FD81 ?D__ EDF5 TRA_____ EF5B LAT___ EC65 COM____ EC5D [ EC52 ] F4CB HEX F4C2 DEC____ EC3A ;CO__ E896 M___ EF83 R______ EE27 BO__ EE1F CFA EE10 NFA EDE8 PFA___ E738 LO__ E728 TH__ EFB7 --> F186 UPD___ F16C EM___________ F0B2 SA__________ F0B2 FL___ F09A (L____ F090 .L___ F06D >L F122 BUF___ F0D2 BLO__ F394 B/B__ EDB2 H/C ED00 HW___ ECEA AU_______ E936 UN__ E943 FO____ F1EC DUM_ F353 .S ECB2 WO___ EFFD TR___ EFCE IND__ F02B LI__ E6EF QU__ EBFE AB____ E6E5 AB___ FEBC COL_ FD17 BR____ FD05 ?BR____ FAA7 AT__ ED44 EEW___ F398 EEM___ F3C0 EEC_ F88F FORTH-83 GUIDES IN USING APPENDICES C and D Max-FORTH words in Appendix C are sorted in ascending ASCII order, whereas, Appendix D is sorted alphabetically by GROUP under which each Max-FORTH word is classified. For Appendix C, the explanations of each entry and the meaning of abbreviations and symbols are presented below. For Appendix D, the explanations under STACK NOTATION and GROUP apply. NAME: The name of FORTH words are boldfaced. PRONUNCIATION: The english language pronunciation of each words is enclosed in double quotes ("). VERSION: Each words may be any of the following versions or combinations: NMI New Micros Inc. NMIDR New Micros Inc. Development ROM F83 Forth-83 Standard RSC Rockwell Semiconductor V3.5 New Micros Inc. Max-FORTH Version 3.5 STACK NOTATION: The stack parameters input to and output from a definition are described using the notation: ( before --- after ) where, before = stack parameters before execution after = stack parameter after execution The parameters are arranged such that the top of the stack is to the right. Words may also be shown in context where appropriate. Unless otherwise noted, all stack notation describes execution time. If it applies at compile time, the line is followed by: (compiling) . --- FORTH word's execution point Literal text. The actual word's name. b bit (0 or 1) char character (numeral range: 0 to 127) +d, +d1 positive double number +n positive number 0 the number zero 8b, 8b1 8-bit number 16b, 16b1 16-bit number 32b, 32b1 32-bit number addr, addr1 address count number of items or characters or loop repetitions d, d1 32-bit signed number f flag (0=false, 1=true) false boolean ( 0 ) flag boolean flag (0=false, non-zero=true) n, n1 16-bit signed number r, r1 32-bit signed mantissa and 16-b signed exponent real number sys, sys1 0, 1 or more system-dependent stack entries true boolean ( -1) u, u1 16-bit unsigned number ud, ud1 32-bit unsigned number w, w1 unspecified weighted number ( n or u) wd unspecified weighted double number (d or ud) # ARGUMENTS IN: The number of input parameters as shown in the STACK NOTATION. The number may also be followed by a note to clarify how many bit wide it is, like 1 word (16-bit), 2 words, etc. # ARGUMENTS OUT: The number of output parameters as shown in the STACK NOTATION. The number may also be followed by a note to clarify how many bit wide it is, like 1 word (16-bit), 2 words, etc. RETURN STACK: States the effect/s of the word to the return stack, if applicable. DICTIONARY: States the effect/s of the word to the dictionary, if applicable. PAD: States the effect/s of the word to the PAD and/or the area below PAD used for output formating, if applicable. INPUT: States input effect/s of the word, if applicable. OUTPUT: States the output effect/s of the word, if applicable. GROUP: Words are grouped according to their primary functions. A word is classified under one of the following groups: Arithmetic Words that perform the fundamental operations of arithmetic, e.g., binary operations of addition, subtraction, multiplication, division, negation and absolute value. Comparison Words that compare values for relative magnitude or relative signs, leaving a flag. Compiler Words that are used for compiling dictionary entries. Control Words that determine the execution and interpretation sequence of a program. Definition Words used to define or create new words. Dictionary Words that are used to operate on the FORTH's dictionary. Format Words that define the presentation or conversion of numbers and character strings. I/O Words that direct all the input/output operation. Interpreter Words that decode and immediately execute instructions written as pseudocodes. Logic Words that execute an operation that is defined in symbolic logic, such as AND, OR, NOT. Mass Words used for efficient utilization of mass storage devices or output devices. Memory Words that operate on specified memory addresses. Numeric Words for representing numbers into a specific number base, or converting strings into number. Operating System Words that perform system procedures. Primitive Words which are originally defined in machine code and are used to define other words. Security Words that inform users of errors or provide preventive measures against unwanted actions on an operation. Stack Words to manipulate the stack. Vocabulary Words operating on the FORTH vocabulary. ATTRIBUTE: Capitalized symbols indicate attributes of the defined words: C May only be used during compilation of a colon definition. E Intended for execution only. I Indicates that the word is IMMEDIATE and will execute during compilation, unless special action is taken. M Has a potential multiprogramming impact. P Has precedence bit and will execute even when compiling. U A user variable. 79 Forth-79. 83 Forth-83 STANDARD: All words that are found in the Forth-83 Standards, if applicable, are identified as follows: Forth-83 Word Set Classification Layer----- Forth-83 Word Set Classification------- | Forth-83 -------------------------- | | | | | F83-XXXX-XL Word Set Classifications: RWS Required Word Set DNEWS Double Number Extension Word Set AEWS Assembler Extension Word Set SEWS System Extension Word Set CRW Controlled Reference Word URW Uncontrolled Reference Word Word Set Classification Layers: NL Nucleus Layer DL Device Layer IL Interpreter Layer CL Compiler Layer SHORT DEFINITION: Brief description of the word. Most symbols used may be found in the stack notation. Refer back to stack notation symbol key for their meaning. LONG DEFINITION: Detailed description of the word. Most symbols used may be found in the stack notation. Refer back to stack notation symbol key for their meanings. Max-FORTH WORDS DEFINITION NAME : ! PRONUNCIATION : "store" APPEARS AS : FDEF ! VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b addr --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Stores 16 at addr. LONG DEFINITION : 16b is stored at addr. NAME : # PRONUNCIATION : "sharp" APPEARS AS : F623 # VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( +d1 --- +d2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : Bytes below PAD modified as temporary area where +d1 is converted to string. INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : +d1 is divided by BASE and the quotient is placed onto the stack. The remainder is converted to an ASCII character and appended to the output string toward lower memory addresses. LONG DEFINITION : The remainder of +d1 divided by the value of BASE is converted to an ASCII character and appended to the output string toward lower memory addresses. +d2 is the quotient and is maintained for further processing. Typically used between <# and #> . NAME : #S PRONUNCIATION : "sharp-s" APPEARS AS : F615 #S VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( +d --- 0 0 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : Bytes below PAD modified as temporary area where +n is converted to string. INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Converts all digits of an entire number into string. LONG DEFINITION : +d is converted apppending each resultant into the pictured numeric output string until the quotient (see: # ) is zero. A single zero is added to the output string if the number was initially zero. Typically used between <# and #> . NAME : #TIB PRONUNCIATION : "number-t-i-b" APPEARS AS : F539 #T__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Returns the address of the user variable that holds the number of characters input. LONG DEFINITION : The address of a user variable containing the number of bytes in the text input buffer. #TIB is accessed by WORD when BLK is zero. NAME : ' PRONUNCIATION : "tick" APPEARS AS : EBA9 ' VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Dictionary ATTRIBUTE : M 83 STANDARD : F83-RWS-IL SHORT DEFINITION : Returns 's compilation address, addr. LONG DEFINITION : Used in the form: ' addr is the compilation address of . An error condition exists if is not found in the currently active search order. NAME : ( PRONUNCIATION : "paren" APPEARS AS : EBE3 ( VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : Characters up to ) are removed from input stream. OUTPUT : GROUP : Compiler ATTRIBUTE : I STANDARD : F83-RWS-IL SHORT DEFINITION : Starts a comment input. Comment is ended by a ) . LONG DEFINITION : Used in the form: ( ccc) The characters ccc, delimited by ) (close parenthesis), are considered comments. Comments are otherwise not processed. The blank following ( is not part of ccc. ( may be freely used while interpreting or compiling. The number of characters in ccc may be from zero to the number of characters remaining in the input stream up to the closing parenthesis. NAME : (E.) PRONOUNCIATION : paren-E-dot-paren APPEARS AS : D9E1 (E.) VERSION : NMI ANSI STACK NOTATION : (f: R --) (-- addr +n) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : string stored below PAD INPUT : OUTPUT : GROUP : floating point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Convert the top number on the floating-point stack to its character string representation using the scientific notation. LONG DEFINITION : Convert the top number on the floating-point stack to its character string representation using the scientific notation. The character string produced will be exactly the same as that generated by the floating-point operator E.. Scientific notation has the format [-]mantissa e[-] exponent where the mantissa contains a radix point with the most sigificant digit to the left the point, zero or more trailing digits, and the exponent with one or more trailing digits. The exact number of digits to the right of the radix place in the mantissa is determined by PLACES. The exponent consists of an optional sign and enough decimal digits to represent the exponent. An exception exists if the system basis is not DECIMAL. NAME : (F.) PRONOUNCIATION : paren-F-dot-paren APPEARS AS : D9B9 (F.) VERSION : NMI ANSI STACK NOTATION : (f: R --) (-- addr +n) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : string stored below PAD INPUT : OUTPUT : GROUP : floating point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Convert the top number on the floating-point stack to its character string representation using the fixed-point notation. LONG DEFINITION : Convert the top number on the floating-point stack to its character string representation using the fixed-point notation. The character string produced will be exactly the same as that generated by the floating-point operator F.. The exact number of digits to the right of the radix place in the mantissa is determined by PLACES. An exception exists if the system basis is not DECIMAL. Very large numbers are represented using scientific notation. For example, the sequence 4 PLACES 1.23e5 F. will display 123000.0000 NAME : (LINE) PRONUNCIATION : "paren-line" APPEARS AS : F09A (L____ VERSION : RSC NMIDR STACK NOTATION : ( n1 n2 --- addr count ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : May cause block read if not RAM resident. OUTPUT : May cause block write to facilitate block read GROUP : Mass ATTRIBUTE : STANDARD : SHORT DEFINITION : Virtual storage line primitive. LONG DEFINITION : Converts the line number n1 and the screen number n2 to the disk buffer address containing the data. A count of 64 indicates a full line length. NAME : * PRONUNCIATION : "times" APPEARS AS : F887 * VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 w2 --- w3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Multiplies w2 by w1 and leaves the product w3 onto the stack. LONG DEFINITION : w3 is the least significant 16 bits of the arithmetic product of w1 times w2. NAME : */ PRONUNCIATION : "times-divide" APPEARS AS : F81B */ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 n3 --- n4 ) # ARGUMENTS IN : 3 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Multiplies n2 by n1 and divides the product by n3. The quotient, n4 is placed on the stack. LONG DEFINITION : n1 is first multiplied by n2 producing an intermediate 32-bit result. n4 is the floor of the quotient of the intermediate 32-bit result divided by the divisor n3. The product of n1 times n2 is maintained as an intermediate 32-bit result for greater precision than the otherwise equivalent sequence: n1 n2 * n3 / . An error condition results if the divisor is zero or if the quotient falls outside the range {-32,768...32,767}. NAME : */MOD PRONUNCIATION : "times-divide-mod" APPEARS AS : F825 */M__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 n3 --- n4 n5 ) # ARGUMENTS IN : 3 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : n1 is multiplied by n2 producing a product which is divided by n3. The remainder, n4 and the quotient, n5 are then placed on the stack. LONG DEFINITION : n1 is first multiplied by n2 producing an intermediate 32 bit result. n4 is the remainder and n5 is the floor of the quotient of the intermediate 32-bit result divided by the divisor n3. A 32-bit intermediate product is used for */ . n4 has the same sign as n3 or is zero. An error condition results if the divisor is zero or if the quotient falls outside of the range {-32,768...32,767}. NAME : + PRONUNCIATION : "plus" APPEARS AS : FDCB + VERSION : NMI NMIDR FORTH-83 STACK NOTATION : (w1 w2 --- w3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Adds w2 and w1 then leaves the sum, w3 on the stack. LONG DEFINITION : w3 is the arithmetic sum of w1 plus w2. NAME : +! PRONUNCIATION : "plus-store" APPEARS AS : FA7D +! VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 addr --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Adds w1 to the value at addr then stores the sum at addr replacing its previous value. LONG DEFINITION : w1 is added to the w value at addr using the convention for + . This sum replaces the original value at addr. NAME : +LOOP PRONUNCIATION : "plus-loop" APPEARS AS : EE61 +LO__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n --- ), ( sys --- ) (compiling) # ARGUMENTS IN : 1 , 1 # ARGUMENTS OUT : 0 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Increments the DO LOOP index by n. LONG DEFINITION : n is added to the loop index. If the new index was incremented across the boundary between limit-1 and limit then the loop is terminated and loop control parameters are discarded. When the loop is not terminated, execution continues to just after the corresponding DO . sys is balanced with its corresponding DO . See: DO NAME : , PRONUNCIATION : "comma" APPEARS AS : EF6F , VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : Word pointed to by DP prior to execution is modified. PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Reserves 16b of space in the dictionary. LONG DEFINITION : ALLOT space for 16b then store 16b at HERE 2- . NAME : - PRONUNCIATION : "minus" APPEARS AS : FDC0 - VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 w2 --- w3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Subtracts w2 from w1 and leaves the result, w3 on the stack. LONG DEFINITION : w3 is the result of subtracting w2 from w1. NAME : --> PRONUNCIATION : "next block" APPEARS AS : EFB7 --> VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : Causes read of next block if not RAM resident. OUTPUT : May cause write of updated screen to make buffer space. GROUP : Mass ATTRIBUTE : I STANDARD : F83-CRW SHORT DEFINITION : Immediately transfers interpretation to the start of the next sequential block. LONG DEFINITION : Continue interpretation on the next sequential block. May be used within a colon definition that crosses a block boundary. NAME : -ROLL PRONUNCIATION : "dash-roll" APPEARS AS : FA49 -R___ VERSION : NMI NMIDR STACK NOTATION : ( n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : SHORT DEFINITION : Removes the value on the top of stack and inserts it to the nth place from the top of stack. LONG DEFINITION : The item on the top of the data stack is removed and inserted down to the nth location from (but not including) the top of the stack. The rest of the contents of the stack is shifted up to make room to insert the item. 1 -ROLL is equivalent to SWAP . NAME : -TRAILING PRONUNCIATION : "dash-trailing" APPEARS AS : F686 -TR______ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr +n1 --- addr +n2 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Counts +n1 characters starting at addr and subtracts 1 from the count when a blank is encountered. Leaves on the stack the final string count, n2 and addr. LONG DEFINITION : The character count +n1 of a text string beginning at addr is adjusted to exclude trailing spaces. If +n1 is zero, then +n2 is also zero. If the entire string consists of spaces, then +n2 is zero. NAME : . PRONUNCIATION : "dot" APPEARS AS : F596 . VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Removes n from the top of stack and displays it. LONG DEFINITION : The value of n is displayed in a free field format with a leading minus sign if n is negative. NAME : ." PRONUNCIATION : "dot-quote" APPEARS AS : EBF2 ." VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : I M STANDARD : F83-RWS-CL SHORT DEFINITION : Displays the characters following it up to the delimiter " . LONG DEFINITION : Used in the form: ." ccc" Later execution will display the characters ccc up to but not including the delimiting " (close-quote). The blank following ." is not part of ccc. Used inside a colon definition only. NAME : .( PRONUNCIATION : "dot-paren" APPEARS AS : EC15 .( VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : Displays character string GROUP : I/O ATTRIBUTE : I M 83 STANDARD : F83-RWS-IL SHORT DEFINITION : Displays string following .( delimited by ) . LONG DEFINITION : Used in the form: .( ccc) The characters ccc up to but not including the delimiting ) (close parenthesis) are displayed. The blank following .( is not part of ccc. Used outside of a colon definition only. NAME : .LINE PRONUNCIATION : "dot-line" APPEARS AS : F090 .L___ VERSION : RSC NMI NMIDR STACK NOTATION : ( n1 n2 --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : May cause block read if not RAM resident. OUTPUT : Lists line to terminal. GROUP : Mass ATTRIBUTE : STANDARD : SHORT DEFINITION : Display line of text from mass storage. LONG DEFINITION : Displays a line of text from mass storage by its line number n2. Trailing blanks are suppressed. NAME : .R PRONUNCIATION : "dot-r" APPEARS AS : F5A8 .R VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n +n --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : Bytes below PAD modified as temporary area where +n is converted to string. INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Displays the value n right justified in a field +n characters wide according to the value of BASE. LONG DEFINITION : n is converted using BASE and then displayed right alligned in a field +n characters wide. A leading minus sign is displayed if n is negative. If the number of characters required to display n is greater than +n, an error condition exists. NAME : .S PRONUNCIATION : "dot-s" APPEARS AS : F353 .S VERSION : RSC NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : SHORT DEFINITION : Display stack contents without modifying the stack. LONG DEFINITION : Displays the contents of the stack without altering the stack. This word is very useful in determining the stack contents during debugging programs and learning FORTH. NAME : / PRONUNCIATION : "divide" APPEARS AS : F87D / VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 --- n3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Divides n1 by n2 and leaves the quotient n3 on the stack. LONG DEFINITION : n3 is the floor of the quotient of n1 divided by the divisor n2. An error condition results if the divisor is zero or if the quotient falls outside the range {-32,768 ... 32,767}. NAME : /MOD PRONUNCIATION : "divide-mod" APPEARS AS : F839 /MO_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 --- n3 n4 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Divides n1 by n2 then leaves on the stack the remainder n3 and the quotient n4. LONG DEFINITION : n3 is the remainder and n4 the floor of the quotient of n1 divided by the divisor n2. n3 has the same sign as n2 or is zero. An error condition results if the divisor is zero or if the quotient falls outside the range {-32,768 ... 32,676}. NAME : : PRONUNCIATION : "colon" APPEARS AS : E7C4 : VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- sys ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : E (I) STANDARD : F83-RWS-CL SHORT DEFINITION : Starts the definition of a word. Definition is terminated by a ; . LONG DEFINITION : A defining word executed in the form: : ... ; Create a definition for in the compilation vocabulary and set compilation state. The search order is changed so that the first vocabulary in the search order is replaced by the compilation vocabulary. The compilation vocabulary is unchanged. The text from the input stream is subsequently compiled. is called a "colon definition". The newly created word definition for cannot be found in the dictionary until the corresponding ; or ;CODE is successfully processed. An error condition exists if a word is not found and cannot be converted to a number or if, during compilation from mass storage, the input stream is exhausted before encountering ; or ;CODE . sys is balanced with its corresponding ; . NAME : :CASE PRONUNCIATION : "colon-case" APPEARS AS : E854 :CA__ VERSION : NMI NMIDR STACK NOTATION : ( n --- ), ( --- sys ) (compiling) # ARGUMENTS IN : 1 , 0 # ARGUMENTS OUT : 0 , 1 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : (I) STANDARD : SHORT DEFINITION : Creates a dictionary entry for in current and sets the compile mode. LONG DEFINITION : A defining word used in the form: :CASE ... ; Creates a dictionary entry for in CURRENT , and sets the compile mode. Words thus defined are called "case statements". The compilation addresses of subsequent words from the input stream are stored into the dictionary. At runtime a word defined by :CASE will execute only the nth definition compiled into the definition. sys is balanced with its corresponding ; . NAME : ; PRONUNCIATION : "semi-colon" APPEARS AS : E7DA ; VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( sys --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Definition ATTRIBUTE : C I 79 STANDARD : F83-RWS-CL SHORT DEFINITION : Terminates a colon-definiton. LONG DEFINITION : Stops compilation of a colon definition, allows the of this colon definition to be found in the dictionary, sets interpret state and compiles ;S . sys is balanced with corresponding : . NAME : ;CODE PRONUNCIATION : "semi-colon-code" APPEARS AS : EC3A ;CO__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ), ( sys1 --- sys2 ) (compiling) # ARGUMENTS IN : 0 , 1 # ARGUMENTS OUT : 0 , 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Definition ATTRIBUTE : (I) STANDARD : F83-AEWS-CL SHORT DEFINITION: Terminates a defining-word. May only be used in compilation mode. LONG DEFINITION : Used in the form: : ... ... ;CODE ...END-CODE Stops compilation, terminates the defining word and executes ASSEMBLER . When is executed in the form: to define the new , the execution address of will contain the address of the code sequence following the ;CODE in . Execution of any will cause this machine code sequence to be executed. sys1 is balanced with its corresponding : . sys2 is balanced with its corresponding END-CODE . See: CODE DOES> NAME : ;S PRONUNCIATION : "semi-colon-s" APPEARS AS : FEB6 ;S VERSION : RSC NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Stop interpretation. LONG DEFINITION : Stops interpretation of a screen. ;S is also the run-time word compiled at the end of a colon-definition which returns execution to the calling procedure. NAME : < PRONUNCIATION : "less-than" APPEARS AS : FBE4 < VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 --- flag ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves a true flag on stack if n1 is less than n2. LONG DEFINITION : flag is true if n1 is less than n2. -32768 32767 < must return true. -32768 0 < must return true. NAME : <# PRONUNCIATION : "less-sharp" APPEARS AS : F5EA <# VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Starts a formatted (pictured) numeric output. Terminated by #> . LONG DEFINITION : Initialize pictured numeric ouput conversion. The words: # #> #S <# HOLD SIGN can be used to specify the conversion of a double number into an ASCII text string stored in right-to-left order. NAME : LONG DEFINITION : Used in conjunction with DOES> in defining words, in the form: : ... ... ; and then . When executes, . The sequence of words between established a parameter field for . When is later executed, the sequence of words following DOES> will be executed, with the parameter field address of on the data stack. NAME : PRONUNCIATION : "greater-than" APPEARS AS : FBDC > VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 --- flag ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Returns a true flag if n1 is greater than n2. LONG DEFINITION : flag is true if n1 is greater than n2. -32768 32767 > must return false. -32768 0 > must return false. NAME : >< PRONUNCIATION : "byte-swap" APPEARS AS : FD43 >< VERSION : NMI NMIDR STACK NOTATION : ( 8b1/8b2 --- 8b2/8b1 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Swaps the upper and lower bytes of the value on the stack. LONG DEFINITION : Swaps the upper and lower bytes of the value on the top of the data stack. NAME : >BODY PRONUNCIATION : "to-body" APPEARS AS : FC71 >BO__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr1 --- addr2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Leaves on the stack the parameter field address, addr2 of a given field address, addr1. LONG DEFINITION : addr2 is the parameter field address corresponding to the compilation address addr1. NAME : >IN PRONUNCIATION : "to-in" APPEARS AS : F533 >IN VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Leaves the address of the user variable >IN which contains the number of bytes from the beginning of the input stream at any particular moment during interpretation. LONG DEFINITION : The address of a user variable which contains the present character offset within the input stream. See: WORD NAME : >L PRONUNCIATION : "to-line" APPEARS AS : F06D >L VERSION : NMI NMIDR STACK NOTATION : ( n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : following >L is removed from input stream. OUTPUT : GROUP : MASS ATTRIBUTE : STANDARD : SHORT DEFINITION : Place the on line n of the current screen as designated by SCR. LONG DEFINITION : Place the following text on line n of the current screen as designated by SCR . NAME : >MARK PRONUNCIATION : "forward-mark" APPEARS AS : EE3F >M___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : (I) STANDARD : F83-SEWS-CL SHORT DEFINITION : Compiles zero in place of forward branch offset and marks it for future resolve. LONG DEFINITION : Used at the source of a forward branch. Typically used after either BRANCH or ?BRANCH . Compiles space in the dictionary for a branch address which will later be resolved by >RESOLVE . NAME : >R PRONUNCIATION : "to-r" APPEARS AS : FD76 >R VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : Takes 16b from stack DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Removes 16b from user stack and place it onto return stack. LONG DEFINITION : Transfers 16b from the top of the data stack to the top of the return stack. NAME : >RESOLVE PRONUNCIATION : "forward-resolve" APPEARS AS : EE31 >R______ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : (I) STANDARD : F83-SEWS-CL SHORT DEFINITION : Corrects branch offset previously compiled by >mark to current dictionary location. LONG DEFINITION : Used at the destination of a forward branch. Calculates the branch address (to the current location in the dictionary) using addr and places this branch address into the space left by >MARK . NAME : ? PRONUNCIATION : "question-mark" APPEARS AS : F586 ? VERSION : RSC NMI NMIDR STACK NOTATION : ( addr --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : SHORT DEFINITION : Displays the contents of addr. LONG DEFINITION : Displays the value contained at the address on the top of the stack in free format according to the current BASE . Uses the format of . . NAME : ?BRANCH PRONUNCIATION : "question-branch" APPEARS AS : FD05 ?BR____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( flag --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Primitive ATTRIBUTE : C STANDARD : F83-SEWS-NL SHORT DEFINITION : Compiles a conditional branch operation. LONG DEFINITION : When used in the form: COMPILE ?BRANCH a conditional branch operation is compiled. See BRANCH for further details. When executed, if flag is false the branch is performed as with BRANCH . When flag is true execution continues at the compilation address immediately following the branch address. NAME : ?COMP PRONUNCIATION : "question-compile" APPEARS AS : EA5C ?CO__ VERSION : STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : SHORT DEFINITION : Checks for compilation mode, gives error if not. LONG DEFINITION : Checks STATE user variable for value non-zero indicating compilation mode. Error 17 is given if not in compliation state. NAME : ?CSP PRONUNCIATION : "question-c-s-p" APPEARS AS : EA35 ?CS_ VERSION : STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : SHORT DEFINITION : Checks for stack integrety through defining process, gives error if not. LONG DEFINITION : Checks CSP user variable to verify same Data Stack depth indicating stack security maintained during defining process. Error 20 is given if not in compliation state. NAME : ?DUP PRONUNCIATION : "question-dup" APPEARS AS : FD81 ?D__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- 16b 16b ), ( 0 --- 0 ) # ARGUMENTS IN : 1 , 1 # ARGUMENTS OUT : 2 , 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Duplicates 16b if it is a non-zero. LONG DEFINITION : Duplicate 16b if it is non-zero value, If it is zero, 16b is not duplicated. NAME : ?ERROR PRONUNCIATION : "question-error" APPEARS AS : EA69 ?ER___ VERSION : V3.5 STACK NOTATION : (flag n --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : STANDARD : SHORT DEFINITION :If flag is true, error n is initiated. LONG DEFINITION :If flag is true, error n is initiated. Error action controled by ERROR. NAME : ?EXEC PRONUNCIATION : "question-execute" APPEARS AS : EA51 ?EX__ VERSION : STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : SHORT DEFINITION : Checks for interpretation mode, gives error if not. LONG DEFINITION : Checks STATE user variable for zero value indicating interpretation mode. Error 18 is given if not in compilation state. NAME : ?PAIRS PRONUNCIATION : "question-pairs" APPEARS AS : EA46 ?PA___ VERSION : STACK NOTATION : ( n1 n2 --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : SHORT DEFINITION : Checks for matched structure pairs, gives error if not. LONG DEFINITION : Checks stack for equal values during the defining process of structures. Error 19 is given if structure pairs not match. NAME : ?STACK PRONUNCIATION : "question-stack" APPEARS AS : EA81 ?ST___ VERSION : STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : SHORT DEFINITION : Checks to see if stack is within limits, gives error if not. LONG DEFINITION : Checks to see if stack is within limits. Error 1, STACK EMPTY, is given if stack has underflowed. Error 7 is given if stack has overflowed (Rev X.0 - X.3 only). NAME : ?TERMINAL PRONUNCIATION : "question-terminal" APPEARS AS : F8E8 ?T_______ VERSION : RSC NMI NMIDR STACK NOTATION : ( --- flag ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : SHORT DEFINITION : True if any key is depressed. LONG DEFINITION : Tests the terminal input for actuation of any key. Generates a Boolean value. A true flag indicates actuation, whereas a false flag indicates non-actuation. NAME : @ PRONUNCIATION : "fetch" APPEARS AS : FE22 @ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr --- 16b ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Replaces addr with its 16b contents on top of the stack. LONG DEFINITION : 16b is the value at addr. NAME : @! PRONUNCIATION : "fetch-store" APPEARS AS : FE13 @! VERSION : V3.5 STACK NOTATION : ( 16b addr --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : SHORT DEFINITION : Stores 16 at address pointed to by addr. LONG DEFINITION : 16b is stored at address which is pointed to by addr. addr is a pointer location. addr is fetched and used as destination address into which the 16b value is stored. NAME : @@ PRONUNCIATION : "fetch-fetch" APPEARS AS : FE07 @@ VERSION : STACK NOTATION : ( addr --- 16b ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : SHORT DEFINITION : Replaces addr with 16b, 16b is contents of address pointed to by addr. LONG DEFINITION : 16b is the value pointed to by addr. addr is a pointer location. addr is fetched and used as source address from which the 16b value is fetched. Like using @ @ but faster execution and smaller compilation using a single word. NAME : [ PRONUNCIATION : "left-bracket" APPEARS AS : EC5D [ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : I STANDARD : F83-RWS-CL SHORT DEFINITION : Places the system into interpret state to execute non-immediate word/s during compilation. LONG DEFINITION : Sets interpret state. The text from the input stream is subsequently interpreted. For typical usage see LITERAL . See ) ] NAME : ['] PRONUNCIATION : "bracket-tick" APPEARS AS : EBA9 ['] VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ), ( --- ) # ARGUMENTS IN : 0 , 0 # ARGUMENTS OUT : 1 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Compiler ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Returns and compiles the code field address of a word in a colon-definition. LONG DEFINITION : Used in the form: ['] . Compiles the compilation address addr of as a literal. When the colon definition is later executed, addr is left on the stack. An error condition exists if is not found in the currently active search order. See: LITERAL NAME : [COMPILE] PRONUNCIATION : "bracket-compile" APPEARS AS : EAD3 [CO______ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream OUTPUT : GROUP : Compiler ATTRIBUTE : I STANDARD : F83-RWS-CL SHORT DEFINITION : Causes an immediate word to be compiled. LONG DEFINITION : Used in the form: [COMPILE] Forces compilation of the following word . This allows compilation of an immediate word when it would otherwise have been executed. NAME : ] PRONUNCIATION : "right-bracket" APPEARS AS : EC52 ] VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : COMPILER ATTRIBUTE : I STANDARD : F83-RWS-CL SHORT DEFINITION : Places the system into compilation state. ] places a non-zero value into the user variable STATE. LONG DEFINITION : Sets compilation state. The text from the input stream is subsequently compiled. For typical usage see LITERAL . See: [ NAME : 0< PRONUNCIATION : "zero-less" APPEARS AS : FC12 0< VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n --- flag ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves a true flag if n is less than zero. LONG DEFINITION : Flag is true if n is less than zero (negative). NAME : 0= PRONUNCIATION : "zero-equals" APPEARS AS : FC24 0= VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w --- flag ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves a true flag if w is equal to zero. LONG DEFINITION : flag is true if w is zero. NAME : 0> PRONUNCIATION : "zero-greater" APPEARS AS : FC1B 0> VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n --- flag ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves a true flag if n is greater than zero. LONG DEFINITION : flag is true if n is greater than zero. NAME : 1+ PRONUNCIATION : "one-plus" APPEARS AS : FC7C 1+ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 --- w2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Adds 1 to w1 then leaves the sum, w2 on the stack. LONG DEFINITION : w2 is the result of adding 1 to w1 according to the operation of + . NAME : 1+! PRONUNCIATION : "one-plus-store" APPEARS AS : FA8C 1+! VERSION : NMI NMIDR STACK NOTATION : ( addr --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Adds one to the value at addr and stores the result at addr. LONG DEFINITION : Adds one to the value at addr and stores the result at addr. NAME : 1- PRONUNCIATION : "one-minus" APPEARS AS : FC66 1- VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 --- w2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Subtract 1 from w1 then leaves the difference, w2 on the stack. LONG DEFINITION : w2 is the result of subtracting one from w1 according to the operation of - . NAME : 1-! PRONUNCIATION : "one-minus-store" APPEARS AS : FA9B 1-! VERSION : NMI NMIDR STACK NOTATION : ( addr --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Subtracts one from the value at addr and stores the result at addr. LONG DEFINITION : Subtracts one from the value at addr and stores the result at addr. NAME : 2! PRONUNCIATION : "two-store" APPEARS AS : F9F4 2! VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 32b addr --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Stores 32b at addr. LONG DEFINITION : 32b is stored at addr. NAME : 2* PRONUNCIATION : "two-times" APPEARS AS : FC41 2* VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 --- w2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Multiplies w1 by 2 to give w2. LONG DEFINITION : w2 is the result of shifting w1 left one bit. A zero is shifted into vacated bit position. NAME : 2**X PRONUNCIATION : "two-star-star-x" APPEARS AS : D8DB 2**X VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 --- r2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : Raises 2 to the r1 power giving r2. LONG DEFINITION : Floating Point number r2 is result of raising 2 to the power of r1. NAME : 2+ PRONUNCIATION : "two-plus" APPEARS AS : FC71 2+ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 --- w2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Adds two to w1 and leaves the sum, w2 on the stack. LONG DEFINITION : w2 is the result of adding two to w1 according to the operation of + . NAME : 2- PRONUNCIATION : "two-minus" APPEARS AS : FC5B 2- VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 --- w2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Subtracts two from w1 and leaves the result, w2 on the stack. LONG DEFINITION : w2 is the result of subtracting two from w1 according to the operation of - . NAME : 2/ PRONUNCIATION : "two-divide" APPEARS AS : FC4C 2/ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 --- n2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : 83 STANDARD : F83-RWS-NL SHORT DEFINITION : divides n1 by 2, giving n2 as the result. LONG DEFINITION : n2 is the result of the arithmetically shifting n1 right one bit. The sign is included in the shift and remains unchanged. NAME : 2@ PRONUNCIATION : "two-fetch" APPEARS AS : FA0A 2@ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr --- 32b ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Returns 32b from addr. LONG DEFINITION : 32b is the value at addr. NAME : 2CONSTANT PRONUNCIATION : "two-constant" APPEARS AS : E810 2C_______ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 32b --- ) # ARGUMENTS IN : 1 (2 words) # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : STANDARD : F83-DNEWS-CL SHORT DEFINITION : Creates a double length constant for a . When is executed, 32b is left on the stack. LONG DEFINITION : A defining word executed in the form: 32b 2CONSTANT Creates a dictionary entry for so that when is later executed, 32b will be left on the stack. NAME : 2DROP PRONUNCIATION : "two-drop" APPEARS AS : F9C4 2DR__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 32b --- ) # ARGUMENTS IN : 1 (2 words) # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Removes 32b from the stack. LONG DEFINITION : 32b is removed from the data stack. NAME : 2DUP PRONUNCIATION : "two-dup" APPEARS AS : F9D4 2DU_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 32b --- 32b 32b ) # ARGUMENTS IN : 1 (2 words) # ARGUMENTS OUT : 2 (4 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Duplicates 32b. LONG DEFINITION : Duplicates 32b onto the top of the data stack. NAME : 2OVER PRONUNCIATION : "two-over" APPEARS AS : F9DC 2OV__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 32b1 32b2 --- 32b1 32b2 32b3 ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 3 (6 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : 32b3 is a copy of 32b1 LONG DEFINITION : Duplicates the 2nd item 32b1 of the stack onto the top of the data stack, leaving 32b. NAME : 2ROT PRONUNCIATION : "two-rote" APPEARS AS : F9C6 2RO_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 32b1 32b2 32b3 --- 32b2 32b3 32b1 ) # ARGUMENTS IN : 3 (6 words) # ARGUMENTS OUT : 3 (6 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Rotates 32b1 to the top of the stack. LONG DEFINITION : The top three double numbers on the data stack are rotated, bringing the third double number to the top of the stack. NAME : 2SWAP PRONUNCIATION : "two-swap" APPEARS AS : F9E8 2SW__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 32b1 32b2 --- 32b2 32b1 ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 2 (4 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Swaps 32b1 and 32b2 on the stack. LONG DEFINITION : The top two double numbers are exchanged in position on the data stack. NAME : 2VARIABLE PRONUNCIATION : "two-variable" APPEARS AS : E7E8 2V_______ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : STANDARD : F83-DNEWS-CL SHORT DEFINITION : Creates double-length variable for . when is executed, its parameter field address is placed on the stack. LONG DEFINITION : A defining word executed in the form: 2VARIABLE A dictionary entry for is created and four bytes are ALLOTed in its parameter field. This parameter field is to be used for contents of the variable. The application is responsible for initializing the contents of the variable which it creates. When is later executed, the address of its parameter field is placed on the stack. NAME : ABORT PRONUNCIATION : "abort" APPEARS AS : E6E5 AB___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : Cleared RETURN STACK : Cleared DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Clears the data stack and performs the function of QUIT . LONG DEFINITION : Clears the data stack and performs the function of QUIT . No message is displayed. NAME : ABORT" PRONUNCIATION : "abort-quote" APPEARS AS : EBFE AB____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( flag --- ), ( --- ) (compiling) # ARGUMENTS IN : 1 , 0 # ARGUMENTS OUT : 0 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : If flag is true, message that follows " is displayed and the ABORT function is performed. If flag is false, the flag is dropped and execution continues. LONG DEFINITION : Used in the form: flag ABORT" ccc" When later executed, if flag is true the characters ccc, delimited by " (close quote), are displayed and then a system dependent error abort sequence, including the function of ABORT , is performed. If flag is false, the flag is dropped and execution continues. The blank following ABORT" is not part of ccc. NAME : ABS PRONUNCIATION : "absolute" APPEARS AS : FBC5 ABS VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n --- u ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves on the stack the absolute value, u of n. LONG DEFINITION : u is the absolute value of n. If n is -32,768 then u is the same value. NAME : AGAIN PRONUNCIATION : "again" APPEARS AS : EEED AGA__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ), ( sys --- ) (compiling) # ARGUMENTS IN : 0 , 1 # ARGUMENTS OUT : 0 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : (I) STANDARD : F83-URW SHORT DEFINITION : Affect an unconditional jump back to the start of a BEGIN-AGAIN loop. LONG DEFINITION : Affect an unconditional jump back to the start of a BEGIN-AGAIN loop. sys is balanced with its corresponding BEGIN . See: BEGIN NAME : ALLOT PRONUNCIATION : "allot" APPEARS AS : EF7B ALL__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : No alteration, however, DP is changed. PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Reserves w bytes of dictionary space. LONG DEFINITION : Allocates w bytes in the dictionary. The address of the next available dictionary location is updated accordingly. NAME : AND PRONUNCIATION : "and" APPEARS AS : FDAF AND VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b1 16b2 --- 16b3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Logic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves the bitwise logical AND of 16b1 and 16b2 as 16b3. LONG DEFINITION : 16b3 is the bit-by-bit logical 'and' of 16b1 with 16b2. NAME : ASSEMBLER PRONUNCIATION : "assembler" APPEARS AS : E9E6 AS_______ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Vocabulary ATTRIBUTE : (I) STANDARD : F83-AEWS-IL SHORT DEFINITION : Replaces the first vocabulary in the search order with the assembler vocabulary. LONG DEFINITION : Execution replaces the first vocabulary in the search order with the ASSEMBLY vocabulary. See: VOCABULARY NAME : ATO4 PRONUNCIATION : "assembly-to-fourth" APPEARS AS : FAA7 AT__ VERSION : NMI NMIDR STACK NOTATION : ( --- n ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : STANDARD : SHORT DEFINITION : Returns address of subroutine call to high level word as indicated in D register. LONG DEFINITION : Execution returns the address of a machine code subroutine which can be used as the object of a JSR instruction to call a high level word from an assembly language routine, such as an interrupt process. The processor D register must contain the address of the CFA of the word to be executed. The processor Y register must point to free RAM since the high level word will use it as the Data Stack pointer. Program control will be returned to the instruction following the JSR after completion of the specified high level word. NAME : AUTOSTART PRONUNCIATION : "autostart" APPEARS AS : ECEA AU_______ VERSION : RSC NMI NMIDR STACK NOTATION : ( addr --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : removed from input stream. OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Prepare autostart vector at addr which will cause to be executed upon reset. Note: addr must be on a 1K byte boundary. LONG DEFINITION : Establishes autostart pattern of memory location addr. Parameter Fieled Address (CFA+2) is placed at addr+2. NAME : B/BUF PRONUNCIATION : "bytes-per-buffer" APPEARS AS : F394 B/B__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- 1024 ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Mass ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Returns a constant 1024 which is the number of bytes per block buffer. LONG DEFINITION : A constant leaving 1024, the number of bytes per block buffer. NAME : BASE PRONUNCIATION : "base" APPEARS AS : F4FA BAS_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Numeric ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Leaves the address of the user variable containing the numeric numeric conversion radix. LONG DEFINITION : The address of a user variable containing the current numeric conversion radix. NAME : BEGIN PRONUNCIATION : "begin" APPEARS AS : EF23 BEG__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ), ( --- sys ) (compiling) # ARGUMENTS IN : 0 , 0 # ARGUMENTS OUT : 0 , 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : C (I) STANDARD : F83-RWS-CL SHORT DEFINITION : Marks the start of a loop. LONG DEFINITION : Used in the form: BEGIN ... AGAIN or BEGIN ... flag UNTIL or BEGIN ... flag WHILE ... REPEAT BEGIN marks the start of a word sequence for repetitive execution. A BEGIN-UNTIL loop will be repeated until flag is true. A BEGIN-WHILE-REPEAT loop will be repeated until flag is false. The words after UNTIL or REPEAT will be executed when either loop is finished. sys is balanced with its corresponding AGAIN UNTIL or WHILE . NAME : BL PRONUNCIATION : "b-l" APPEARS AS : F646 BL VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- 32 ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Puts the ASCII code for a space (decimal 32) on the stack. LONG DEFINITION : Leave the ASCII character value for space (decimal 32). NAME : BLANKS PRONUNCIATION : "blank" APPEARS AS : F77F BLA__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr u --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Sets u bytes of memory beginning at addr to the ASCII code for space (decimal 32). LONG DEFINITION : u bytes of memory beginning at addr are set to the ASCII character value for space. No action is taken if u is zero. NAME : BLK PRONUNCIATION : "b-l-k" APPEARS AS : F548 BLK VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Mass ATTRIBUTE : U STANDARD : F83-RWS-IL SHORT DEFINITION : Leaves the address of the user variable containing the the number of block that is currently being interpreted. LONG DEFINITION : The address of a variable containing the number of the mass storage block being interpreted as the input stream. If the value of BLK is zero the input stream is taken from the text input buffer. NAME : BLOCK PRONUNCIATION : "block" APPEARS AS : F0D2 BLO__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u --- addr ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : Reads blocks. OUTPUT : May cause write of updated screen to make buffer space. GROUP : Mass ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Leaves the address of the block buffer containing block u. LONG DEFINITION : addr is the address of the assigned buffer of the first byte of block u. If the block occupying that buffer is block u and has been UPDATEd it is transfered to mass storage before assigning the buffer. If block u is not already in memory, it is transferred from mass storage into an assigned block buffer. A block may not be assigned to more than one buffer. If u is not an available block, an error condition exists. Only data within the last buffer referenced by BLOCK or BUFFER is valid. The contents of a block buffer must not be changed unless the change may be transfered to mass storage. NAME : BRANCH PRONUNCIATION : "branch" APPEARS AS : FD17 BR____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Primitive ATTRIBUTE : C STANDARD : F83-SEWS-NL SHORT DEFINITION : Compiles an unconditional branch operation. LONG DEFINITION :When used in the form: COMPILE BRANCH an unconditional branch operation is compiled. A branch address must be compiled immediately following this compilation address. The branch address is typically generated by following BRANCH with MARK . NAME : BUFFER PRONUNCIATION : "buffer" APPEARS AS : F122 BUF___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u --- addr ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : May cause write of updated screen to make buffer space. GROUP : Mass ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Assigns the block buffer and its address to block u. Leaves the address of the block buffer on the stack. LONG DEFINITION : Assigns a block buffer to block u. addr is the address of the first byte of the block within its buffer. This function is fully specified by the definition for BLOCK except that if the block is not already in memory it might not be transfered from mass storage. The contents of the block buffer assigned to block u by BUFFER are unspecified. NAME : C! PRONUNCIATION : "c-store" APPEARS AS : FDE2 C! VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b addr --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Stores the least significant byte of 16b into addr. LONG DEFINITION :The least significant 8 bits of 16b are stored into the byte at addr. NAME : C, PRONUNCIATION : "c-comma" APPEARS AS : EF63 C, VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : Compiles 8 bits of 16b. PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Stores the least significant byte of 16b into a byte at the next available dictionary location. LONG DEFINITION :ALLOT one byte then store the least-significant 8 bits of 16b at HERE 1- . NAME : C/L PRONUNCIATION : "characters-per-line" APPEARS AS : F56B C/L VERSION : RSC NMI NMIDR STACK NOTATION : ( --- n ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : SHORT DEFINITION : Maximum number of characters per line. LONG DEFINITION : Leaves the number of characters (default value = 80) per input line. NAME : C@ PRONUNCIATION : "c-fetch" APPEARS AS : FDFC C@ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr --- 8b ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Fetches the 8b contents from addr. LONG DEFINITION : 8b is the contents of the byte at addr. NAME : CFA PRONUNCIATION : "c-f-a" APPEARS AS : EE1F CFA VERSION : RSC NMI NMIDR STACK NOTATION : ( pfa --- cfa ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Alter parameter field pointer address to code field address. LONG DEFINITION : Converts the parameter field address pointer (pfa ptr) of a definition to its code field address (cfa). NAME : CMOVE PRONUNCIATION : "c-move" APPEARS AS : F7DF CMO__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr1 addr2 u --- ) # ARGUMENTS IN : 3 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Moves towards high memory the u bytes at addresses addr1 and addr2. LONG DEFINITION : Move the u bytes at addresses addr1 to addr2. The byte at addr1 is moved first, proceeding toward high memory. If u is zero nothing is moved. NAME : CMOVE> PRONUNCIATION : "c-move-up" APPEARS AS : F7B5 CMO___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr1 addr2 u --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Moves u bytes beginning at addr1 to addr2. LONG DEFINITION : Move the u bytes beginning at address addr1 to addr2. The move begins by moving the byte at (addr1 plus u minus 1) to (addr2 plus u minus 1) and proceeds to successively lower addresses for u bytes. If u is zero nothing is moved. (Useful for sliding a string towards higher addresses. NAME : CODE PRONUNCIATION : "code" APPEARS AS : E83A COD_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- sys ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : (I) STANDARD : F83-AEWS-CL SHORT DEFINITION : Creates an assembler definition. LONG DEFINITION :A defining word executed in the form: CODE ... END-CODE Creates a dictionary entry for to be defined by a following sequence of assembly language words. Words thus defined are called code definitions. This newly created word definition for cannot be found in the dictionary until the corresponding END-CODE is successfully processed. Executes ASSEMBLER . sys is balanced with its corresponding END-CODE . NAME : CODE-SUB PRONUNCIATION : "code-sub" APPEARS AS : E846 COD_____ VERSION : NMI NMIDR STACK NOTATION : ( --- sys ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : (I) STANDARD : SHORT DEFINITION : Creates an assembler definition subroutine. LONG DEFINITION : A defining word executed in the form: CODE-SUB ... END-CODE Creates a dictionary entry for to be defined by a following sequence of assembly language words. Words thus defined are called code definition subroutines. This newly created word definition for cannot be found in the dictionary until the corresponding END-CODE is successfully processed. Executes ASSEMBLER . sys is balanced with its corresponding END-CODE . can be executed directly by naming it in input stream or can be called by a machine code definition. NAME : COLD PRONUNCIATION : "cold" APPEARS AS : FEBC COL_ VERSION : RSC NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : Cleared RETURN STACK : Cleared DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : STANDARD : SHORT DEFINITION : Cold starts FORTH. LONG DEFINITION : Max-FORTH cold start. NAME : COMPILE PRONUNCIATION : "compile" APPEARS AS : EC65 COM____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from the input stream. OUTPUT : GROUP : Compiler ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Copies the compilation address of the next non-immediate word following COMPILE. LONG DEFINITION : Typically used in the form: : ... COMPILE ... ; When is executed, the compilation address compiled for is compiled and not executed. is typically immediate and is typically not immediate. NAME : CONSTANT PRONUNCIATION : "constant" APPEARS AS : F45B CON____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definiton ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Creates a dictionary entry for . LONG DEFINITION : A defining word executed in the form: 16b CONSTANT Creates a dictionary entry for so that when is later executed, 16b will be left on the stack. NAME : CONTEXT PRONUNCIATION : "context" APPEARS AS : E802 CON_____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Vocabulary ATTRIBUTE : STANDARD : F83-SEWS-IL SHORT DEFINITION : Returns the address of a user variable that determines the vocabulary to be searched first in the dictionary. LONG DEFINITION : The address of a user variable which determines the dictionary search order. NAME : CONVERT PRONUNCIATION : "convert" APPEARS AS : F54E CONT___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( +d1 addr1 --- +d2 addr2 ) # ARGUMENTS IN : 2 (3 words) # ARGUMENTS OUT : 2 (3 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Numeric ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Converts an input string into a number. LONG DEFINITION : +d2 is the result of converting the characters within the text beginning at addr1+1 into digits, using the value of BASE , and accumulating each into +d1 after multiplying +d1 by the value of BASE . Conversion continues until an unconvertible character is encountered. addr2 is the location of the first unconvertible character. NAME : COUNT PRONUNCIATION : "count" APPEARS AS : F6AE COU__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr1 --- addr2 +n ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves the address, addr2 and the character count +n of text beginning at addr1. LONG DEFINITION : addr2 is addr1+1 and n1 is the length of the counted string at addr1. The byte at addr1 contains the byte count +n. Range of +n is {0...255}. NAME : CR PRONUNCIATION : "c-r" APPEARS AS : F6DA CR VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Generates a carriage return and line feed. LONG DEFINITION : Displays a carriage return and line-feed or equivalent operation. NAME : CREATE PRONUNCIATION : "create" APPEARS AS : E896 CRE___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Creates a dictionary entry for . LONG DEFINITION : A defining word executed in the form: CREATE Creates a dictionary entry for name . After is created, the next available dictionary location is the first byte of 's parameter field. When is subsequently executed, the address of the first byte of 's parameter field is left on the stack. CREATE does not allocate space in 's parameter field. NAME : CURRENT PRONUNCIATION : "current" APPEARS AS : F551 CUR____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Vocabulary ATTRIBUTE : STANDARD : F83-SEWS-IL SHORT DEFINITION : Returns the address of the user variable specifying the vocabulary into which new word definitions will be entered. LONG DEFINITION : The address of a user variable specifying the vocabulary in which new word definitions are appended. NAME : D+ PRONUNCIATION : "d-plus" APPEARS AS : F9A4 D+ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( wd1 wd2 --- wd3 ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL F83-DNEWS-NL SHORT DEFINITION : Adds wd1 and wd2 and leaves the result, wd3 on stack. LONG DEFINITION : wd3 is the arithmetic sum of wd1 plus wd2. NAME : D- PRONUNCIATION : "d-minus" APPEARS AS : F97E D- VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( wd1 wd2 --- wd3 ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Subtracts wd2 from wd1 and returns the difference wd3. LONG DEFINITION :wd3 is the result of subtracting wd2 from wd1. NAME : D. PRONUNCIATION : "d-dot" APPEARS AS : F5B4 D. VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( d --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : Bytes below PAD modified as temporary area where +n is converted to string. INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-DNEWS-IL SHORT DEFINITION : Displays the value of d. LONG DEFINITION : The value of d is displayed in a free field format. A leading negative sign is displayed if d is negative. NAME : D.R PRONUNCIATION : "d-dot-r" APPEARS AS : F5BE D.R VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( d +n --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : Bytes below PAD modified as temporary area where +n is converted to string. INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-DNEWS-IL SHORT DEFINITION : Displays the value of d right justified in a field +n characters wide. LONG DEFINITION : d is converted using the value of BASE and then displayed right aligned in a field n characters wide. A leading minus sign is displayed if d is negative. If the number of characters required to display d is greater than +n, an error condition exists. NAME : D< PRONUNCIATION : "d-less-than" APPEARS AS : F96E D< VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( d1 d2 --- flag ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 1 (1 word) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-RWS-NL F83-DNEWS-NL SHORT DEFINITION : Leaves a true flag if d1 is less than d2; otherwise leaves a false flag. LONG DEFINITION : Flag is true if d1 is less than d2 according to the operation of < except extended to 32 bits. NAME : D= PRONUNCIATION : "d-equals" APPEARS AS : F95E D= VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( wd1 wd2 --- flag ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 1 (1 word) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Returns a true flag if wd1 is equal to wd2. LONG DEFINITION : flag is true if wd1 equals wd2. NAME : D>F PRONOUNCIATION : d-to-f APPEARS AS : D4BD D>F VERSION : STACK NOTATION : (d--) (f: -- R) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R is the floating-point equivalent of d. LONG DEFINITION : R is the floating-point equivalent of d. A double number can be exactly represented by the 32 bit manissa of the internal representation. NAME : D0= PRONUNCIATION : "d-zero-equals" APPEARS AS : F966 D0= VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( wd --- flag ) # ARGUMENTS IN : 1 (2 words) # ARGUMENTS OUT : 1 (1 word) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Returns a true flag if wd is equal to zero. LONG DEFINITION : flag is true if wd is zero. NAME : D2/ PRONUNCIATION : "d-two-divide" APPEARS AS : F903 D2/ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( d1 --- d2 ) # ARGUMENTS IN : 1 (2 words) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Divides d1 by 2 and gives quotient d2. LONG DEFINITION : d2 is the result of d1 arithmetically shifted right one bit. The sign is included in the shift and remains unchanged. NAME : DABS PRONUNCIATION : "d-absolute" APPEARS AS : F93E DAB_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( d --- ud ) # ARGUMENTS IN : 1 (2 words) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Returns the absolute value of d as ud. LONG DEFINITION : ud is the absolute value of d. If d is -2,147,483,648 then ud is the same value. NAME : DECIMAL PRONUNCIATION : "decimal" APPEARS AS : F4C2 DEC____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Numeric ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Sets the input-output numeric conversion base to ten. LONG DEFINITION : Set the input-output numeric conversion base to ten. NAME : DEFINITIONS PRONUNCIATION : "definitions" APPEARS AS : E9DC DEF________ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Vocabulary ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Specify the vocabulary into which new definitions are to be added. LONG DEFINITION : The compilation vocabulary is changed to be the same as the first vocabulary in the search order. NAME : DEPTH PRONUNCIATION : "depth" APPEARS AS : FA19 DEP__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- +n ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Returns count +n of numbers on the data stack. LONG DEFINITION : +n is the number of 16-bit values contained in the data stack before +n was placed on the stack. NAME : DLITERAL PRONUNCIATION : "d-literal" APPEARS AS : EA9F DL______ VERSION : STACK NOTATION : ( 32b --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : I C STANDARD : SHORT DEFINITION : Compile a system dependent operation so that when later executed, 32b will be left on the stack. LONG DEFINITION : Typically used in the form: [ 32b ] DLITERAL Compiles a system dependent operation so that when later executed, 32b will be left on the stack. NAME : DMAX PRONUNCIATION : "d-max" APPEARS AS : F918 DMAX VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( d1 d2 --- d3 ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Returns d3 as the greater of d1 or d2. LONG DEFINITION : d3 is the greater of d1 and d2. NAME : DMIN PRONUNCIATION : "d-min" APPEARS AS : F92A DMI_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( d1 d2 --- d3 ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Returns d3 as the lesser of d1 or d2. LONG DEFINITION : d3 is the lesser of d1 and d2. NAME : DNEGATE PRONUNCIATION : "d-negate" APPEARS AS : F952 DNEG___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( d1 --- d2 ) # ARGUMENTS IN : 1 (2 words) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL F83-DNEWS-NL SHORT DEFINITION : Leaves the two's complement d2 of d1. LONG DEFINITION : d2 is the two's complement of d1. NAME : DO PRONUNCIATION : "do" APPEARS AS : EE55 DO VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( w1 w2 --- ), ( --- sys ) (compiling) # ARGUMENTS IN : 2 , 0 # ARGUMENTS OUT : 0 , 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : C (I) STANDARD : F83-RWS-CL SHORT DEFINITION : Repeats execution of words between DO LOOPs and DO +LOOPs, the number of times is specified by the limit from w2 to w1. LONG DEFINITION : Used in the form: DO ... LOOP or DO ... +LOOP Begins a loop which terminates based on control parameters. The loop index begins at w2, and terminates based on the limit w1. See LOOP and +LOOP for details on how the loop is terminated. The loop is always executed at least once. For example: w DUP DO ... LOOP executes 65,536 times. sys is balanced with its corresponding LOOP or +LOOP . An error condition exists if insufficient space is available for at least three nesting levels. NAME : DOES> PRONUNCIATION : "does" APPEARS AS : F32A DOE__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ), ( --- ) (compiling) # ARGUMENTS IN : 0 , 0 # ARGUMENTS OUT : 1 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Definition ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Marks the termination of the defining part of the defining word and begins the definition of the run-time action for words that will later be defined by . LONG DEFINITION : Defines the execution time action of a word created by a high level defining word. Used in the form: : ... ... DOES> ... ; and then where is CREATE or any user defined word which executes CREATE . Marks the termination of the defining part of the defining word and then begins the definition of the execution-time is later executed, the address of 's parameter field is placed on the stack and then the sequence of words between DOES> and ; are executed. NAME : DP PRONUNCIATION : "d-p" APPEARS AS : F506 DP VERSION : RSC NMI NMIDR STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : U STANDARD : SHORT DEFINITION : Put Dictionary Pointer address on stack. LONG DEFINITION : Leaves the address of user variable, the dictionary pointer, which points to address the next free memory address above the dictionary. The value may be read by HERE and altered by ALLOT . NAME : DPL PRONUNCIATION : "d-p-l" APPEARS AS : F53C DPL VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Format ATTRIBUTE : U STANDARD : F83-URW SHORT DEFINITION : Returns the address of the user variable containing the number of places after the fractional point for input conversion. LONG DEFINITION : Returns the address of the user variable containing the number of places after the fractional point for input conversion. NAME : DROP PRONUNCIATION : "drop" APPEARS AS : FD7F DRO_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Removes 16b from the data stack. LONG DEFINITION : 16b is removed from the data stack. NAME : DU< PRONUNCIATION : "d-u-less" APPEARS AS : F976 DU< VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( ud1 ud2 --- flag ) # ARGUMENTS IN : 2 (4 words) # ARGUMENTS OUT : 1 (1 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-DNEWS-NL SHORT DEFINITION : Returns a true flag if ud1 is less than ud2. LONG DEFINITION :flag is true if ud1 is less than ud2. Both numbers are unsigned. NAME : DUMP PRONUNCIATION : "dump" APPEARS AS : F1EC DUM_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr u --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Displays u bytes of memory starting at addr. LONG DEFINITION : List the contents of u addresses starting at addr. Each line of values may be preceded by the address of the first value, with a 16 memory location displayed per line. NAME : DUP PRONUNCIATION : "dup" APPEARS AS : FD8B DUP VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- 16b 16b ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Duplicates 16b. LONG DEFINITION :Duplicates the 16b on top of the data stack to the top of the data stack. NAME : e PRONUNCIATION : "e" APPEARS AS : D6AE e VERSION : V3.5 STACK NOTATION : ( --- ) (F: --- r ) # ARGUMENTS IN : # ARGUMENTS OUT : RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Floating Point ATTRIBUTE : STANDARD : SHORT DEFINITION : Put natural value e on stack as r1. LONG DEFINITION :Returns natural value of e on Floating Point Stack. 2.718282 NAME : : E. PRONOUNCIATION : e-dot APPEARS AS : DA05 E. VERSION : STACK NOTATION : (---) (F: r---) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Convert the top number on the floating-point stack to its character string representation using the scientific notation. LONG DEFINITION : Convert the top number on the floating-point stack to its character string representation using the scientific notation. The character string produced will be exactly the same as that generated by the floating-point operator E.. Scientific notation has the format [-]mantissa e[-] exponent where the mantissa contains a radix point with the most sigificant digit to the left the point, zero or more trailing digits, and the exponent with one or more trailing digits. The exact number of digits to the right of the radix place in the mantissa is determined by PLACES. The exponent consists of an optional sign and enough decimal digits to represent the exponent. An exception exists if the system basis is not DECIMAL. For example, the sequenc 4 PLACES 123.0e0 E. will display 1.2300e2 NAME : EDITOR PRONUNCIATION : "editor" APPEARS AS : E9EE ED____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Vocabulary ATTRIBUTE : (I) STANDARD : F83-CRW SHORT DEFINITION : Makes the editor vocabulary the first to be searched. LONG DEFINITION : Execution replaces the first vocabulary in the search order with EDITOR vocabulary. See: VOCABULARY NAME : EEC! PRONUNCIATION : "e-e-c-store" APPEARS AS : F3C0 EEC_ VERSION : NMI NMIDR STACK NOTATION : ( 16b addr --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : SHORT DEFINITION :Stores the least significant byte of 16b into addr in EEPROM. LONG DEFINITION :The addr in EEPROM is erased, then least significant 8 bits of 16b are programmed into the byte at addr. The time period of the programming is set by C/10MS and Timer Output Capture for both the erasure and programming cycles. NAME : EEMOVE PRONUNCIATION : "e-e-move" APPEARS AS : F398 EEM___ VERSION : NMI NMIDR STACK NOTATION : ( addr1 addr2 u --- ) # ARGUMENTS IN : 3 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : SHORT DEFINITION : Moves towards high memory the u bytes at addresses addr1 and addr2. addr2 should be in EEPROM. LONG DEFINITION : Move the u bytes at addresses addr1 to addr2. The byte at addr1 is moved first, proceeding toward high memory. If u is zero, nothing is moved. addr2 should be in EEPROM. EEC! is used to accomplish this function. See EEC! NAME : EEWORD PRONUNCIATION : "e-e-word" APPEARS AS : ED44 EEW___ VERSION : NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY :If not headerless, the complete definition or if headerless, the code field and parameter field, of latest definition move from code to EEPROM dictionary. PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : SHORT DEFINITION : Moves code of last defined word from the codes memory to the EEPROM memory. LONG DEFINITION : Latest defined word's complete definition if not headerless, or the code section if headerless is lifted from codes dictionary, relinked and placed in the EEPROM dictionary. Dictionary pointers are re-adjusted accordingly. NAME : ELSE PRONUNCIATION : "else" APPEARS AS : EF2D ELS_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ), ( sys1 --- sys2 ) (compiling) # ARGUMENTS IN : 0 , 1 # ARGUMENTS OUT : 0 , 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Allows execution of words between IF and ELSE if the flag is true, otherwise, it forces execution of words after ELSE. LONG DEFINITION : Used in the form: flag IF ... ELSE ... THEN ELSE executes after the true part following IF . ELSE forces execution to continue at just after THEN . sys1 is balanced with its corresponding IF . sys2 is balanced with its corresponding THEN . See: IF THEN . NAME : EMPTY-BUFFERS PRONUNCIATION : "empty-buffers" APPEARS AS : F16C EM___________ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Mass ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Removes the update status and removes assignments of all blocks to buffers. LONG DEFINITION : Unassign all block buffers. UPDATEd blocks are not written to mass storage. See: BLOCK . NAME : EMIT PRONUNCIATION : "emit" APPEARS AS : F8F0 EMI_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Displays the ASCII equivalent of 16b onto the screen. LONG DEFINITION : The least significant 7-bit ASCII character is displayed. NAME : END PRONUNCIATION : "end" APPEARS AS : EF15 END VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( flag --- ), ( sys --- ) (compiling) # ARGUMENTS IN : 1 , 1 # ARGUMENTS OUT : 0 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : I C STANDARD : F83-CRW SHORT DEFINITION : Performs the same function as UNTIL . See UNTIL . LONG DEFINITION : A synonym for UNTIL . NAME : END-CODE PRONUNCIATION : "end-code" APPEARS AS : E82A END-C___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( sys --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Definition ATTRIBUTE : (I) STANDARD : F83-AEWS-CL SHORT DEFINITION : Terminates an assembler definition. LONG DEFINITION : Terminates a code definition and allows the of the corresponding code definition to be found in the dictionary. sys is balanced with its corresponding CODE or ;CODE . NAME : ERASE PRONUNCIATION : "erase" APPEARS AS : F787 ERA__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr u --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Sets u bytes of memory to zero, beginning at addr. LONG DEFINITION : u bytes of memory beginning at addr are set to zero. No actionis taken if u is zero. NAME : ERROR PRONUNCIATION : "error" APPEARS AS : EB2D ERR__ VERSION : V3.5 STACK NOTATION : ( n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : STANDARD : SHORT DEFINITION : Prints error message n then calls returns to system operation. LONG DEFINITION : Performs error action and returns to system operation. If WARNING is less-than-0 ERROR calls error processing routine pointed to by user variable UABORT without first issuing a message. Default value of UABORT is ABORT. If WARNING is 0 or greater-than-0 prints error message n. If WARNING is zero, the message will simply be printed as a number (mass storage unavailable). Default value 0 selectects action printing an error message number n. A value greater than 0 assumes that a disk (RAMdsk) is in use, takes screen 4 as adjusted by OFFSET and indexes into it for line to show with error. n may be positive or negative. After the message action ERROR calls QUIT. NAME : EXECUTE PRONUNCIATION : "execute" APPEARS AS : FAEA EXE____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Executes the definition found at addr. LONG DEFINITION : The word definition indicated by addr is executed. An error condition exists if addr is not a compilation address. NAME : EXIT PRONUNCIATION : "exit" APPEARS AS : FEB6 EXI_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Causes execution to leave the current word and go back to where the word was called from. LONG DEFINITION : Compiled within a colon definition such that when executed, that colon definition returns control to the definition that passed control to it by returning control to the return point on the top of the return stack. An error condition exists if the top of the return stack does not contain a valid return point. May not be used within a do-loop. NAME : EXPECT PRONUNCIATION : "expect" APPEARS AS : F6E8 EXP___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr +n --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Stores up to +n characters into memory beginning at addr. LONG DEFINITION : Receive characters and store each into memory. The transfer begins at addr proceeding towards higher addresses one byte per character until either "return" is received or until +n characters have been transfered. No more than +n characters will be stored. The "return" is not stored into memory. No characters are received or transfered if +n is zero. All characters actually received and stored into memory will be displayed, with the "return" displaying as a space. NAME : F! PRONOUNCIATION : f-store APPEARS AS : D632 F! VERSION : STACK NOTATION : (addr--) (F:r--) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Store r at addr. LONG DEFINITION : Store r at addr using the 6 byte internal format. (Also see SF!) NAME : F* PRONOUNCIATION : f-star APPEARS AS : D288 F* VERSION : STACK NOTATION : (F: r1 r2 -- r3) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Multiply r1 by r2 giving r3. LONG DEFINITION : Multiply r1 by r2 giving r3. NAME : F** PRONUNCIATION : "f-star-star" APPEARS AS : D93F F** VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 r2 --- r3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : Raises r1 to the r2 power giving r3. LONG DEFINITION : Floating Point number r3 is result of raising r1 to the power of r2. NAME : F+ PRONOUNCIATION : f-plus APPEARS AS : D20D F+ VERSION : STACK NOTATION : (F: r1 r2 -- r3) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Add r1 to r2, giving r3. LONG DEFINITION : Add r1 to r2, giving r3. NAME : F, PRONUNCIATION : "f-comma" APPEARS AS : D655 F, VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : 3 Words pointed to by DP prior to execution are modified. PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Reserves space in the dictionary for Floating Point literal. LONG DEFINITION : Compile r1 as floating point value in next open dictionary location. NAME : F- PRONOUNCIATION : f-minus APPEARS AS : D279 F- VERSION : STACK NOTATION : (F: r1 r2 -- r3) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Subtract r2 from r1, giving r3. LONG DEFINITION : Subtract r2 from r1, giving r3. NAME : F. PRONUNCIATION : "f-dot" APPEARS AS : D9FB F. VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : SHORT DEFINITION : Convert the top number on the Floating-Point Stack to its character string representation using the fixed-point notation. LONG DEFINITION : Displays the Floating Point value on the top of the Floating Point Stack according to the current BASE , using Floating Point fixed-point notation. See also PLACES . NAME : F.S PRONUNCIATION : "f-dot-s" APPEARS AS : DA63 F.S VERSION : V3.5 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : SHORT DEFINITION : Display Floating Point Stack contents without modifying the stack. LONG DEFINITION : Displays the contents of the Floating Point Stack without altering the stack. This word is very useful in determining the Floating Point Stack contents when debugging programs. NAME : F/ PRONOUNCIATION : f-slash APPEARS AS : D39E F/ VERSION : STACK NOTATION : (F: r1 r2 -- r3) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Divide r1 by r2, giving r3. LONG DEFINITION : Divide r1 by r2, giving r3. NAME : F< PRONOUNCIATION : f-less-than APPEARS AS : D5C8 F< VERSION : STACK NOTATION : (--flag) (F: r1 r2 --) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : flag is true if r1 is less than r2. LONG DEFINITION : flag is true if r1 is less than r2. NAME : F>D PRONOUNCIATION : f-to-d APPEARS AS : D516 F>D VERSION : STACK NOTATION : (--d) (F:r--) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Convert r to d. LONG DEFINITION : d is the double-cell signed integer equivalent of the integer portion of r; the fractional portion of r is discarded. An exception exists if the integer portion of r cannot be represented as a double-cell signed integer and the maximum value for a double-cell (with correct sign) is returned. NAME : F? PRONUNCIATION : "f-question-mark" APPEARS AS : DAC2 F? VERSION : V3.5 STACK NOTATION : ( addr --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : SHORT DEFINITION : Displays the floating point contents stored at addr. LONG DEFINITION : Displays the Floating Point value contained at the address on the top of the stack according to the current BASE , using Floating Point fixed-point notation. Uses the format of F. . NAME : F@ PRONOUNCIATION : f-fetch APPEARS AS : D60B F@ VERSION : STACK NOTATION : (addr--) (F:r--) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : r is the value stored at addr. LONG DEFINITION : r is the value stored at addr in the 6 byte internal format. (Also see SF@) NAME : F0< PRONOUNCIATION : f-zero-less-than APPEARS AS : D5AC F0< VERSION : STACK NOTATION : (F: r --) (--flag) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : flag is true if r is less than zero. LONG DEFINITION : flag is true if r is less than zero. NAME : F0= PRONOUNCIATION : f-zero-equals APPEARS AS : D590 F0= VERSION : STACK NOTATION : # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : flag is true if r is equal to zero. LONG DEFINITION : flag is true if r is equal to zero. The test is performed by checking the most significant bit of the mantissa. Any non-zero number will have this bit set. NAME : F2* PRONUNCIATION : "f-two-times" APPEARS AS : DA9A F2* VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 --- r2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : Multiplies r1 by 2 to give r2. LONG DEFINITION : Exponent portion of floaing point number is incremented. r2 is the equivalent result of shifting r1 left one bit. NAME : F2/ PRONUNCIATION : "f-two-slash" APPEARS AS : DAA4 F2/ VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 --- r2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : Divides r1 by 2 to give r2. LONG DEFINITION : Exponent portion of floaing point number is deremented. r2 is the equivalent result of shifting r1 right one bit. NAME : FABS PRONOUNCIATION : f-abs APPEARS AS : D5FC FABS VERSION : STACK NOTATION : (F: r -- r2) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R2 is the absolute value of r1. LONG DEFINITION : R2 is the absolute value of r1. NAME : FALOG PRONOUNCIATION : f-a-log APPEARS AS : D92F FALO_ VERSION : STACK NOTATION : (F: r1 -- r2) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Raise 10 to the power r1, giving r2. LONG DEFINITION : Raise 10 to the power r1, giving r2. NAME : FATAN PRONOUNCIATION : f-a-tan APPEARS AS : DB79 FATA_ VERSION : STACK NOTATION : (F: r1 -- r2) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R2 is the principal radian whose tangent is r1. LONG DEFINITION : R2 is the principal radian whose tangent is r1. NAME : FATAN2 PRONOUNCIATION : f-a-tan-two APPEARS AS : DBAD FATA__ VERSION : STACK NOTATION : (F: r1 r2 -- r3 ) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R3 is the radian angle whose tangent is r1/r2. LONG DEFINITION : R3 is the radian angle whose tangent is r1/r2. The signs of r1 and r2 determine which quadrant contains r3. NAME : FCONSTANT PRONOUNCIATION : f-constant APPEARS AS : D662 FCON_____ VERSION : STACK NOTATION : (F:r--) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from the input stream. OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Define a constant with value r. LONG DEFINITION : Parse delimited by a space, ignoring leading delimiters. Create a dictionary entry for as defined below. is refered to as an "f-constant." Execution semantics for : (--) (F:--r) Place r on the floating-point stack. NAME : FCOS PRONOUNCIATION : f-cos APPEARS AS : DC21 FCOS VERSION : STACK NOTATION : (F: r1 -- r2 ) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : r2 is the cosine of the radian angle r1. LONG DEFINITION : r2 is the cosine of the radian angle r1. NAME : FDEPTH PRONOUNCIATION : f-depth APPEARS AS : D006 FDEP__ VERSION : STACK NOTATION : (-- +n) # ARGUMENTS IN : 0 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : +n is the number of values contained on separate floating point stack. LONG DEFINITION : +n is the number of values contained on separate floating point stack. NAME : FDROP PRONOUNCIATION : f-drop APPEARS AS : D0A5 FDRO_ VERSION : STACK NOTATION : (F: r--) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Remove r from the floating-point stack. LONG DEFINITION : Remove r from the floating-point stack. NAME : FDUP PRONOUNCIATION : f-dupe APPEARS AS : D03E FDUP VERSION : STACK NOTATION : (F: r -- r r) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Duplicate r. LONG DEFINITION : Duplicate r. NAME : FEXP PRONOUNCIATION : f-exp APPEARS AS : D91F FEXP VERSION : STACK NOTATION : (F: r1 -- r2 ) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Raise e to the power r1, giving r2. LONG DEFINITION : Raise e to the power r1, giving r2. NAME : FILL PRONUNCIATION : "fill" APPEARS AS : F78F FIL_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr u 8b --- ) # ARGUMENTS IN : 3 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Fills u bytes, beginning at addr, with byte pattern 8b. LONG DEFINITION : u bytes of memory beginning at addr are set to 8b. No action is taken if u is zero. NAME : FIND PRONUNCIATION : "find" APPEARS AS : EBC1 FIN_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr1 --- addr2 n ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Obtains an address of counted strings, addr1 from the stack. Searches the dictionary for the string. LONG DEFINITION : addr1 is the address of the counted string. The string contains a word name to be located in the currently active search order. If the word is not found, addr2 is the string address (addr1) and n is zero. If the word is found, addr2 is the compilation address and n is set to one of two non-zero values. If the word found has the immediate attribute, n is set to one. If the word is non-immediate, n is set to minus 1 (true). NAME : FIRST PRONUNCIATION : "first" APPEARS AS : F1C8 FIR__ VERSION : RSC NMI NMIDR STACK NOTATION : ( --- n ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Mass ATTRIBUTE : STANDARD : SHORT DEFINITION : Leaves address of first block buffer. LONG DEFINITION : Leaves the first (lowest) address of the data (or mass storage buffer). NAME : FLUSH PRONUNCIATION : "flush" APPEARS AS : F0B2 FL___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : Writes updated blocks. GROUP : Mass ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Performs the functions of the SAVE-BUFFERS then unassign all block buffers. LONG DEFINITION : Performs the function of SAVE-BUFFERS then unassigns all block buffers. (This may be useful for mounting or changing mass storage media) NAME : FLD PRONUNCIATION : "f-l-d" APPEARS AS : F53F FLD VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Returns the address of the user variable which contains the value of the field length reserved for a number during output conversion. LONG DEFINITION : A user variable pointing to the field length reserved for a number during output conversion. NAME : FLITERAL PRONOUNCIATION : f-literal APPEARS AS : D729 FLIT____ VERSION : STACK NOTATION : (F:r --) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : I C STANDARD : ANSI basis 13 SHORT DEFINITION : Compile r as a floating point literal. LONG DEFINITION : Compile r as a floating point literal. Syntax: [ r ] FLITERAL Compilation semantics; Compile floating-point number as a floating-point literal Execution semantics; Place r on the floating-point stack. NAME : FLN PRONOUNCIATION : f-l-n APPEARS AS : D88E FLN VERSION : STACK NOTATION : (F: r1 -- r2 ) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R2 is the natural logarithm of r1. LONG DEFINITION : R2 is the natural logarithm of r1. NAME : FLOAT+ PRONOUNCIATION : float-plus APPEARS AS : D684 FLOAT+ VERSION : STACK NOTATION : ( addr1-- addr2) # ARGUMENTS IN : 0 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Add 6 to addr1. LONG DEFINITION : Add the size of a floating point number to the address on top of the data stack. This should not be used for IEEE single format storage. NAME : FLOATS PRONOUNCIATION : floats APPEARS AS : D67B FLOATS VERSION : STACK NOTATION : ( n1 -- n2) # ARGUMENTS IN : 0 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : n2 is the size, in bytes, of n1 floating-point numbers. LONG DEFINITION : n2 is 6 * n1, where 6 is the size, in bytes, of a floating point number in internal format. This should not be used for IEEE single format storage. NAME : FLOG PRONOUNCIATION : f-log APPEARS AS : D87E FLOG VERSION : STACK NOTATION : (F: r1 -- r2 ) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R2 is the base 10 logarithm of r1. LONG DEFINITION : R2 is the base 10 logarithm of r1. NAME : FLOOR PRONOUNCIATION : floor APPEARS AS : D7C4 FLOO_ VERSION : STACK NOTATION : (F: r1 -- r2) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Round r1 using the "round to negative infinity" rule, giving r2. LONG DEFINITION : Round r1 using the "round to negative infinity" rule, giving r2. (Also see FROUND) NAME : FMAX PRONOUNCIATION : "f-max" APPEARS AS : D5D0 FMAX VERSION : STACK NOTATION : (F: r1 r2 -- r3) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : r3 is the maximum of r1 and r2. LONG DEFINITION : r3 is the maximum of r1 and r2. NAME : FMIN PRONOUNCIATION : fmin APPEARS AS : D5E6 FMIN VERSION : STACK NOTATION : (F: r1 r2 -- r3) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : r3 is the minimum of r2 and r3. LONG DEFINITION : r3 is the minimum of r2 and r3. NAME : FNEGATE PRONOUNCIATION : f-negate APPEARS AS : D583 FNEG___ VERSION : STACK NOTATION : (F: r1 -- r2) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : r2 is the negation of r1. LONG DEFINITION : r2 is the negation of r1. NAME : FNIP PRONUNCIATION : "f-nip" APPEARS AS : D023 FNIP VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 r2 --- r2 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : SHORT DEFINITION : Remove second number down from floating-point stack. LONG DEFINITION : r1, below r2, is removed from the Floating Point Stack leaving R2. NAME : FNUMBER PRONUNCIATION : "f-number" APPEARS AS : DA0F FNUM___ VERSION : V3.5 STACK NOTATION : ( addr --- d ) DPL=>0 or (F: ---r1) DPL<0 # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : SHORT DEFINITION : Converts the counted string at addr to d1 or r1. LONG DEFINITION : Convert the counted character string at addr. Count of counted string is not used. Conversion begins at addr + 1. String is converted to a signed 32-bit integer, using the value of BASE . DPL is set according to the string contents. DPL will indicate location of any decimal point counted from right end of string if number is integer. If number is real, i.e. if it contains lower case "e" separating mantissa from exponent, DPL will be set to -1. The floating point value will be left on the Floating Point Stack. If numeric conversion is not possible, an error condition exists. The string may contain a preceding minus sign. (FNUMBER function is similar to INPUT in BASIC.) NAME : FORTH PRONUNCIATION : "forth" APPEARS AS : E9F6 FO___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Vocabulary ATTRIBUTE : (I) STANDARD : F83-RWS-IL SHORT DEFINITION : Replaces the first vocabulary in the search order with FORTH. LONG DEFINITION : The name of the primary vocabulary. Execution replaces the first vocabulary in the search order with FORTH . FORTH is initially the compilation vocabulary and the first vocabulary in the search oder. New definitions become part of FORTH vocabulary until adifferent compilation vocabulary is established. See: "VOCABULARY" NAME : FORGET PRONUNCIATION : "forget" APPEARS AS : E943 FO____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : Removes multiple definitions, DP is "backed up". PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Deletes from the dictionary. LONG DEFINITION : Used in the form: FORGET . If is found in the compilation vocabulary, delete from the dictionary and all words added to the dictioanry after regardless of their vocabulary. Failure to find is an error condition. An error condition also exists if the compilation vocabulary is deleted. NAME : FORTH-83 PRONUNCIATION : "forth-eighty-three" APPEARS AS : F88F FORTH-83 VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Vocabulary ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Initializes FORTH-83 into the system. LONG DEFINITION : Assures that a FORTH-83 Standard System is available, otherwise an error condition exists. Execution has no action other than an immediate return to calling routine. NAME : FOVER PRONOUNCIATION : f-over APPEARS AS : D057 FOVE_ VERSION : STACK NOTATION : (F: r1 r2 -- r1 r2 r1 ) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 3 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Place a copy of r1 on top of the floating-point stack. LONG DEFINITION : Place a copy of r1 on top of the floating-point stack. NAME : FROUND PRONOUNCIATION : f-round APPEARS AS : D739 FROU__ VERSION : STACK NOTATION : (F: r1 -- r2) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Round r1 using the "round to even" rule, giving r2. LONG DEFINITION : Round r1 using the "round to even" rule, giving r2. NAME : FSIN PRONOUNCIATION : f-sin APPEARS AS : DBD3 FSIN VERSION : STACK NOTATION : (F: r1 -- r2 ) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R2 is the sine of the radian angle r1. LONG DEFINITION : R2 is the sine of the radian angle r1. NAME : FSP PRONUNCIATION : "floating-point-stack-pointer" APPEARS AS : D003 FSP VERSION : V3.5 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : U STANDARD : SHORT DEFINITION : User variable holds Floating Point Stack Pointer. LONG DEFINITION : A user variable containing the Floating Point Stack Pointer. Returns the address of the variable containing the current value of the Floating Point Stack Pointer. NAME : FSP0 PRONUNCIATION : "f-s-p-zero" APPEARS AS : D000 FSP0 VERSION : V3.5 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : U STANDARD : F83-URW SHORT DEFINITION : User variable holds initial value of Floating Point Stack Pointer. LONG DEFINITION :A user variable containing the address of the bottom of the Floating Point Stack. NAME : FSQRT PRONUNCIATION : "f-square-root" APPEARS AS : DAAE FSQR_ VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 --- r2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : R2 is the square root of r1. LONG DEFINITION : Floating Point number r2 is result of raising r1 to the power of .5 so r2 is the square root of r1. NAME : FSWAP PRONOUNCIATION : f-swap APPEARS AS : D070 FSWA_ VERSION : STACK NOTATION : (F: r1 r2 -- r2 r1 ) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Exchange the top two floating-point stack items. LONG DEFINITION : Exchange the top two floating-point stack items. NAME : FTAN PRONOUNCIATION : f-tan APPEARS AS : DC2B FTAN VERSION : STACK NOTATION : R2 is the sine of the radian angle r1. # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R2 is the tangent of the radian angle r1. LONG DEFINITION : R2 is the tangent of the radian angle r1. NAME : FVARIABLE PRONOUNCIATION : f-variable APPEARS AS : D66E FVAR_____ VERSION : STACK NOTATION : ( -- ) # ARGUMENTS IN : 0 # ARGUEMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Create a floating-point variable LONG DEFINITION : Parse delimited by a space, ignoring leading delimiters. Create a dictionary entry for . is refered to as an "f-variable." Reserve 1 FLOATS bytes of data memory in the dictionary. Execution semantics for name: ( -- addr ) The application is reponsible for initializing the contents of the reserved memory. NAME : H/C PRONUNCIATION : "h-slash-c" APPEARS AS : EDB2 H/C VERSION : RSC NMI NMIDR STACK NOTATION : ( addr --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY :Separates heads and codes dictionaries for all successive definitions. PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Separate heads and codes portions of definition to different place in memory. LONG DEFINITION : Separates heads and codes dictionary. Heads are set to generate at addr. DP/ is assigned this addr. Codes are set to generate at value of DP prior to execution. HEADERLESS is set to true. Results are displayed for verification. NAME : HERE PRONUNCIATION : "here" APPEARS AS : EF83 HER_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Leaves the address of the next available dictionary location. LONG DEFINITION : The address of the next available dictionary location is left on the stack. NAME : HEX PRONUNCIATION : "hex" APPEARS AS : F4CB HEX VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Numeric ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Sets the numeric input-output conversion base to sixteen. LONG DEFINITION : Set the numeric input-output conversion base to sixteen. NAME : HOLD PRONUNCIATION : "hold" APPEARS AS : F5DC HOL_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( char --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : Modification of string below PAD . INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Inserts character into a pictured numeric output string. LONG DEFINITION : char is inserted into a pictured numeric output string. Typically used between <# and #> . NAME : HWORD PRONUNCIATION : "h-word" APPEARS AS : ED00 HW___ VERSION : RSC NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : The code field and parameter field of latest definition move from code to heads dictionary. PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Moves codes portion of last defined word from the codes memory to the heads memory. LONG DEFINITION : Latest defined word's code section is lifted from codes dictionary, relinked and placed in the heads dictionary. Dictionary pointers are re-adjusted accordingly. NAME : I PRONUNCIATION : "i" APPEARS AS : FAD2 I VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- w ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Places the loop index onto the stack. LONG DEFINITION : w is the copy of the loop index. May only be used in the form: DO ... I ... LOOP or DO ... I ... +LOOP . NAME : ID. PRONUNCIATION : "i-d-dot" APPEARS AS : EAE3 ID. VERSION : RSC NMI NMIDR STACK NOTATION : ( nfa --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : SHORT DEFINITION : Print given name field address (NFA). LONG DEFINITION : Prints a definition's name from it's name field address. NAME : IF PRONUNCIATION : "if" APPEARS AS : EF4F IF VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( flag --- ), ( --- sys ) (compiling) # ARGUMENTS IN : 1 , 0 # ARGUMENTS OUT : 0 , 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : (I) STANDARD : F83-RWS-CL SHORT DEFINITION : Allows a program to branch on condition. LONG DEFINITION : Used in the form: flag IF ... ELSE ... THEN or flag IF ... THEN If flag is true, the words following IF are executed and the words following ELSE until just after THEN are skipped. The ELSE part is optional. If flag is false, words from IF through ELSE , or from IF through THEN (when no ELSE is used) are skipped. sys is balanced with its corresponding ELSE or THEN . NAME : IMMEDIATE PRONUNCIATION : "immediate" APPEARS AS : EA00 IM_______ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Marks the most recently created dictionary entry as a word that will be executed immediately even if FORTH is in compile mode. LONG DEFINITION : Marks the most recently created dictionary entry as a word which will be executed when encountered during compilation rather than compiled. NAME : INDEX PRONUNCIATION : "index" APPEARS AS : EFCE IND__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u1 u2 --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : Reads blocks. OUTPUT : Lists lines to terminal, may cause write of updated screen to make buffer space. GROUP : Mass ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Displays the top line from each block in a range of blocks starting at block u1 to u2. LONG DEFINITION : Print the first line of each screen over the range {u1...u2}. This displays the first line of each screen of source text, which conventionally contains a title. NAME : INTERPRET PRONUNCIATION : "interpret" APPEARS AS : E75E INT______ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Begins text interpretation at the character indexed by the contents of >IN relative to the block number contained in BLK, continuing until the input stream is exhausted. LONG DEFINITION : Begin text interpretation at the character indexed by the contents of >IN relative to the block number contained in BLK , continuing until the input stream is exhausted. If BLK contains zero, interpret characters from the text input buffer. NAME : J PRONUNCIATION : "j" APPEARS AS : FADA J VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- w ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Returns the index of the next outer loop. LONG DEFINITION : w is a copy of the index of the next outer loop. May only be used within a nested DO-LOOP or DO-+LOOP in the form, for example: DO ... DO ... J ... LOOP ... +LOOP NAME : K PRONUNCIATION : "k" APPEARS AS : FAE2 K VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- w ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Returns the index of the second outer loop in nested do loops. LONG DEFINITION : w is the copy of the index of the second outer loop. May only be used within a nested DO-LOOP or DO-+LOOP in the form for example: DO ... DO ... DO ... K ... LOOP ... +LOOP ... LOOP NAME : KEY PRONUNCIATION : "key" APPEARS AS : F8F8 KEY VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- 16b) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Pauses to wait for a key to be pressed and then places the ASCII value of the key (n) on the stack. LONG DEFINITION : The least-significant 7 bits of 16b is the next ASCII character received. All valid ASCII characters can be received. Control characters are not processed by the system for any editing purpose. Characters received by KEY will not be displayed. NAME : LATEST PRONUNCIATION : "latest" APPEARS AS : EF5B LAT___ VERSION : RSC NMI NMIDR STACK NOTATION : ( --- nfa ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Leaves name field address (nfa) of top word in CURRENT. LONG DEFINITION : Leaves the name field address of the top-most word in the CURRENT vocabulary. NAME : LEAVE PRONUNCIATION : "leave" APPEARS AS : EEA3 LEA__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : Removal of loop control parameters (2 words) DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : (I) STANDARD : F83-RWS-CL SHORT DEFINITION : Forces termination of a DO LOOP. LONG DEFINITION : Transfers execution to just beyond the next LOOP or +LOOP . The loop is terminated and loop control parameters are discarded. May only be used in the form: DO ... LEAVE ... LOOP or DO ... LEAVE ... +LOOP LEAVE may appear within other control structures which are nested within the do-loop structure. More than one LEAVE may appear within a do-loop. NAME : LFA PRONUNCIATION : "l-f-a" APPEARS AS : FC5B LFA VERSION : RSC NMI NMIDR STACK NOTATION : ( pfaptr --- lfa ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Alter parameter field pointer address to link field address. LONG DEFINITION : Converts the parameter field address pointer pfaptr of a dictionary definition to its link field address (lfa). NAME : LIST PRONUNCIATION : "list" APPEARS AS : F02B LI__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : Reads block if not RAM resident. OUTPUT : Lists screen, may cause write of updated screen to make buffer space. GROUP : Mass ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Lists the block whose number is u. SCR is set to u. LONG DEFINITION : The contents of screen u are displayed. SCR is set to u. See: BLOCK NAME : LIMIT PRONUNCIATION : "limit" APPEARS AS : F1C0 LIM__ VERSION : RSC NMI NMIDR STACK NOTATION : ( --- n ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Mass ATTRIBUTE : STANDARD : SHORT DEFINITION : Top of memory LONG DEFINITION : Leaves the highest address plus one available in the data (or mass storage) buffer. Usually this is the highest system memory. NAME : LITERAL PRONUNCIATION : "literal" APPEARS AS : EAAF LIT____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Compile a system dependent operation so that when later executed, 16b will be left on the stack. LONG DEFINITION : Typically used in the form: [ 16b] LITERAL Compiles a system dependent operation so that when later executed, 16b will be left on the stack. NAME : LOAD PRONUNCIATION : "load" APPEARS AS : E738 LO__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : Reads blocks. OUTPUT : May cause write of updated screen to make buffer space. GROUP : Mass ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Begins interpretation of block u. LONG DEFINITION : The contents of IN to zero and BLK to u. The screen is then interpreted. If interpretation from screen u is not terminated explicitly it will be terminated when the input stream is exhausted and then the contents of >IN and BLK will be restored. An error condition exists if u is zero. See: >IN BLK BLOCK . NAME : LOG2 PRONUNCIATION : "log-2" APPEARS AS : D851 LOG2 VERSION : V3.5 STACK NOTATION : ( --- ) (F: r1 --- r2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : R2 is base 2 logarithm or r1. LONG DEFINITION : Floating Point number r2 is result of the base 2 log of r1. NAME : LOOP PRONUNCIATION : "loop" APPEARS AS : EE82 LOO_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( ---- ), ( sys --- ) (compiling) # ARGUMENTS IN : 0 , 1 # ARGUMENTS OUT : 0 , 0 RETURN STACK :Conditional removal of loop control parameters (2 words). DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Defines the end point of a do-loop. LONG DEFINITION : Increments the DO-LOOP by one. If the new index was incremented across the boundary between limit-1 and limit the loop is terminated and loop control parameters are discarded. When the loop is not terminated, execution continues to just after the corresponding DO. sys is balanced with its corresponding DO . See DO . NAME : MAX PRONUNCIATION : "max" APPEARS AS : FB99 MAX VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 --- n3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves the greater of n1 and n2 as n3. LONG DEFINITION : n3 is the greater of n1 and n2 according to the operation of > NAME : MESSAGE PRONUNCIATION : "message" APPEARS AS : EB59 MES____ VERSION : V3.5 STACK NOTATION : ( n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : STANDARD : SHORT DEFINITION : Prints error message n. LONG DEFINITION : Prints error message n. If WARNING is zero, the message will simply be printed as a number (mass storage unavailable). Default value 0 selectects action printing an error message number n. A value greater than 0 assumes that a disk (RAMdsk) is in use, takes screen 4 as adjusted by OFFSET and indexes into it for line to show with error. n may be positive or negative. NAME : MIN PRONUNCIATION : "min" APPEARS AS : FBA9 MIN VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 --- n3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves the lessr of n1 and n2 as n3. LONG DEFINITION : n3 is the lesser of n1 and n2 according to the operation of < . NAME : MOD PRONUNCIATION : "mod" APPEARS AS : F831 MOD VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 n2 --- n3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Divides n1 by n2 and leaves the remainder n3. LONG DEFINITION : n3 is the remainder after dividing n1 by the divisor n2. n3 has the same sign as n2 or is zero. An error condition results if the divisor is zero or if the quotient falls outside the range {32,768...32,768}. NAME : NEGATE PRONUNCIATION : "negate" APPEARS AS : FAF6 NEG___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n1 --- n2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves the two's complement n2 of n1. LONG DEFINITION : n2 is the two's complement of n1, i.e., the difference of zero less n1. NAME : NFA PRONUNCIATION : "n-f-a" APPEARS AS : EE10 NFA VERSION : RSC NMI NMIDR STACK NOTATION : ( pfaptr - nfa ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Alter parameter field pointer address to name field address. LONG DEFINITION : Converts the parameter field address pointer pfaptr of a definition to its name field address (nfa). NAME : NOT PRONUNCIATION : "not" APPEARS AS : FC36 NOT VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b1 --- 16b2 ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Logic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Leaves the one's complement 16b2 of 16b1. LONG DEFINITION : 16b2 is the one's complement of 16b1. NAME : NUMBER PRONUNCIATION : "number" APPEARS AS : F405 NUM___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr --- d ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Converts the counted string at addr to d according to the value of BASE . LONG DEFINITION : Convert the count and character string at addr, to a signed 32-bit integer, using the value of BASE . If numeric conversion is not possible, an error condition exists. The string may contain a preceding minus sign. NAME : ODD-POLY PRONUNCIATION : "odd-poly" APPEARS AS : D7EA ODD-____ VERSION : V3.5 STACK NOTATION : ( addr --- ) (F: --- r1) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : Evaluate odd-polynomial giving r1. LONG DEFINITION : Floating Point number r1 is result of evaluating odd-polynomial pointed to by addr. NAME : OFFSET PRONUNCIATION : "offset" APPEARS AS : F52A OFF___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Mass ATTRIBUTE : U STANDARD : F83-CRW SHORT DEFINITION : Returns the address of the user variable that contains a block offset to mass storage. LONG DEFINITION : The address of the user variable that contains the offset added to the block number on the stack by BLOCK or BUFFER to determine the actual physical block number. NAME : OR PRONUNCIATION : "or" APPEARS AS : FDA1 OR VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b1 16b2 --- 16b3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Logic ATTRIBUTE : STANDARD : SHORT DEFINITION : Leaves the inclusive-or 16b3 of 16b1 an 16b2. LONG DEFINITION : 16b3 is the bit-by-bit inclusive-or of 16b1 with 16b2. NAME : OVER PRONUNCIATION : "over" APPEARS AS : FD3B OVE_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b1 16b2 --- 16b1 16b2 16b3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 3 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : 16b3 is a copy of 16b1. LONG DEFINITION : Duplicates the second item from the top of the data stack onto the data stack. NAME : PAD PRONUNCIATION : "pad" APPEARS AS : F563 PAD VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Puts onto stack the starting address in memory of scratchpad. LONG DEFINITION : The lower address of a scratch area used to hold data for intermediate processing. The address or contents of PAD may change and the data lost if the address of the next available dictionary location is changed. NAME : PFAPTR PRONUNCIATION : "p-f-a-pointer" APPEARS AS : EDE8 PFA___ VERSION : RSC NMI NMIDR STACK NOTATION : ( nfa --- pfaptr ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Alter name field address to parameter field pointer address. LONG DEFINITION : Converts the name field address (nfa) of a pointer dictionary definition to its parameter field address (pfaptr). NAME : PI PRONUNCIATION : "pie" APPEARS AS : D6B8 PI VERSION : V3.5 STACK NOTATION : ( --- ) (F: --- r ) # ARGUMENTS IN : # ARGUMENTS OUT : RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Floating Point ATTRIBUTE : STANDARD : SHORT DEFINITION : Put value pi on stack as r1. LONG DEFINITION :Returns value of pi on Floating Point Stack. 3.141593 NAME : PICK PRONUNCIATION : "pick" APPEARS AS : FA6F PIC_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( +n --- 16b ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Copies the data stack's +nth item onto the top. LONG DEFINITION : 16b is a copy of the +nth data stack value, not counting +n itself. 0 PICK is equivalent to DUP . 1 PICK is equivalent to OVER . NAME : PLACES PRONOUNCIATION : places APPEARS AS : D6A6 PLAC__ VERSION : STACK NOTATION : ( n-- ) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Set the number of decimal places (digits to the right of the radix point) displayed by E. and F. LONG DEFINITION : Set the number of decimal places (digits to the right of the radix point) displayed by E. and F. The length, n, is stored in a user variable named #PLACES. NAME : POLY PRONUNCIATION : "poly" APPEARS AS : D7CA POLY VERSION : V3.5 STACK NOTATION : ( addr --- ) (F: --- r1) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : Evaluate polynomial giving r1. LONG DEFINITION : Floating Point number r1 is result of evaluating polynomial pointed to by addr. NAME : QUIT PRONUNCIATION : "quit" APPEARS AS : E6EF QU__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : Cleared. DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Clears the return stack, stops compilation and returns control to current input device. LONG DEFINITION : Clears the return stack, sets interpret state, accepts new input from the current input device and begins text interpretation. No message is displayed. NAME : QUERY PRONUNCIATION : "query" APPEARS AS : E70E QUE__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Stores input characters into text input buffer. LONG DEFINITION : Characters are received and transfered into the memory area addressed by TIB . The transfer terminates when either a "return" is received or the number of characters transferred reaches the value of characters per line, C/L . The values of >IN and BLK are set to zero and the value of #TIB is set to the value of SPAN . WORD may be used to accept text from this buffer. NAME : R> PRONUNCIATION : "r-from" APPEARS AS : FD6F R> VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- 16b ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : 16b removed DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : 16b is removed from the return stack and placed onto the data stack. LONG DEFINITION : 16b is removed from the return stack and transferred to the data stack. NAME : R@ PRONUNCIATION : "r-fetch" APPEARS AS : FAD2 R@ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- 16b ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : Copies 16b onto the data stack DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : 16b is a copy of the top of the return stack. LONG DEFINITION : Copies 16b from the top of the return stack onto the data/parameter stack. NAME : R0 PRONUNCIATION : "r-zero" APPEARS AS : F4E2 R0 VERSION : NMI NMIDR STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : U STANDARD : SHORT DEFINITION : Returns the address of the variable containing the initial value of the bottom of the return stack. LONG DEFINITION : A user variable containing the address of the bottom of the return stack. NAME : RECURSE PRONUNCIATION : "recurse" APPEARS AS : E9D4 RE_____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : Compiles address PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : C I 83 STANDARD : F83-CRW SHORT DEFINITION : Compile the compilation address of definition currently being defined. LONG DEFINITION : Compile the compilation address of the definition currently being compiled to cause the definition to later be executed recursively. NAME : REPEAT PRONUNCIATION : "repeat" APPEARS AS : EF03 REP___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ), ( sys --- ) (compiling) # ARGUMENTS IN : 0 , 1 # ARGUMENTS OUT : 0 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Terminates a BEGIN...WHILE...REPEAT loop. LONG DEFINITION : Used in the form: BEGIN ... flag WHILE ...REPEAT At execution time, REPEAT continues execution to just after the corresponding BEGIN . sys is balanced with corresponding WHILE . See BEGIN . NAME : ROLL PRONUNCIATION : "roll" APPEARS AS : FA29 ROL_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( +n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Removes the stack's nth item and places it onto the top of stack. LONG DEFINITION : The nth stack value, not counting +n itself is first removed and then transfered to the top of the stack, moving the remaining values into the vacated position. 2 ROLL is equivalent to ROT . 0 ROLL is a null operation. NAME : ROT PRONUNCIATION : "rot" APPEARS AS : FD27 ROT VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b1 16b2 16b3 --- 16b2 16b3 16b1 ) # ARGUMENTS IN : 3 # ARGUMENTS OUT : 3 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Rotates 16b1 to the top of the stack. LONG DEFINITION : The top three stack entries are rotated, bringing the deepest to the top. NAME : RP! PRONUNCIATION : "r-p-store" APPEARS AS : F573 RP! VERSION : NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : SHORT DEFINITION : A computer dependent proceedure to to initialize the return stack pointer from R0. LONG DEFINITION : Proceedure to to initialize the return stack pointer from R0. In case of the F68HC11, user variable, R0, is loaded into SP, Stack Pointer Register. NAME : RP@ PRONUNCIATION : "r-p-fetch" APPEARS AS : FD5F RP@ VERSION : NMI NMIDR STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : SHORT DEFINITION : addr is the address of the top of the return stack just before RP@ was executed. LONG DEFINITION : Returns the address of the top of the return stack before RP@ is executed. NAME : S->D PRONUNCIATION : "s-to-d" APPEARS AS : FBD4 S->_ VERSION : RSC NMI NMIDR STACK NOTATION : ( n --- d ) # ARGUMENTS IN : 1 (1 word) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : SHORT DEFINITION : Sign extend single number to double number. LONG DEFINITION : Extends the sign of single number n to form double number d. NAME : S>F PRONOUNCIATION : s-to-f APPEARS AS : D50E S>F VERSION : STACK NOTATION : (n --) (f: -- R) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : R is the floating-point equivalent of n. LONG DEFINITION : R is the floating-point equivalent of n. A single number can be exactly represented by the 32 bit manissa of the internal representation. NAME : S0 PRONUNCIATION : "s-zero" APPEARS AS : F4E5 S0 VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : U STANDARD : F83-URW SHORT DEFINITION : Returns the address of the variable containing the initial value of the bottom of the stack. LONG DEFINITION : A user variable containing the address of the bottom of the stack. NAME : SAVE-BUFFERS PRONUNCIATION : "save-buffers" APPEARS AS : F0B2 SA__________ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : Writes updated blocks. GROUP : Mass ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Copies the contents of all block buffers marked as UPDATEd to their corresponding mass-storage blocks. LONG DEFINITION : The contents of all block buffers marked as UPDATEd are written to their corresponding mass storage blocks. All buffers are marked as no longer being modified, but may remain assigned. NAME : SCR PRONUNCIATION : "s-c-r" APPEARS AS : F54B SCR VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Mass ATTRIBUTE : U STANDARD : F83-CRW SHORT DEFINITION : Returns the address of the user variable containing the number of block most recently listed. LONG DEFINITION : The address of a user variable containing the number of the screen most recently LISTed. NAME : SF! PRONOUNCIATION : s-f-store APPEARS AS : DCA0 SF! VERSION : STACK NOTATION : ( addr -- ) (F: r -- ) # ARGUMENTS IN : 2 # ARGUEMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Store the floating point number r as a 32 bit IEEE single precision number at addr. LONG DEFINITION : Store the floating point number r as a 32 bit IEEE single precision number at addr. The mantissa will be rounded using the "round to even" rule. An exception exists if the exponent of r is too latge to be accommodated by the IEEE single precision format, and the largest available number, correctly signed, will be stored instead. NAME : SF@ PRONOUNCIATION : s-f-fetch APPEARS AS : DC39 SF@ VERSION : STACK NOTATION : ( addr -- ) (F: -- r) # ARGUMENTS IN : 1 # ARGUEMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : floating-point extension ATTRIBUTE : STANDARD : ANSI basis 13 SHORT DEFINITION : Fetch the 32-bit IEEE single precision number stored at addr to the floating-point stack as r in the internal representation. LONG DEFINITION : Fetch the 32-bit IEEE single precision number stored at addr to the floating-point stack as r in the internal representation. NAME : SIGN PRONUNCIATION : "sign" APPEARS AS : F604 SIG_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : Conditional modification of string below PAD . INPUT : OUTPUT : GROUP : Format ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Appends an ASCII " - " (minus sign) to the start of a pictured numeric output string if n is negative. LONG DEFINITION : If n is negative, as ASCII "-" (minus sign) is appended to the pictured numeric output string. Typically used between <# and #> . NAME : SMUDGE PRONUNCIATION : "smudge" APPEARS AS : EC48 SMU___ VERSION : NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Toggles visibility bit in head, enabling definitions to be found. LONG DEFINITION : Used during word definition to toggle the "smudge bit" in a definition's name field. This prevents an uncompleted definition from being found during dictionary searches, until compiling is completed without error. NAME : SP! PRONUNCIATION : "s-p-store" APPEARS AS : F57C SP! VERSION : NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : SHORT DEFINITION : A computer dependent proceedure to to initialize the stack pointer from S0. LONG DEFINITION : Proceedure to to initialize the stack pointer from user variable, S0. In case of the F68HC11, user variable, S0, is loaded into Y Index Register. NAME : SP@ PRONUNCIATION : "s-p-fetch" APPEARS AS : FD66 SP@ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : addr is the address of the top of the parameter stack just before SP@ was executed. LONG DEFINITION : Returns the address of the top of the parameter stack before SP@ is executed. NAME : SPACE PRONUNCIATION : "space" APPEARS AS : F777 SPA__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Sends a space (blank) to the current output device. LONG DEFINITION : Displays an ASCII space. NAME : SPACES PRONUNCIATION : "spaces" APPEARS AS : F75F SPA___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( +n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Sends +n spaces (blanks) to the current output device. LONG DEFINITION : Displays +n ASCII spaces. Nothing is displayed if +n is zero. NAME : SPAN PRONUNCIATION : "span" APPEARS AS : F536 SPA_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : U STANDARD : F83-RWS-IL SHORT DEFINITION : Returns the address of the user variable that contains the count of characters received and stored by the most recent execution of EXPECT . LONG DEFINITION : The address of the user variable containing the count of characters actually received and stored by the last execution of EXPECT . NAME : STATE PRONUNCIATION : "state" APPEARS AS : F554 STA__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Compiler ATTRIBUTE : U STANDARD : F83-RWS-CL SHORT DEFINITION : Returns the address of the user variable that contains a value defining the compilation state. LONG DEFINITION : The address of the user variable containing the compilation state. A non-zero content indicates compilation is occuring, but the value itself is system dependent. A Standard Program may not modify this variable. NAME : SWAP PRONUNCIATION : "swap" APPEARS AS : FD4E SWA_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b1 16b2 --- 16b2 16b1 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 2 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Stack ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Exchanges positions of the top two items of the stack. LONG DEFINITION : The top two data stack entries are exchanged in position on the stack. NAME : TASK PRONUNCIATION : "task" APPEARS AS : F88F TASK VERSION : RSC NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : A dictionary marker null word. LONG DEFINITION : A no-operation word which can mark the boundary between applications. By forgetting TASK and recompiling, an application can be discarded in its entirety. Its definition is : TASK ; . NAME : THEN PRONUNCIATION : "then" APPEARS AS : EF43 THE_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ), ( sys --- ) (compiling) # ARGUMENTS IN : 0 , 1 # ARGUMENTS OUT : 0 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Marks the end of a conditional branch or marks where execution will continue relative to a corresponding IF or ELSE . LONG DEFINITION : Used in the form: flag IF ... ELSE ... THEN or flag IF ... THEN THEN is the point where execution continues after ELSE , or IF when no ELSE is present. sys is balanced with its corresponding IF or ELSE . See: IF ELSE NAME : THRU PRONUNCIATION : "thru" APPEARS AS : E728 TH__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u1 u2 --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : Modified according to screens loaded PAD : INPUT : Reads screens OUTPUT : GROUP : Mass Storage ATTRIBUTE : M,83 STANDARD : F83-CRW SHORT DEFINITION : Load blocks from u1 through u2. LONG DEFINITION : Load consecutively the blocks from u1 through u2. NAME : TIB PRONUNCIATION : "t-i-b" APPEARS AS : F4EE TIB VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : U STANDARD : F83-RWS-IL SHORT DEFINITION : Returns the address of the start of the text-input buffer. LONG DEFINITION : The address of the text input buffer. This buffer is used to hold characters when the input stream is coming from the current input device. NAME : TOGGLE PRONUNCIATION : "toggle" APPEARS AS : FB8A TO____ VERSION : NMI NMIDR STACK NOTATION : ( 16b addr --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Memory ATTRIBUTE : STANDARD : NL SHORT DEFINITION : Compliment the contents of addr by bit pattern 16b. LONG DEFINITION : The memory location addr is read and exclusive OR'd with the bit pattern 16b and the result stored at addr. NAME : TRAVERSE PRONUNCIATION : "traverse" APPEARS AS : EDF5 TRA_____ VERSION : RSC NMI NMIDR STACK NOTATION : ( addr n --- addr ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : STANDARD : SHORT DEFINITION : Adjust addr positively or negatively until contents of addr is greater then $7F. LONG DEFINITION : Adjusts the addr in a negative or positive direction, depending on the sign of n, until the contents of addr is greater than $7F. n must be either 1 or -1 . NAME : TRIAD PRONUNCIATION : "triad" APPEARS AS : EFFD TR___ VERSION : NMI NMIDR STACK NOTATION : ( u16 --- ) # ARGUMENTS IN :1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : Reads blocks OUTPUT : List screens, may cause write of updated screen to make buffer space. GROUP : Mass ATTRIBUTE : STANDARD : SHORT DEFINITION : Lists three screens to the output device. One of the screens listed is specified by the user. LONG DEFINITION : Outputs three screens, i.e., one page, to the output device. The page begins with screen which number is divisible by three. One of the screens on the page will be the screen specified. NAME : TYPE PRONUNCIATION : "type" APPEARS AS : F6BA TYP_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( addr +n --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Displays a string of +n characters starting with the character at addr. LONG DEFINITION : +n characters are displayed from memory beginning with character at addr and continuing through consecutive addresses. Nothing is displayed if +n is zero. NAME : U. PRONUNCIATION : "u-dot" APPEARS AS : F58E U. VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : Bytes below PAD modified as temporary area where +n is converted to string. INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Displays the unsigned value of u followed by a space. LONG DEFINITION : u is displayed as an unsigned number in a free-field format. NAME : U.R PRONUNCIATION : "u-dot-r" APPEARS AS : F59E U.R VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u +n --- ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : Bytes below PAD modified as temporary area where +n is converted to string. INPUT : OUTPUT : GROUP : I/O ATTRIBUTE : STANDARD : F83-CRW SHORT DEFINITION : Displays the value of u right justified in a field +n characters wide according to the value of BASE. LONG DEFINITION : u is converted using the value of BASE and then displayed as an unsigned number right aligned in a field +n characters wide. If the number of characters required to display u is greater than +n, an error condition exists. NAME : U< PRONUNCIATION : "u-less-than" APPEARS AS : FBF9 U< VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u1 u2 --- flag ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Comparison ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Returns a true flag if u1 is less then u2. LONG DEFINITION : flag is true if u1 is less than u2. NAME : UABORT PRONUNCIATION : "u-abort" APPEARS AS : F521 UAB___ VERSION : NMI NMIDR STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : U STANDARD : IL SHORT DEFINITION : Returns the address of user variable vectoring error actions to ABORT. LONG DEFINITION : The address of the vector directing the error action. Default vector installed at address is CFA of ABORT . User may change value in UABORT to point to alternate error routine. This action is taken if WARNING has a value installed which is less than 0 and an error is encountered. NAME : UM* PRONUNCIATION : "u-m-times" APPEARS AS : FB35 UM* VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( u1 u2 --- ud ) # ARGUMENTS IN : 2 (2 words) # ARGUMENTS OUT : 1 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Multiplies u1 and u2 returning the double length product ud. LONG DEFINITION : ud is the unsigned product of u1 times u2. All values and arithmetic are unsigned. NAME : UM/MOD PRONUNCIATION : "u-m-divide-mod" APPEARS AS : FB01 UM/___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( ud u1 --- u2 u3 ) # ARGUMENTS IN : 2 (3 words) # ARGUMENTS OUT : 2 (2 words) RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Arithmetic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Divides the double length unsigned number ud by u1 and returns the single length remainder u2 and the single length quotient u3. LONG DEFINITION : u2 is the remainder and u3 is the floor of the quotient after dividing ud by the divisor u1. All values and arithmetic are unsigned. An error condition results if the divisor is zero or if the quotient lies outside the range {0...65,535}. NAME : UNDO PRONUNCIATION : "undo" APPEARS AS : E936 UN__ VERSION : NMI NMIDR STACK NOTATION : ( --- ) # ARGUMENTS IN : # ARGUMENTS OUT : RETURN STACK : DICTIONARY : Removes latest definition, DP is "backed up". PAD : INPUT : OUTPUT : GROUP : Dictionary ATTRIBUTE : I STANDARD : SHORT DEFINITION : Forget the latest definition regardless of smudge condition. LONG DEFINITION : Forget the latest definition regardless of smudge condition. NAME : UNTIL PRONUNCIATION : "until" APPEARS AS : EF15 UNT__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( flag --- ), ( sys --- ) (compiling) # ARGUMENTS IN : 1 , 1 # ARGUMENTS OUT : 0 , 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Marks the end of an indefinite loop. LONG DEFINITION : Used in the form: BEGIN ... flag UNTIL Marks the end of a BEGIN-UNTIL loop which will terminate based on flag. If flag is true, the loop is terminated. If flag is false, execution continues to just after the corresponding BEGIN . sys is balanced with its corresponding BEGIN . See: BEGIN NAME : UPDATE PRONUNCIATION : "update" APPEARS AS : F186 UPD___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Mass ATTRIBUTE : STANDARD : F83-RWS-DL SHORT DEFINITION : Marks the block buffer as having been modified and as ready to be saved to mass storage. LONG DEFINITION : The currently blocked buffer is marked as modified. Blocks marked as modified will subsequently be automatically transfered to mass storage should its memory buffer be needed for storage of a different block or upon execution of FLUSH or SAVE-BUFFERS . NAME : USER PRONUNCIATION : "user" APPEARS AS : E81C USE_ VERSION : RSC NMI NMIDR STACK NOTATION : ( n --- ) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Create a user variable. LONG DEFINITION : A defining word used in the form: n USER which creates a user variable . The parameter field of contains n as a fixed offset relative to the user pointer register UP for this user variable. When is later executed, it places the sum of its offset and the user area base address on the stack as the storage address of that particular variable. NAME : VARIABLE PRONUNCIATION : "variable" APPEARS AS : E7F2 VAR_____ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : is removed from input stream. OUTPUT : GROUP : Definition ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Creates a single length variable. LONG DEFINITION : A defining word executed in the form: VARIABLE A dictionary entry for is created and two bytes are ALLOTed in its parameter field. This parameter field is to be used for contents of the variable. The application is responsible for initializing the contents of the variable which it creates. When is later executed, the address of its parameter field is placed on the stack. NAME : VOCABULARY PRONUNCIATION : "vocabulary" APPEARS AS : E864 VO________ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Vocabulary ATTRIBUTE : STANDARD : F83-RWS-CL SHORT DEFINITION : Creates a vocabulary word. LONG DEFINITION : A defining word executed in the form: VOCABULARY A dictionary entry for is created which specifies a new ordered list of definitions. Subsequent execution of replaces the first vocabulary in the search order with . When becomes the compilation vocabulary new definitons will be appended to 's list. NAME : WARNING PRONUNCIATION : "warning" APPEARS AS : F52D WAR____ VERSION : NMI NMIDR STACK NOTATION : ( --- addr ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Operating System ATTRIBUTE : U STANDARD : IL SHORT DEFINITION : Returns the address of user variable selecting error actions. LONG DEFINITION : The address of the variable selecting the error action. Default value 0 selectects action printing an error message number n. A value less than 0 executes the word ABORT (as vectored through user variable UABORT). A value greater than 0 assumes that a disk (RAMdsk) is in use, takes screen 4 as adjusted by OFFSET and indexes into it for line to show with error. NAME : WHILE PRONUNCIATION : "while" APPEARS AS : EEFB WHI__ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( flag --- ) ( sys1 --- sys2 ) (compiling) # ARGUMENTS IN : 1 , 1 # ARGUMENTS OUT : 0 , 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Control ATTRIBUTE : I C STANDARD : F83-RWS-CL SHORT DEFINITION : Decides the continuation or termination of a BEGIN...WHILE...REPEAT loop. LONG DEFINITION : Used in the form: BEGIN ... flag WHILE ... REPEAT Selects conditional execution based on flag. When flag is true, execution continues to just after the WHILE through to the REPEAT which then continues execution back to just after the BEGIN . When flag is false, execution continues to just after the REPEAT , exiting the control structure. sys1 is balanced with its corresponding BEGIN . sys2 is balanced with its corresponding REPEAT . See: BEGIN NAME : WORD PRONUNCIATION : "word" APPEARS AS : F224 WOR_ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( char --- addr) # ARGUMENTS IN : 1 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Interpreter ATTRIBUTE : STANDARD : F83-RWS-IL SHORT DEFINITION : Generates a counted string until an ASCII code, char is encountered or the input stream is exhausted. Returns addr which is the beginning address of where the counted string are stored. LONG DEFINITION : Generates a counted string at HERE by non-destructively accepting characters from the input stream until the delimiting character, char, is encountered or the input stream is exhausted. Leading delimiters are ignored. The entire character string is stored in memory beginning at addr as a sequence of bytes. The string is followed by a blank which is not included in the count. The first byte in the string is the number of characters {0...255}. If the string is longer than 255 characters, the count is unspecified. If the input stream is already exhausted as WORD called, then a zero length character string will result. The counted string returned by WORD may reside in the "free" dictionary are at HERE or above. Note that the text interpreter may also use this area. NAME : WORDS PRONUNCIATION : "words" APPEARS AS : ECB2 WO___ VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( --- ) # ARGUMENTS IN : 0 # ARGUMENTS OUT : 0 RETURN STACK : DICTIONARY : PAD : INPUT : Optional termination with any character input. OUTPUT : List of words. GROUP : Vocabulary ATTRIBUTE : STANDARD : F83-URW SHORT DEFINITION : Lists all the words in the CURRENT vocabulary. LONG DEFINITION : List the word names in the first vocabulary of the currently active search order. NAME : XOR PRONUNCIATION : "exclusive-or" APPEARS AS : FD93 XOR VERSION : NMI NMIDR FORTH-83 STACK NOTATION : ( 16b1 16b2 --- 16b3 ) # ARGUMENTS IN : 2 # ARGUMENTS OUT : 1 RETURN STACK : DICTIONARY : PAD : INPUT : OUTPUT : GROUP : Logic ATTRIBUTE : STANDARD : F83-RWS-NL SHORT DEFINITION : Performs a bit-by-bit exclusive or of 16b1 with 16b2 to give 16b3. LONG DEFINITION : 16b3 is the bit-by-bit exclusive-or of 16b1 with 16b2. DEFINITIONS BY GROUP Please read APPENDIX B for the meaning of abbreviations and symbols used herein. Arithmetic * ( w1 w2 --- w3 ) Multiplies w2 by w1 and leaves the product w3 onto the stack. */ ( n1 n2 n3 --- n4 ) Multiplies n1 by n2 and divides the product by n3. The quotient, n4 is placed on the stack. */MOD ( n1 n2 n3 --- n4 n5 ) n1 is multiplied by n2 producing a product which is divided by n3. The remainder, n4, and the quotient, n5, are then placed on the stack. + (w1 w2 --- w3 ) Adds w2 and w1 then leaves the sum, w3 on the stack. - ( w1 w2 --- w3 ) Subtracts w2 from w1 and leaves the result, w3 on the stack. / ( n1 n2 --- n3 ) Divides n1 by n2 and leaves the quotient n3 on the stack. /MOD ( n1 n2 --- n3 n4 ) Divides n1 by n2 then leaves on the stack the remainder n3 and the quotient n4. 1+ ( w1 --- w2 ) Adds 1 to w1 then leaves the sum, w2 on the stack. 1- ( w1 --- w2 ) Subtract 1 from w1 then leaves the difference, w2 on the stack. 2* ( w1 --- w2 ) Multiplies w1 by 2 to give w2. 2**X (F: r1 --- r2 ) Raise 2 to the r1 power giving r2. 2+ ( w1 --- w2 ) Adds two to w1 and leaves the sum, w2 on the stack. 2- ( w1 --- w2 ) Subtracts two from w1 and leaves the result, w2 on the stack. 2/ ( n1 --- n2 ) Divides n1 by 2, giving n2 as the result. ABS ( n --- u ) Leaves on the stack the absolute value, u of n. D+ ( wd1 wd2 --- wd3 ) Adds wd1 and wd2 and leaves the result, wd3 on stack. D- ( wd1 wd2 --- wd3 ) Subtracts wd2 from wd1 and returns the difference wd3. D>F ( d --- ) (F: ---r1 ) Convert double number to floating point r1. D2/ ( d1 --- d2 ) Divides d1 by 2 and gives quotient d2. DABS ( d --- ud ) Returns the absolute value of d as ud. DMAX ( d1 d2 --- d3 ) Returns d3 as the greater of d1 or d2. DMIN ( d1 d2 --- d3 ) Returns d3 as the lesser of d1 or d2. DNEGATE ( d1 --- d2 ) Leaves the two's complement d2 of d1. e (F: --- r1 ) Put natural value e on stack as r1. F+ (F: r1 r2 -- r3 ) Add r1 to r2, giving r3. F- (F: r1 r2 -- r3 ) Subtract r2 from r1, giving r3. F* (F: r1 r2 -- r3 ) Multiply r1 by r2 giving r3. F** (F: r1 r2 -- r3 ) Raises r1 to the r2 power giving r3. F/ (F: r1 r2 -- r3 ) Divide r1 by r2, giving r3. F>D (F: r -- ) ( -- d ) Convert r to d. F2* (F: r1 -- r2 ) Multiply r1 by 2 giving r2. F2/ (F: r1 -- r2 ) Divide r1 by 2, giving r2. FABS (F: r -- r2) R2 is the absolute value of r1. FALOG (F: r1 -- r2) Raise 10 to the power r1, giving r2. FATAN (F: r1 -- r2 ) R2 is the principal radian whose tangent is r1. FATAN2 (F: r1 r2 -- r3 ) R3 is the radian angle whose tangent is r1/r2. FCOS (F: r1 -- r2 ) R2 is the cosine of the radian angle r1. FEXP (F: r1 -- r2 ) Raise e to the power r1, giving r2. FLN (F: r1 -- r2 ) R2 is the natural logarithm of r1. FLOG (F: r1 -- r2 ) R2 is the base 10 logarithm of r1. FLOOR (F: r1 -- r2 ) Round r1 using the "round to negative infinity" rule, giving r2. FMAX (F: r1 r2 -- r3 ) R3 is the maximum of r1 and r2. FMIN (F: r1 r2 -- r3 ) R3 is the minimum of r2 and r3. FNEGATE (F: r1 -- r2 ) R2 is the negation of r1. FROUND (F: r1 -- r2 ) Round r1 using the "round to even" rule, giving r2. FSIN (F: r1 -- r2 ) R2 is the sine of the radian angle r1. FSQRT (F: r1 -- r2 ) R2 is the square root of r1. FTAN (F: r1 -- r2 ) R2 is the tangent of the radian angle r1. LOG2 (F: r1 -- r2) R2 is base 2 logarithm or r1 MAX ( n1 n2 --- n3 ) Leaves the greater of n1 and n2 as n3. MIN ( n1 n2 --- n3 ) Leaves the lessor of n1 and n2 as n3. MOD ( n1 n2 --- n3 ) Divides n1 by n2 and leaves the remainder n3. NEGATE ( n1 --- n2 ) Leaves the two's complement n2 of n1. ODD-POLY (F: --- r1) ( addr --- ) Evaluate odd-polynomial giving r1. PI (F: --- r1) Put the numerical value of pi on stack as r1 POLY (F: --- r1) ( addr --- ) Evaluate polynomial giving r1. S->D ( n --- d ) Sign extend single number to double number. S>F ( n --- ) (F: ---r1 ) Convert single number to floating point r1. UM* ( u1 u2 --- ud ) Multiplies u1 and u2 returning the double length product ud. UM/MOD ( ud u1 --- u2 u3 ) Divides the double length unsigned number ud by u1 and returns the single length remainder u2 and the single length quotient u3. Comparison 0< ( n --- flag ) Leaves a true flag if n is less than zero. 0= ( w --- flag ) Leaves a true flag if w is equal to zero. 0> ( n --- flag ) Leaves a true flag if n is greater than zero. < ( n1 n2 --- flag ) Leaves a true flag on stack if n1 is less than n2. = ( w1 w2 --- flag ) Returns a true flag if w1 is equal to w2. > ( n1 n2 --- flag ) Returns a true flag if n1 is greater than n2. D0= ( wd --- flag ) Returns a true flag if wd is equal to zero. D< ( d1 d2 --- flag ) Leaves a true flag if d1 is less than d2; otherwise leaves a false flag. D= ( wd1 wd2 --- flag ) Returns a true flag if wd1 is equal to wd2. DU< ( ud1 ud2 --- flag ) Returns a true flag if ud1 is less than ud2. F0< (F: r -- ) ( -- flag ) flag is true if r is less than zero. F0= (F: r -- ) ( -- flag ) flag is true if r is equal to zero. F < (F: r1 r2 -- ) ( -- flag ) flag is true if r1 is less than r2. U< ( u1 u2 --- flag ) Returns a true flag if u1 is less then u2. Compiler ( ( --- ) Starts a comment input. Comment is ended by a ) . >BODY ( addr1 --- addr2 ) Leaves on the stack the parameter field address, addr2 of a given field address, addr1. COMPILE ( --- ) Copies the compilation address of the next non-immediate word following COMPILE. DLITERAL ( 32b --- ) Compile a system dependent operation so that when later executed, 32b will be left on the stack. EXECUTE ( addr --- ) Executes the definition found at addr. F, (F: r1 --- ) Compile r1 as floating point value in next open dictionary location. FLITERAL (F: r1 --- ) Compile r1 as a floating point literal. IMMEDIATE ( --- ) Marks the most recently created dictionary entry as a word that will be executed immediately even if FORTH is in compile mode. LITERAL ( 16b --- ) Compile a system dependent operation so that when later executed, 16b will be left on the stack. RECURSE ( --- ) Compile the compilation address of definition currently being defined. STATE ( --- addr ) Returns the address of the user variable that contains a value defining the compilation state. [ ( --- ) Places the system into interpret state to execute non-immediate word/s during compilation. ['] ( --- addr ), ( --- ) Returns and compiles the code field address of a word in a colon-definition. [COMPILE] ( --- ) Causes an immediate word to be compiled. ] ( --- ) Places the system into compilation state. ] places a non-zero value into the user variable STATE. Control +LOOP ( n --- ), ( sys --- ) (compiling) Increments the DO LOOP index by n. MARK ( --- addr ) Compiles zero in place of forward branch offset and marks it for future resolve. >RESOLVE ( addr --- ) Corrects branch offset previously compiled by >mark to current dictionary location. AGAIN ( --- ), ( sys --- ) (compiling) Ends BEGIN loop. BEGIN ( --- ), ( --- sys ) (compiling) Marks the start of a loop. DO ( w1 w2 --- ), ( --- sys ) (compiling) Repeats execution of words between DO LOOPs and DO +LOOPs, the number of times is specified by the limit from w2 to w1. ELSE ( --- ), ( sys1 --- sys2 ) (compiling) Allows execution of words between IF and ELSE if the flag is true, otherwise, it forces execution of words after ELSE. END ( sys --- ) Performs the same function as UNTIL. See UNTIL . I ( --- w ) Places the loop index onto the stack. IF ( flag --- ), ( --- sys ) (compiling) Allows a program to branch on condition. J ( --- w ) Returns the index of the next outer loop. K ( --- w ) Returns the index of the second outer loop in nested do loops. LEAVE ( --- ) Forces termination of a DO LOOP. LOOP ( ---- ), ( sys --- ) (compiling) Defines the end point of a do-loop. REPEAT ( --- ), ( sys --- ) (compiling) Terminates a BEGIN...WHILE...REPEAT loop. THEN ( --- ), ( sys --- ) (compiling) Marks the end of a conditional branch or marks where execution will continue relative to a corresponding IF or ELSE . UNTIL ( flag --- ), ( sys --- ) (compiling) Marks the end of an indefinite loop. WHILE ( flag --- ), ( sys1 --- sys2 ) (compiling) Decides the continuation or termination of a BEGIN...WHILE...REPEAT loop. Definition 2CONSTANT ( 32b --- ) Creates a double length constant for a . When is executed, 32b is left on the stack. 2VARIABLE ( --- ) Creates double-length variable for . when is executed, its parameter field address is placed on the stack. : ( --- sys ) Starts the definition of a word. Definition is terminated by a ; . :CASE ( n --- ), ( --- sys ) (compiling) Creates a dictionary entry for in current and sets the compile mode. ; ( sys --- ) Terminates a colon-definiton. ;CODE ( --- ), ( sys1 --- sys2 ) (compiling) Terminates a defining-word. May only be used in compilation mode. CODE ( --- sys ) Creates an assembler definition. CODE-SUB ( --- sys ) Creates an assembler definition subroutine. CONSTANT ( 16b --- ) Creates a dictionary entry for . CREATE ( --- ) Creates a dictionary entry for . DOES> ( --- addr ), ( --- ) (compiling) Marks the termination of the defining part of the defining word and begins the definition of the run-time action for words that will later be defined by . END-CODE ( sys --- ) Terminates an assembler definition. FCONSTANT (F: r -- ) Define a constant ame with value r. FVARIABLE ( -- ) Create a floating-point variable USER ( n --- ) Create a user variable. VARIABLE ( --- ) Creates a single length variable. Dictionary ' ( --- addr ) Returns 's compilation address, addr , ( 16b --- ) Reserves 16b of space in the dictionary. ALLOT ( w --- ) Reserves w bytes of dictionary space. AUTOSTART ( addr --- ) Prepare autostart vector at addr which will cause to be executed upon reset. Note: addr must be on a 1K byte boundary. C, ( 16b --- ) Stores the least significant byte of 16b into a byte at the next available dictionary location. CFA ( pfa --- cfa ) Alter parameter field pointer address to code field address. DP ( --- addr ) Put Dictionary Pointer address on stack. FORGET ( --- ) Deletes from the dictionary. H/C ( addr --- ) Separate heads and codes portions of definition to different place in memory. HERE ( --- addr ) Leaves the address of the next variable dictionary location HWORD ( --- ) Moves codes portion of last defined word from the codes memory to the heads memory. LATEST ( --- nfa ) Leaves name field address (nfa) of top word in CURRENT. LFA ( pfaptr --- lfa ) Alter parameter field pointer address to link field address. NFA ( pfaptr --- nfa ) Alter parameter field pointer address to name field address. PAD ( --- addr ) Puts onto stack the starting address in memory of scratchpad. PFAPTR ( nfa --- pfaptr ) Alter name field address to parameter field pointer address. SMUDGE ( --- ) Toggles visibility bit in head, enabling definitions to be found. TASK ( --- ) A dictionary marker null word. TRAVERSE ( addr n --- addr ) Adjust addr positively or negatively until contents of addr is greater then $7F. UNDO ( --- ) Forget the latest definition regardless of smudge condition. Format # ( +d1 --- +d2 ) +d1 is divided by BASE and the quotient +d2 is placed onto the stack. The remainder is converted to an ASCII character and appended to the output string toward lower memory addresses. #> ( 32b --- addr +n ) Terminates formatted (or pictured) output string (ready for TYPE ). #S ( +d --- 0 0 ) Converts all digits of an entire number into string. -TRAILING ( addr +n1 --- addr +n2 ) Counts +n1 characters starting at addr and subtracts 1 from the count when a blank is encountered. Leaves on the stack the final string count, n2 and addr. <# ( --- ) Starts a formatted (pictured) numeric output. Terminated by #> . (E.) (F: r -- ) ( -- addr +n ) Convert the top number on the floating-point stack to its character string representation using the scientific notation. (F.) (F: r -- ) ( -- addr +n ) Convert the top number on the floating-point stack to its character string representation using the fixed-point notation. COUNT ( addr1 --- addr2 +n ) Leaves the address, addr2 and the character count +n of text beginning at addr1. DPL ( --- addr ) Returns the address of the user variable containing the number of places after the fractional point for input conversion. FLD ( --- addr ) Returns the address of the user variable which contains the value of the field length reserved for a number during output conversion. HOLD ( char --- ) Inserts character into a pictured numeric output string. NUMBER ( addr --- d ) Converts the counted string at addr to d according to the value of BASE . PLACES ( n-- ) Set the number of decimal places (digits to the right of the radix point) displayed by E. and F. SIGN ( n --- ) Appends an ASCII " - " (minus sign) to the start of a pictured numeric output string if n is negative. I/O #TIB ( --- addr ) Returns the address of the user variable that holds the number of characters input. ." ( --- ) Displays the characters following it up to the delimiter " . .( ( --- ) Displays string following .( delimited by ) . .R ( n +n --- ) Displays the value n right justified in a field +n characters wide according to the value of BASE. .S ( --- ) Display stack contents without modifying the stack. . ( n --- ) Removes n from the top of stack and displays it. ? ( addr --- ) Displays the contents of addr. ?TERMINAL ( --- flag ) True if any key is depressed. ABORT" ( ---- ) If flag is true, message that follows " is displayed and the ABORT function is performed. If flag is false, the flag is dropped and execution continues. BL ( --- n ) Puts the ASCII code for a space (decimal 32) on the stack. C/L ( --- n ) Maximum number of characters per line CR ( --- ) Generates a carriage return and line feed. D. ( d --- ) Displays the value of d. D.R ( d +n --- ) Displays the value of d right justified in a field +n characters wide. DUMP ( addr u --- ) Displays u bytes of memory starting at addr. E. (F: r -- ) ( -- ) Convert the top number on the floating-point stack to its character string representation using the scientific notation. EMIT ( 16b --- ) Displays the ASCII equivalent of 16b onto the screen. EXPECT ( addr +n --- ) Stores up to +n characters into memory beginning at addr. F. (f: R -- ) ( -- ) Convert the top number on the floating-point stack to its character string representation using the fixed-point notation. F.S ( --- ) Display Floating Point Stack contents without modifying the stack. F? ( addr --- ) Displays the floating point contents stored at addr. ID. ( nfa --- ) Print given name field address (NFA). KEY ( --- 16b ) Pauses to wait for a key to be pressed and then places the ASCII value of the key (n) on the stack. QUERY ( --- ) Stores input characters into text input buffer. SPACE ( --- ) Sends a space (blank) to the current output device. SPACES ( +n --- ) Sends +n spaces (blanks) to the current output device. SPAN ( --- addr ) Returns the address of the user variable that contains the count of characters received and stored by the most recent execution of EXPECT . TIB ( --- addr ) Returns the address of the start of the text-input buffer. TYPE ( addr +n --- ) Displays a string of +n characters starting with the character at addr. U. ( u --- ) Displays the unsigned value of u followed by a space. U.R ( u +n --- ) Displays the value of u right justified in a field +n characters wide according to the value of BASE. Interpreter ?COMP ( --- ) Checks for compilation mode, gives error if not. ?CSP ( --- ) Checks for stack integrety through defining process, gives error if not. ?EXEC ( --- ) Checks for interpretation mode, gives error if not. ?PAIRS ( n1 n2 --- ) Checks for matched structure pairs, gives error if not. ?STACK ( --- ) Checks to see if stack is within limits, gives error if not. ;S ( --- ) Stop interpretation. >IN ( --- addr ) Leaves the address of the user variable >IN which contains the number of bytes from the beginning of the input stream at any particular moment during interpretation. EXIT ( --- ) Causes execution to leave the current word and go back to where the word was called from. FIND ( addr1 --- addr2 n ) Obtains an address of counted strings, addr1 from the stack. Searches the dictionary for the string. INTERPRET ( --- ) Begins text interpretation at the character indexed by the contents of >IN relative to the block number contained in BLK, continuing until the input stream is exhausted. QUIT ( --- ) Clears the return stack, stops compilation and returns control to current input device. WORD ( char --- addr) Generates a counted string until an ASCII code, char is encountered or the input stream is exhausted. Returns addr which is the beginning address of where the counted string are stored. Logic AND ( 16b1 16b2 --- 16b3 ) Leaves the bitwise logical AND of 16b1 and 16b2 as 16b3. NOT ( 16b1 --- 16b2 ) Leaves the one's complement 16b2 of 16b1. OR ( 16b1 16b2 --- 16b3 ) Leaves the exclusive-or 16b3 of 16b1 an 16b2. XOR ( 16b1 16b2 --- 16b3 ) Performs a bit-by-bit exclusive or of 16b1 with 16b2 to give 16b3. Mass (LINE) ( n1 n2 --- addr count ) Virtual storage line primitive. --> ( --- ) Immediately transfers interpretation to the start of the next sequential block. .LINE ( n1 n2 --- ) Display line of text from mass storage. >L ( n --- ) Place the on line n of the current screen as designated by SCR. B/BUF ( --- 1024 ) Returns a constant 1024 which is the number of bytes per block buffer. BLK ( --- addr ) Leaves the address of the user variable containing the the number of the block that is currently being interpreted. BLOCK ( u --- addr ) Leaves the address of the block buffer containing block u. BUFFER ( u --- addr ) Assigns the block buffer and its address to block u. Leaves the address of the block buffer on the stack. EMPTY-BUFFERS ( --- ) Removes the update status and removes assignments of all blocks to buffers. FIRST ( --- n ) Leaves address of first block buffer. FLUSH ( --- ) Performs the functions of the SAVE-BUFFERS then unassign all block buffers. INDEX ( u1 u2 --- ) Displays the top line from each block in a range of blocks starting at block u1 to u2. LIMIT ( --- n ) Top of memory LIST ( u --- ) Lists the block whose number is u. SCR is set to u. LOAD ( u --- ) Begins interpretation of block u. OFFSET ( --- addr ) Returns the address of the user variable that contains a block block offset to mass storage. SAVE-BUFFERS ( --- ) Copies the contents of all block buffers marked as UPDATEd to their corresponding mass-storage blocks. SCR ( --- addr ) Returns the address of the user variable containing the number of block most recently listed. THRU ( u1 u2 --- ) Load blocks from u1 through u2. TRIAD ( u16 --- ) Lists three screens to the output device. One of the screens listed is specified by the user. UPDATE ( --- ) Marks the block buffer as having been modified and as ready to be saved to mass storage. Memory ! ( 16b addr --- ) Stores 16b at addr. +! ( w1 addr --- ) Adds w1 to the value at addr then stores the sum at addr replacing its previous value. @ ( addr --- 16b ) Returns 16b from addr. @! ( 16b addr1 --- ) Fetches addr2 from addr1. Stores 16b at addr2. @ ( addr --- 16b ) Returns 16b from address pointed to in addr. 1+! ( addr --- ) Adds one to the value at addr and stores the result at addr. 1-! ( addr --- ) Subtracts one from the value at addr and stores the result at addr. 2! ( 32b addr --- ) Stores 32b at addr. 2@ ( addr --- 32b ) Returns 32b from addr. BLANKS ( addr u --- ) Sets u bytes of memory beginning at addr to the ASCII code for space (decimal 32). C! ( 16b addr --- ) Stores the least significant byte of 16b into addr. C@ ( addr --- 8b ) Fetches the 8b contents from addr. CMOVE ( addr1 addr2 u --- ) Moves towards high memory the u bytes at addresses addr1 and addr2. CMOVE> ( addr1 addr2 u --- ) Moves u bytes beginning at addr1 to addr2. EEC! ( 16b addr --- ) Stores the least significant byte of 16b into addr in EEPROM. EEMOVE ( addr1 addr2 u --- ) Moves the u bytes at addresses addr1 and addr2. EEWORD ( --- ) Moves code of last defined word from the codes memory to the EEPROM memory. ERASE ( addr u --- ) Sets u bytes of memory to zero, beginning at addr. F! (addr--) (F:r--) Store r at addr. F@ (addr--) (F:r--) r is the value stored at addr. FILL ( addr u 8b --- ) Fills u bytes, beginning at addr, with byte pattern 8b. FLOAT+ ( addr1-- addr2) Add the size of a floating point number to the address on top of the data stack. This should not be used for IEEE single format storage. FLOATS ( n1 -- n2) n2 is the size, in bytes, of n1 floating-point numbers. SF! ( addr -- ) (F: r -- ) Store the floating point number r as a 32 bit IEEE single precision number at addr. SF@ ( addr -- ) (F: -- r) Fetch the 32-bit IEEE single precision number stored at addr to the floating-point stack as r in the internal representation. TOGGLE ( addr 8b --- ) Toggles setting of bits with mask 8b at addr. Numeric BASE ( --- addr ) Leaves the address of the user variable containing the numeric conversion radix. CONVERT ( +d1 addr1 --- +d2 addr2 ) Converts an input string into a number. FNUMBER ( +d1 addr1 --- +d2 addr2 ) Converts an input string into a number. DECIMAL ( --- ) Sets the numeric input-output conversion base to ten. HEX ( --- ) Sets the numeric input-output conversion to base sixteen. Operating System ?ERROR (flag n --- ) If flag is true, error n is initiated. ABORT ( flag --- ) Clears the data stack and performs the function of QUIT . ATO4 ( --- N ) Returns address of subroutine call to high level word as indicated in D register. COLD ( --- ) Cold starts FORTH. ERROR ( --- ) Begins error processing. MESSAGE ( n --- ) Prints error message n. UABORT ( --- addr ) Returns the address of user variable vectoring error actions to ABORT. WARNING ( --- ) Returns the address of user variable selecting error actions. Primitive ?BRANCH ( flag --- ) Compiles a conditional branch operation. BRANCH ( --- ) Compiles an unconditional branch operation. Stack -ROLL ( n --- ) Removes the value on the top of stack and inserts it to the nth place from the top of stack. 2DROP ( 32b --- ) Removes 32b from the stack. 2DUP ( 32b --- 32b 32b ) Duplicates 32b. 2OVER ( 32b1 32b2 --- 32b1 32b2 32b3 ) 32b3 is a copy of 32b1 2ROT ( 32b1 32b2 32b3 --- 32b2 32b3 32b1 ) Rotates 32b1 to the top of the stack. 2SWAP ( 32b1 32b2 --- 32b2 32b1 ) Swaps 32b1 and 32b2 on the stack. >< ( 8b1/8b2 --- 8b2/8b1 ) Swaps the upper and lower bytes of the value on the stack. >R ( 16b --- ) Removes 16b from user stack and place it onto return stack. ?DUP ( 16b --- 16b 16b ), ( 0 --- 0 ) Duplicates 16b if it is a non-zero. DEPTH ( --- +n ) Returns count +n of numbers on the data stack. DROP ( 16b --- ) Removes 16b from the data stack. DUP ( 16b --- 16b 16b ) Duplicates 16b. FDEPTH ( -- +n ) +n is the number of values contained on separate floating point stack. FDROP (F: r -- ) Remove r from the floating-point stack. FDUP (F: r -- r r ) Duplicate r. FNIP (F: r1 r2 --- r2 ) Remove second number down from floating-point stack. FOVER (F: r1 r2 -- r1 r2 r1 ) Place a copy of r1 on top of the floating-point stack. FSP ( --- addr ) User variable holds floating point stack pointer. FSP0 ( --- addr ) User variable holds initial value of floating point stack pointer. FSWAP (F: r1 r2 -- r2 r1 ) Exchange the top two floating-point stack items. OVER ( 16b1 16b2 --- 16b1 16b2 16b3 ) 16b3 is a copy of 16b1. PICK ( +n --- 16b ) Copies the data stack's +nth item onto the top. R0 ( --- addr ) Returns the address of the variable containing the initial value of the bottom of the return stack. R> ( --- 16b ) 16b is removed from the return stack and placed onto the data stack. R@ ( --- 16b ) 16b is a copy of the top of the return stack. RP@ ( --- addr ) addr is the address of the top of the return stack just before RP@ was executed. RP! ( --- ) A computer dependent proceedure to to initialize the return stack pointer from R0. ROLL ( +n --- ) Removes the stack's nth item and places it onto the top of stack. ROT ( 16b1 16b2 16b3 --- 16b2 16b3 16b1 ) Rotates 16b1 to the top of the stack. S0 ( --- addr ) Returns the address of the variable containing the initial value of the bottom of the stack. SP@ ( --- addr ) addr is the address of the top of the parameter stack just before SP@ was executed. SP! ( --- ) A computer dependent proceedure to to initialize the stack pointer from S0. SWAP ( 16b1 16b2 --- 16b2 16b1 ) Exchanges positions of the top two items of the stack. Vocabulary ASSEMBLER ( --- ) Replaces the first vocabulary in the search order with the assembler vocabulary. CONTEXT ( --- addr ) Returns the address of a user variable that determines the vocabulary to be searched first in the dictionary. CURRENT ( --- addr ) Returns the address of the user variable specifying the vocabulary into which new word definitions will be entered. DEFINITIONS ( --- ) Specify the vocabulary into which new definitions are to be added. EDITOR ( --- ) Replaces the first vocabulary in the search order with the editor vocabulary. FORTH ( --- ) Replaces the first vocabulary in the search order with FORTH. FORTH-83 ( --- ) Initializes FORTH-83 into the system. VOCABULARY ( --- ) Creates a vocabulary word. WORDS ( --- ) Lists all the words in the CURRENT vocabulary. Max-FORTH F68HC11 V3.3 MEMORY MAP +--+-----+-------------+----------------------------------------+ DEC HEX NAME VALUE +--+-----+-------------+----------------------------------------+ 0 $0000 W 0 1 $0001 " 2 $0002 IP 0 WORD PTR AFTER BOOT PAT. 3 $0003 " 4 $0004 UP $0006 UAREA 5 $0005 " 6 $0006 DNLINK 0 7 $0007 " 8 $0008 UPLINK 0 9 $0009 " 10 $000A PRIORITY 0 11 $000B " 12 $000C RPSAVE 0 13 $000D " 14 $000E R0 STACKINIT 15 $000F " 16 $0010 S0 BOS 17 $0011 " 18 $0012 KEY-BC-PTR DEFKEY 19 $0013 " 20 $0014 EMIT-BC-PTR DEFOUT 21 $0015 " 22 $0016 UKEY KEYSUB+2 23 $0017 " 24 $0018 UEMIT EMITSUB+2 25 $0019 " 26 $001A U?TERMINAL QTSUB+2 27 $001B " 28 $001C TIB TIBX 29 $001D " 30 $001E UC/L 16 31 $001F " 32 $0020 CLD/WRM $A55A 33 $0021 " 34 $0022 UPAD UPADINIT 35 $0023 " 36 $0024 BASE 10 37 $0025 " 38 $0026 C/10MS 20000 39 $0027 " 40 $0028 CR CHARACTER $0D 41 $0029 " 42 $002A BS CHARACTER $08 43 $002B " 44 $002C DP TOP 45 $002D " 46 $002E DP\ 0 47 $002F " 48 $0030 EDP $B604 49 $0031 " 50 $0032 HEADERLESS 0 51 $0033 " 52 $0034 VOC-LINK UAREA+UASMOF+2 53 $0035 " 54 $0036 $81 $81,$A0 55 $0037 $A0 56 $0038 UFORTH NTOP 57 $0039 " 58 $003A 00 0000 59 $003B 00 60 $003C $81 $81,$A0 61 $003D $A0 62 $003E UEDITOR EDTOP 63 $003F " 64 $0040 " UAREA+U4TH+2 65 $0041 " 66 $0042 $81 $81,$A0 67 $0043 $A0 68 $0044 UASSEMBLER ASMTOP 69 $0045 " 70 $0046 " UAREA+UEDITOR+2 71 $0047 " 72 $0048 WIDTH 31 73 $0049 " 74 $004A FENCE NTOP 75 $004B " 76 $004C UABORT ABORT 77 $004D " 78 $004E UFIRST $D7FC 79 $004F " 80 $0050 ULIMIT $E000 81 $0051 " 82 $0052 OFFSET 0 83 $0053 " 84 $0054 WARNING 0 85 $0055 " 86 $0056 UR/W RAM DISK 87 $0057 " 88 $0058 >IN 89 $0059 " 90 $005A SPAN 91 $005B " 92 $005C #TIB 93 $005D " 94 $005E DPL 95 $005F " 96 $0060 FLD 97 $0061 " 98 $0062 USE 99 $0063 " 100 $0064 PREV 101 $0065 " 102 $0066 BLK 103 $0067 " 104 $0068 SCR 105 $0069 " 106 $006A CONTEXT 107 $006B " 108 $006C CURRENT 109 $006D " 110 $006E STATE 111 $006F " 112 $0070 CSP 113 $0071 " 114 $0072 CYLINDER 115 $0073 " 116 $0074 " 117 $0075 " 118 $0076 DISKNO 119 $0077 " 120 $0078 B/SIDE 121 $0079 " TOS END USER VARIABLES 122 $007A NTOP $84 123 $007B 'T' 124 $007C 'A' 125 $007D 'S' 126 $007E 'K' 127 $007F LINK 128 $0080 " 129 $0081 PFAPTR 130 $0082 " 131 $0083 (dictionary) TOP 132 $0084 " 133 $0085 " 134 $0086 " 135 $0087 " 136 $0088 " 137 $0089 " 138 $008A 139 $008B 140 $008C 141 $008D 142 $008E 143 $008F 144 $0090 145 $0091 146 $0092 147 $0093 148 $0094 149 $0095 150 $0096 151 $0097 152 $0098 153 $0099 154 $009A 155 $009B 156 $009C 157 $009D 158 $009E 159 $009F 160 $00A0 161 $00A1 162 $00A2 163 $00A3 164 $00A4 165 $00A5 166 $00A6 167 $00A7 168 $00A8 DATA STACK 16 169 $00A9 " 170 $00AA DATA STACK 15 171 $00AB " 172 $00AC DATA STACK 14 173 $00AD " 174 $00AE DATA STACK 13 175 $00AF " 176 $00B0 DATA STACK 12 177 $00B1 " 178 $00B2 DATA STACK 11 179 $00B3 " 180 $00B4 DATA STACK 10 181 $00B5 " 182 $00B6 DATA STACK 9 183 $00B7 " 184 $00B8 DATA STACK 8 185 $00B9 " 186 $00BA DATA STACK 7 187 $00BB " 188 $00BC DATA STACK 6 189 $00BD " 190 $00BE DATA STACK 5 191 $00BF " 192 $00C0 DATA STACK 4 193 $00C1 " 194 $00C2 DATA STACK 3 195 $00C3 " 196 $00C4 DATA STACK 2 197 $00C5 " 198 $00C6 DATA STACK 1 199 $00C7 " 200 $00C8 (digits) (BLK) BOS S0 IN Y 201 $00C9 (digits) " 202 $00CA (digits) (IN) 203 $00CB (digits) " 204 $00CC (digits) 205 $00CD (digits) 206 $00CE (digits) 207 $00CF (digits) 208 $00D0 TIBX UPADINIT 209 $00D1 " 211 $00D3 " 212 $00D4 " 213 $00D5 " 214 $00D6 " 215 $00D7 " 216 $00D8 " 217 $00D9 " 218 $00DA " 219 $00DB " 220 $00DC " 221 $00DD " 222 $00DE " 223 $00DF " 224 $00E0 RETURN STACK 16 225 $00E1 " 226 $00E2 RETURN STACK 15 227 $00E3 " 228 $00E4 RETURN STACK 14 229 $00E5 " 230 $00E6 RETURN STACK 13 231 $00E7 " 232 $00E8 RETURN STACK 12 233 $00E9 " 234 $00EA RETURN STACK 11 235 $00EB " 236 $00EC RETURN STACK 10 237 $00ED " 238 $00EE RETURN STACK 9 239 $00EF " 240 $00F0 RETURN STACK 8 241 $00F1 " 242 $00F2 RETURN STACK 7 243 $00F3 " 244 $00F4 RETURN STACK 6 245 $00F5 " 246 $00F6 RETURN STACK 5 247 $00F7 " 248 $00F8 RETURN STACK 4 249 $00F9 " 250 $00FA RETURN STACK 3 251 $00FB " 252 $00FC RETURN STACK 2 253 $00FD " 254 $00FE RETURN STACK 1 255 $00FF " STACKINIT RESET PUT INTO S $103D INIT REG $0B REV 2 ($09 REV 0-1) BY RESET $B000 PORTA ($9000 REV 0-1) $B001 Reserved etc. $B002 PIOC $B003 PORTC $B004 PORTB $B005 PORTCL $B006 Reserved $B007 DDRC $B008 PORTD $B009 DDRD $B00A PORTE $B00B CFORC $B00C OC1M $B00D OC1D $B00E TCNT $B00F " $B010 TIC1 $B011 " $B012 TIC2 $B013 " $B014 TIC3 $B015 " $B016 TOC1 $B017 " $B018 TOC2 $B019 " $B01A TOC3 $B01B " $B01C TOC4 $B01D " $B01E TOC5 $B01F " $B020 TCTL1 $B021 TCTL2 $B022 TMSK1 $B023 TFLG1 $B024 TMSK2 $B025 TFLG2 $B026 PACTL $B027 PACNT $B028 SPCR $B029 SPSR $B02A SPDR $B02B BAUD $30 BY RESET $B02C SCCR1 $00 BY RESET $B02D SCCR2 $0C BY RESET $B02E SCSR $B02F SCDR $B030 ADCTL $B031 ADR1 $B032 ADR2 $B033 ADR3 $B034 ADR4 $B035 Reserved $B036 Reserved $B037 Reserved $B038 Reserved $B039 OPTION $B03A COPRST $B03B PPROG $B03C HPRIO $B03D INIT $0B BY RESET $B03E TEST1 $B03F CONFIG $B600 EEPROM AUTOSTART LOC HI-LEVEL IN EEPROM $B601 " " $B602 " CFA OF WORD FOR HI-LEVEL AUTOSTART $B603 " " " " " UNASSIGNED " " $B7BF " SCI SER SYS INT VEC AT $FFD6 POINTS HERE " " $B7C2 " SPI SERIAL $FFD8 " " $B7C5 " PLS ACC OVRFL $FFDA " " $B7C8 " PLS ACC EDGE $FFDC " " $B7CB " TMR OVERFLOW $FFDE " " $B7CE " TMR OUT CAP 5 $FFE0 " " $B7D1 " TMR OUT CAP 4 $FFE2 " " $B7D4 " TMR OUT CAP 3 $FFE4 " " $B7D7 " TMR OUT CAP 2 $FFE6 " " $B7DA " TMR OUT CAP 1 $FFE8 " " $B7DD " TMR IN CAP 3 $FFEA " " $B7E0 " TMR IN CAP 2 $FFEC " " $B7E3 " TMR IN CAP 1 $FFEE " " $B7E6 " REAL TIME $FFF0 " " $B7E9 " IRQ $FFF2 " " $B7EC " XIRQ $FFF4 " " $B7EF " SWI $FFF6 " " $B7F2 " OP-CODE TRAP $FFF8 " " $B7F5 " COP FAILURE $FFFA " " $B7F8 " COP Clk Mon $FFFC " " $B7FB " ENTRY POINT FOR RESET SUB $B7FC " " $B7FD " " $B7FE " AUTOSTART LOC FOR RESET SUBROUTINE BEFORE $B7FF EEPROM REG INITIALIZATION FOR 64 CLK CYC REG SET $E000 ROM AND HEADS " " " " " $XXXX NON RUN TIME CODES " " " " " $XXXX RUN TIME CODES " " " " " $XXX0 DEFKEY SCSR IN ROM ADDRESS OF STATUS REG. $XXX1 $XXX2 DEFKEY+2 $20 IN ROM AND MASK $XXX3 DEFKEY+3 0 IN ROM XOR MASK $XXX4 DEFKEY+4 SCDR IN ROM ADDRESS OF INPUT REG. $XXX5 $XXX6 DEFOUT SCSR IN ROM ADDRESS OF STATUS REG $XXX7 $XXX8 DEFOUT+2 $80 IN ROM AND MASK $XXX9 DEFOUT+3 0 IN ROM XOR MASK $XXXA DEFOUT+4 SCDR IN ROM ADDRESS OF OUTPUT REGISTER $XXXB " $FFC0 RESERVED $FFC1 " $FFC2 RESERVED $FFC3 " $FFC4 RESERVED $FFC5 " $FFC6 RESERVED $FFC7 " $FFC8 RESERVED $FFC9 " $FFCA RESERVED $FFCB " $FFCC RESERVED $FFCD " $FFCE RESERVED $FFCF " $FFD0 RESERVED $FFD1 " $FFD2 RESERVED $FFD3 " $FFD4 RESERVED $FFD5 " $FFD6 SCI SER SYS $B7BF IN ROM $FFD7 " $FFD8 SPI SERIAL $B7C2 IN ROM $FFD9 " $FFDA PLS ACC EDGE $B7C5 IN ROM $FFDB " $FFDC PLS ACC OVRFL $B7C8 IN ROM $FFDD " $FFDE TMR OVERFLOW $B7CB IN ROM $FFDF " $FFE0 TMR OUT CAP 5 $B7CE IN ROM $FFE1 " $FFE2 TMR OUT CAP 4 $B7D1 IN ROM $FFE3 " $FFE4 TMR OUT CAP 3 $B7D4 IN ROM $FFE5 " $FFE6 TMR OUT CAP 2 $B7D7 IN ROM $FFE7 " $FFE8 TMR OUT CAP 1 $B7DA IN ROM $FFE9 " $FFEA TMR IN CAP 3 $B7DD IN ROM $FFEB " $FFEC TMR IN CAP 2 $B7E0 IN ROM $FFED " $FFEE TMR IN CAP 1 $B7E3 IN ROM $FFEF " $FFF0 REAL TIME $B7E6 IN ROM $FFF1 " $FFF2 IRQ $B7E9 IN ROM $FFF3 " $FFF4 XIRQ $B7EC IN ROM $FFF5 " $FFF6 SWI $B7EF IN ROM $FFF7 " $FFF8 OP-CODE TRAP $B7F2 IN ROM $FFF9 " $FFFA COP FAILURE $B7F5 IN ROM $FFFB " $FFFC COP Clk Mon $B7F8 IN ROM $FFFD " $FFFE RESET COLD+2 IN ROM $FFFF " F68HC11 V3.5 MEMORY MAP DEC HEX NAME VALUE/DESCRIPTION === ===== ============ ================= 0 $0000 W 0: Word Pointer 1 $0001 " 2 $0002 IP 0: Instruction Pointer 3 $0003 " 4 $0004 UP $0006: UAREA 5 $0005 " 6 $0006 DNLINK Linked List of Tasks 7 $0007 " 8 $0008 UPLINK Linked List of Tasks 9 $0009 " 10 $000A PRIORITY Priority Level of Task 11 $000B " 12 $000C RPSAVE Program Counter 13 $000D " Location 6 thru D are reserved for multitasking. Whey they are not used, they can be used as variable locations. 14 $000E R0 STACKINIT: Base Address of Return Stack 15 $000F " 16 $0010 S0 BOS: Base Address of Data Stack R0 and S0 can be modified to point into external RAM if larger stack areas are desired. They will not be put into effect until ABORT is executed. 17 $0011 " 18 $0012 KEY-BC-PTR DEFKEY: Address of Control Blocks that determine how the built-in input routines work. 19 $0013 " 20 $0014 EMIT-BC-PTR DEFOUT: Address of Control Blocks that determine how the built-in output routines work. 21 $0015 " 22 $0016 UKEY KEYSUB+2: Address of Input Subroutines 23 $0017 " 24 $0018 UEMIT EMITSUB+2: Address of Output Subroutines 25 $0019 " 26 $001A U?TERMINAL QTSUB+2: Address of ?TERMINAL Subroutines 27 $001B " 28 $001C TIB TIBX: Starting Address of Terminal Input Buffer 29 $001D " 30 $001E UC/L 16: Length of TIB 31 $001F " 32 $0020 CLD/WRM $A55A: As long as this contains a $A55A pattern and there is no in the serial channel, the system will not do a cold download of system variables at every reset. 33 $0021 " 34 $0022 UPAD UPADINIT: Base Address of Scratch Pad used for output number conversion 35 $0023 " 36 $0024 BASE 10: Current Number Base 37 $0025 " 38 $0026 C/10MS 20000: Cycles per 10 Milliseconds delay 39 $0027 " 40 $0028 CR CHARACTER $0D: ASCII value of CR 41 $0029 " 42 $002A BS CHARACTER $08: ASCII value of BS 43 $002B " 44 $002C DP TOP: Dictionary Pointer 45 $002D " 46 $002E DP\ 0: Head Dictionary Pointer 47 $002F " 48 $0030 EDP $B604: EEPROM Dictionary Usage Pointer that is used to when a word is moved into EEPROM with EEWORD 49 $0031 " 50 $0032 HEADERLESS 0: Flag that controls headerless code generation 51 $0033 " 52 $0034 VOC-LINK UAREA+UASMOF+2 53 $0035 " 54 $0036 $81 $81: Fake head mode of count 1 with MSB set to 1 55 $0037 $A0 $A0: Blank(=$20) with MSB set to 1 56 $0038 UFORTH NTOP: Name Field Address of top word 57 $0039 " 58 $003A 00 0000 59 $003B 00 60 $003C $81 $81 61 $003D $A0 $A0 62 $003E UEDITOR EDTOP: Reserved for future use of EDITOR 63 $003F " 64 $0040 " UAREA+U4TH+2 65 $0041 " 66 $0042 $81 $81 67 $0043 $A0 $A0 68 $0044 UASSEMBLER ASMTOP: Reserved for future use of ASSEMBLER 69 $0045 " 70 $0046 " UAREA+UEDITOR+2 71 $0047 " 72 $0048 WIDTH 31: Maximum length of word 73 $0049 " 74 $004A FENCE NTOP: Lower limit restricting FORGET 75 $004B " 76 $004C UABORT ABORT: Error handling vector 77 $004D " 78 $004E UFIRST $C7FC: The address of first block buffer 79 $004F " 80 $0050 ULIMIT $D000: End of block buffer 81 $0051 " 82 $0052 OFFSET 0: The offset added to the block number on the stack by BLOCK or BUFFER to determine the actual physical block number 83 $0053 " 84 $0054 WARNING 0: Shows how error is handled. 85 $0055 " 86 $0056 UR/W RAM DISK: Default location 87 $0057 " 88 $0058 >IN # of bytes from the beginning of the input stream at any particular moment during interpretation 89 $0059 " 90 $005A SPAN The count of characters received and stored by the most recent execution of EXPECT 91 $005B " 92 $005C #TIB The number of characters input #TIB is accessed by WORD when BLK is 0 93 $005D " 94 $005E DPL The number of places after the fractional point for input conversion 95 $005F " 96 $0060 FLD The value of the field length reserved for a number during output conversion 97 $0061 " 98 $0062 USE The address of block buffer currently using 99 $0063 " 100 $0064 PREV The address of block buffer previously used 101 $0065 " 102 $0066 BLK The number of block that is currently being interpreted 103 $0067 " 104 $0068 SCR The number of block most recently listed 105 $0069 " 106 $006A CONTEXT The vocabulary to be searched first in the dictionary 107 $006B " 108 $006C CURRENT The vocabulary into which new word definitions will be entered 109 $006D " 110 $006E STATE The value defining the compilation state 111 $006F " 112 $0070 CSP Temporary location for the Check Stack Pointer(CSP) position for compilation error checking 113 $0071 " 114 $0072 CYLINDER Base Address of the Ram Disk 115 $0073 " 116 $0074 FSP Floating-point Stack Pointer 117 $0075 " 118 $0076 FSP0(DISKNO) 158: Base Address of Floating-point Stack 119 $0077 " 120 $0078 PLACES(B/SIDE) Number of digits to the right of the radix point displayed by E. or F. 121 $0079 " TOS END USER VARIABLES 122 $007A (digits) 123 $007B (digits) 124 $007C (digits) 125 $007D (digits) 126 $007E (digits) 127 $007F (digits) 128 $0080 (digits) 129 $0081 (digits) 130 $0082 (digits) 131 $0083 (digits) 132 $0084 (digits) 133 $0085 (digits) 134 $0086 (digits) 135 $0087 (digits) PAD DOWN FOR 14 CHAR 136 $0088 (characters) TIBX UPADINIT 137 $0089 (characters) 138 $008A (characters) 139 $008B (characters) 140 $008C (characters) 141 $008D (etc.) 142 $008E 143 $008F 144 $0090 145 $0091 146 $0092 147 $0093 148 $0094 149 $0095 150 $0096 151 $0097 152 $0098 153 $0099 154 $009A 155 $009B 156 $009C 157 $009D 158 $009E 159 $009F 160 $00A0 161 $00A1 162 $00A2 163 $00A3 164 $00A4 165 $00A5 166 $00A6 167 $00A7 168 $00A8 169 $00A9 170 $00AA 171 $00AB (characters) TIB continues 172 $00AC 173 $00AD 174 $00AE 175 $00AF 176 $00B0 177 $00B1 178 $00B2 179 $00B3 180 $00B4 181 $00B5 182 $00B6 183 $00B7 184 $00B8 185 $00B9 186 $00BA 187 $00BB 188 $00BC 189 $00BD 190 $00BE 191 $00BF 192 $00C0 193 $00C1 194 $00C2 195 $00C3 196 $00C4 197 $00C5 198 $00C6 199 $00C7 200 $00C8 201 $00C9 202 $00CA 203 $00CB 204 $00CC 205 $00CD 206 $00CE 207 $00CF 208 $00D0 209 $00D1 211 $00D3 212 $00D4 213 $00D5 214 $00D6 215 $00D7 TIB ends 216 $00D8 RETURN STACK 20 217 $00D9 " 218 $00DA RETURN STACK 19 219 $00DB " 220 $00DC RETURN STACK 18 221 $00DD " 222 $00DE RETURN STACK 17 223 $00DF " 224 $00E0 RETURN STACK 16 225 $00E1 " 226 $00E2 RETURN STACK 15 227 $00E3 " 228 $00E4 RETURN STACK 14 229 $00E5 " 230 $00E6 RETURN STACK 13 231 $00E7 " 232 $00E8 RETURN STACK 12 233 $00E9 " 234 $00EA RETURN STACK 11 235 $00EB " 236 $00EC RETURN STACK 10 237 $00ED " 238 $00EE RETURN STACK 9 239 $00EF " 240 $00F0 RETURN STACK 8 241 $00F1 " 242 $00F2 RETURN STACK 7 243 $00F3 " 244 $00F4 RETURN STACK 6 245 $00F5 " 246 $00F6 RETURN STACK 5 247 $00F7 " 248 $00F8 RETURN STACK 4 249 $00F9 " 250 $00FA RETURN STACK 3 251 $00FB " 252 $00FC RETURN STACK 2 253 $00FD " 254 $00FE RETURN STACK 1 255 $00FF " R0 PUT IN S 256 $0100 DATA STACK 20 257 $0101 " 258 $0102 DATA STACK 19 259 $0103 " 260 $0104 DATA STACK 18 261 $0105 " 262 $0106 DATA STACK 17 263 $0107 " 264 $0108 DATA STACK 16 265 $0109 " 266 $010A DATA STACK 15 267 $010B " 268 $010C DATA STACK 14 269 $010D " 270 $010E DATA STACK 13 271 $010F " 272 $0110 DATA STACK 12 273 $0111 " 274 $0112 DATA STACK 11 275 $0113 " 276 $0114 DATA STACK 10 277 $0115 " 278 $0116 DATA STACK 9 279 $0117 " 280 $0118 DATA STACK 8 281 $0119 " 282 $011A DATA STACK 7 283 $011B " 284 $011C DATA STACK 6 285 $011D " 286 $011E DATA STACK 5 287 $011F " 288 $0120 DATA STACK 4 289 $0121 " 290 $0122 DATA STACK 3 291 $0123 " 292 $0124 DATA STACK 2 293 $0125 " 294 $0126 DATA STACK 1 295 $0127 " 296 $0128 F.P.STACK 8 S0 IN Y 297 $0129 " 298 $012A 299 $012B 300 $012C 301 $012D 302 $012E F.P.STACK 7 303 $012F 304 $0130 305 $0131 306 $0132 307 $0133 308 $0134 F.P.STACK 6 309 $0135 310 $0136 311 $0137 312 $0138 313 $0139 314 $013A F.P.STACK 5 315 $013B 316 $013C 317 $013D 318 $013E 319 $013F 320 $0140 F.P.STACK 4 321 $0141 322 $0142 323 $0143 324 $0144 325 $0145 326 $0146 F. P. STACK 3 327 $0147 328 $0148 329 $0149 330 $014A 331 $014B 332 $014C F. P. STACK 2 333 $014D 334 $014E 335 $014F 336 $0150 337 $0151 338 $0152 F. P. STACK 1 339 $0153 340 $0154 341 $0155 342 $0156 343 $0157 344 $0158 NTOP $84 345 $0159 'T' 346 $015A 'A' 347 $015B 'S' 348 $015C 'K+80' 349 $015D LINK 350 $015E " 351 $015F PFAPTR 352 $0160 " 353 $0161 (dictionary) TOP 354 $0162 " 355 $0163 " 356 $0164 " 511 $01FF END OF INTERNAL RAM $103D INIT REG $0B REV 2-3 ($09 REV 0-1) BY RESET $B000 PORTA Port A Data Register $B001 Reserved $B002 PIOC Parallel I/O Control Register $B003 PORTC Port C Data Register $B004 PORTB Port B Data Register $B005 PORTCL Port C Latched Data Register $B006 Reserved $B007 DDRC Data Direction Register for Port C $B008 PORTD Port D Data Register $B009 DDRD Data Direction Register for Port D $B00A PORTE Port E Data Register $B00B CFORC Timer Compare Force Register $B00C OC1M Output Compare 1 Mask Register $B00D OC1D Output Compare 1 Data Register $B00E TCNT Timer Counter Register $B00F " $B010 TIC1 Timer Input Capture Register 1 $B011 " $B012 TIC2 Timer Input Capture Register 2 $B013 " $B014 TIC3 Timer Input Capture Register 3 $B015 " $B016 TOC1 Timer Output Compare Register 1 $B017 " $B018 TOC2 Timer Output Compare Register 2 $B019 " $B01A TOC3 Timer Output Compare Register 3 $B01B " $B01C TOC4 Timer Output Compare Register 4 $B01D " $B01E TI4O5 Timer Input Capture 4 or Output Compare 5 Register $B01F " $B020 TCTL1 Timer Control Register 1 $B021 TCTL2 Timer Control Register 2 $B022 TMSK1 Main Timer Interrupt Mask Reg.1 $B023 TFLG1 Main Timer Interrupt Flag Reg.1 $B024 TMSK2 Misc. Timer Interrupt Mask Reg.2 $B025 TFLG2 Misc. Timer Interrupt Flag Reg.2 $B026 PACTL Pulse Accumulator Control Register $B027 PACNT Pulse Accumulator Count Register $B028 SPCR SPI Control Register $B029 SPSR SPI Status Register $B02A SPDR SPI Data Register $B02B BAUD SCI Baud Rate Control Register $30 BY RESET $B02C SCCR1 SCI Control Register $00 BY RESET $B02D SCCR2 SCI Control Register 2 $0C BY RESET $B02E SCSR SCI Status Register $B02F SCDR SCI Data Register $B030 ADCTL A/D Control/Status Register $B031 ADR1 A/D Result Register 1 $B032 ADR2 A/D Result Register 2 $B033 ADR3 A/D Result Register 3 $B034 ADR4 A/D Result Register 4 $B035 BPROT Block Protect Register $B036 Reserved $B037 Reserved $B038 Reserved $B039 OPTION System Configuration Options $B03A COPRST Arm/Reset COP Timer Circuitry $B03B PPROG EEPROM Programming Register $B03C HPRIO Highest Priority Interrupt & Misc. $B03D INIT RAM and I/O Mapping register $0B BY RESET $B03E TEST1 Factory Test Register $B03F CONFIG Configuration Control register $B600 EEPROM AUTOSTART LOC HI-LEVEL IN EEPROM $B601 " " $B602 " CFA OF WORD FOR HI-LEVEL AUTOSTART $B603 " " " " " unassigned " " $B7BF " SCI SER SYS INT VEC AT $FFD6 POINTS HERE " " $B7C2 " SPI SERIAL $FFD8 " " $B7C5 " PLS ACC EDGE $FFDA " " $B7C8 " PLS ACC OVRFL $FFDC " " $B7CB " TMR OVERFLOW $FFDE " " $B7CE " TMR OUT CAP 5 $FFE0 " " $B7D1 " TMR OUT CAP 4 $FFE2 " " $B7D4 " TMR OUT CAP 3 $FFE4 " " $B7D7 " TMR OUT CAP 2 $FFE6 " " $B7DA " TMR OUT CAP 1 $FFE8 " " $B7DD " TMR IN CAP 3 $FFEA " " $B7E0 " TMR IN CAP 2 $FFEC " " $B7E3 " TMR IN CAP 1 $FFEE " " $B7E6 " REAL TIME $FFF0 " " $B7E9 " IRQ $FFF2 " " $B7EC " XIRQ $FFF4 " " $B7EF " SWI $FFF6 " " $B7F2 " OP-CODE TRAP $FFF8 " " $B7F5 " COP FAILURE $FFFA " " $B7F8 " COP Clk Mon $FFFC " " $B7FB " ENTRY POINT FOR RESET SUB $B7FC " " $B7FD " " $B7FE " AUTOSTART LOC FOR RESET SUBROUTINE BEFORE $B7FF EEPROM REG INITIALIZATION FOR 64 CLK CYC REG $D000 FLOATING POINT ROM " " ADDTIONAL HEADS " $E000 ROM AND HEADS " " " " " $XXXX NON RUN TIME CODES " " " " " $XXXX RUN TIME CODES " " " " " $XXX0 DEFKEY SCSR IN ROM ADDRESS OF STATUS REG. $XXX1 $XXX2 DEFKEY+2 $20 IN ROM AND MASK $XXX3 DEFKEY+3 0 IN ROM XOR MASK $XXX4 DEFKEY+4 SCDR IN ROM ADDRESS OF INPUT REG. $XXX5 $XXX6 DEFOUT SCSR IN ROM ADDRESS OF STATUS REG $XXX7 $XXX8 DEFOUT+2 $80 IN ROM AND MASK $XXX9 DEFOUT+3 0 IN ROM XOR MASK $XXXA DEFOUT+4 SCDR IN ROM ADDRESS OF OUTPUT REGISTER $XXXB " $FFC0 RESERVED $FFC1 " $FFC2 RESERVED $FFC3 " $FFC4 RESERVED $FFC5 " $FFC6 RESERVED $FFC7 " $FFC8 RESERVED $FFC9 " $FFCA RESERVED $FFCB " $FFCC RESERVED $FFCD " $FFCE RESERVED $FFCF " $FFD0 RESERVED $FFD1 " $FFD2 RESERVED $FFD3 " $FFD4 RESERVED $FFD5 " $FFD6 SCI SER SYS $B7BF IN ROM $FFD7 " $FFD8 SPI SERIAL $B7C2 IN ROM $FFD9 " $FFDA PLS ACC OVRFL $B7C5 IN ROM $FFDB " $FFDC PLS ACC EDGE $B7C8 IN ROM $FFDD " $FFDE TMR OVERFLOW $B7CB IN ROM $FFDF " $FFE0 TMR OUT CAP 5 $B7CE IN ROM $FFE1 " $FFE2 TMR OUT CAP 4 $B7D1 IN ROM $FFE3 " $FFE4 TMR OUT CAP 3 $B7D4 IN ROM $FFE5 " $FFE6 TMR OUT CAP 2 $B7D7 IN ROM $FFE7 " $FFE8 TMR OUT CAP 1 $B7DA IN ROM $FFE9 " $FFEA TMR IN CAP 3 $B7DD IN ROM $FFEB " $FFEC TMR IN CAP 2 $B7E0 IN ROM $FFED " $FFEE TMR IN CAP 1 $B7E3 IN ROM $FFEF " $FFF0 REAL TIME $B7E6 IN ROM $FFF1 " $FFF2 IRQ $B7E9 IN ROM $FFF3 " $FFF4 XIRQ $B7EC IN ROM $FFF5 " $FFF6 SWI $B7EF IN ROM $FFF7 " $FFF8 OP-CODE TRAP $B7F2 IN ROM $FFF9 " $FFFA COP FAILURE $B7F5 IN ROM $FFFB " $FFFC COP Clk Mon $B7F8 IN ROM $FFFD " $FFFE RESET COLD+2 IN ROM $FFFF " Max-FORTH 68HC11 MACHINE CODE ROUTINES ;HERE IS AN EXAMPLE USE OF ATO4... ; LDD #WORDS ; JSR ATO4 ; JMP NEXT ATO4PTR: CFAFLD DOCON .WORD ATO4 ATO4: LDX IP ;SAVE INTERPRETIVE POINTER PSHX LDX W PSHX LDX #RETPNT-2 ;POINT TO RETURNING 'WORD' STX IP XGDX ;PUT NEW EXECUTION ADDRESS IN X JMP NEXT2 ;SET UP W AND EXECUTE HIGH LEVEL WORD RETPNT: .WORD ASMRET ASMRET: .WORD GORET GORET: PULX ;RESTORE W STX W PULX ;RESTORE IP STX IP RTS CHKFLG: BLT TRFLAG FLFLAG: CLRA CLRB JMP BINARY TRFLAG: LDD #$FFFF JMP BINARY SETFLG: BLO TRFLAG BRA FLFLAG SFALSE: CLRA CLRB JMP NEXTSD STRUE: LDD #$FFFF JMP NEXTSD POPTWO: INY ;THROW AWAY THE VALUES ON DATA STACK INY POP: INY INY JMP NEXT BUMP: LDX IP INX INX JMP NEXT3 ;BRANCH NOT TAKEN BINARY: STD 2,Y JMP POP ;**************************************************************** ************* ; PUSHD, ANOTHER ENTRY TO NEXT ;**************************************************************** ************* PUSHD: DEY DEY NEXTSD: STD 0,Y ;STORE DOUBLE ACCUMULATOR ON STACK ;**************************************************************** ************* ;NEXT IS THE ADDRESS INTERPRETER THAT MOVES FROM ;MACHINE LEVEL WORD TO WORD. ;**************************************************************** ************* NEXT: LDX IP ;X NOW CONTAINS THE ADDRESS OF A COLON DEF ;ENTRY. X POINTS TO A POINTER TO A POINTER ;TO CODE. NEXT3: INX ;POINT TO NEXT COLON DEF ENTRY TO EXECUTE INX STX IP NEXT1: LDX 0,X ;X NOW POINTS TO CFA OF COLON DEF NEXT2: STX W ;W IS A POINTER TO A POINTER TO CODE LDX 0,X ;X IS NOW A POINTER TO CODE JMP 0,X ;JUMP TO ANOTHER INTERPRETER ;**************************************************************** ************* ; INNER INTERPRETERS AND SEMIS FOLLOW ;**************************************************************** ************* DOSUB: LDX W ;W IS POINTER TO CFA OF WORD NOW EXECUTING JSR 2,X ;EXECUTE SUBROUTINE BODY JMP NEXT CSDOE: LDD 0,Y LSLD ADDD W ADDD #2 XGDX LDD 0,X STD 0,Y JMP EXEC+2 DO2CON: LDX W ;GET CFA OF CONSTANT LDD 4,X ;GET DATA OUT OF PFA OF CONSTANT DEY DEY STD 0,Y LDD 2,X JMP PUSHD DOCON: LDX W ;GET CFA OF CONSTANT LDD 2,X ;GET DATA OUT OF PFA OF CONSTANT JMP PUSHD DOUSE: LDX W ;GET CFA OF USER VARIABLE CLRA ;OFFSET IS A BYTE LDAB 2,X ;GET OFFSET OF USER VARIABLE ADDD UP JMP PUSHD DOVAR: LDD W ADDD #2 JMP PUSHD DODOE: LDX IP PSHX ;SAVE IP ON STACK LDX W ;GET POINTER TO CFA OF DOES WORD INX INX ;NOW X POINTS TO PFA OF DOES WORD PSHX ;SAVE IT FOR LATER LDX 0,X ;GET FIRST PFA ENTRY FROM DOES WORD STX IP PULX ;RECOVER CFA ADDRESS INX ;MAKE IT POINT TO PFA ADDRESS INX XGDX JMP PUSHD ;PUT PFA ADDRESS ON STACK DOCOL: LDX IP ;PUSH IP ONTO RETURN STACK PSHX LDX W STX IP JMP NEXT3 EXIT: SEMIS: CFAFLD PULX ;GET OLD IP JMP NEXT3 ;ENTER NEXT AFTER IP LOADED INTO X Max-FORTH 68HC11 SELECTED OPERATING SYSTEM SEGMENTS ;**************************************************************** ************* ; VERSION AND REVISION LOG WITH EXPANATIONS AND CONDITIONAL ASSEMBLY LABELS ;**************************************************************** ************* ; VERSION 1 IS NON AUTOSTART FOR EXTERNAL EPROM (AUTOSTART FORCED TO EPROM) ; VERSION 2 IS AUTOSTART VERSION FOR EXTERNAL EPROM ; VERSION 3 IS AUTOSTART VERSION FOR INTERNAL ROM ; REVISION 0 WAS FIRST RELEASE ; REVISION 1 PUT FIXES IN UM/MOD, VOCABULARY, DODOES, ABORT", AND ?STACK ; REVISION 2 CHANGES EEC! FOR SAFTEY, MOVES INITCON TO $B000 ;**************************************************************** ************* ;**************************************************************** ************* ; OPERATING SYSTEM ;**************************************************************** ************* COLD: CFAFLD STX UAREA+CLDOFF ;BOMB CLDVAR FLAG, USE HARD ADDR RESET: LDS #RPINIT LDD $B7FE ;CHECK FOR IMMEDIATE AUTOSTART SUB CPD #BOOTME BNE RES1 JSR $B7FB ;LEAVE FOR QUICK START RES1: LDAA #REGCTL ;RAM AT 0, REGS AT $B000 STAA INIT+$1000 ;A/D UP WITH E CLOCK, ;IRQ LEVEL SENSITIVE, ;CLOCK MONITOR DISABLED, ;COP TIMER RATE SELECTED 1.049 SECONDS LDAA #$93 STAA OPTION+INITCON LDAA #$0C STAA SCCR2+INITCON ;SCCR2 GETS C LDAA #$30 STAA BAUD+INITCON LDAA INITCON+SCDR ;LOOK AT SER IN CMPA #$07 ;BELL CHAR BEQ ISCOLD ;DO COLD NO MATTER LDD #BOOTME ;LOOK AT CLD/WRM CPD UAREA+CLDOFF ;CMP TO BOOTME PATTERN BEQ SEARCH ;BYPASS COLD DNLOAD IF = ISCOLD: LDY #RNTOP LDX #NTOP TSKMOV: LDAB 0,Y STAB 0,X INY INX CPX #NTOP+9 BLO TSKMOV LDY #CLDTOP LDX #UP+CLDSIZ CN: DEY DEX LDAB 0,Y ;GET BYTE FROM TABLE STAB 0,X ;PUT IT IN USER AREA CPX #UP ;UP ITSELF IS BOTTOM OF MOVE BNE CN SEARCH: LDY UAREA+S0OFF .IFDEF VERSION1 LDX #STRTUP STX IP EEPSRC: LDX #$E000 ;SECURITY V1.X LDD 0,X CPD #BOOTME BEQ GOSTRT .ELSE ;VERSION2 AND VERSION3 LDD #BOOT1ST BRA EEPSRC PASS2PTR: .WORD PASS2CFA PASS2CFA: .WORD PASS2PFA PASS2PFA: LDD #BOOTME EEPSRC: LDX #PASS2PTR-2 STX IP LDX #$B600 ;CHECK EEPROM FOR AUTOSTART CPD 0,X BEQ GOSTRT .ENDIF LDX #0 ;INIT POINTER FOR ROM SEARCH, V2,3 ROMSRC: XGDX ;ADD 4 TO TOP BYTE OF POINTER ADDD #$400 XGDX .IFDEF VERSION1 LDD 0,X CPD #BOOTME .ELSE ;VERSION2 AND VERSION3 BEQ PASS2PFA CPD 0,X .ENDIF BNE ROMSRC GOSTRT: LDX 2,X JMP NEXT2 ;**************************************************************** ************* ;HI-LEVEL ROUTINES, OPERATING SYSTEM ;**************************************************************** ************* ;STARTUP STRTUP: CFAFLD DOCOL .WORD CR ; CR .WORD PDOTQ ; (.() .BYTE 15,' Max-FORTH Vx.x' .WORD ABORT ; ABORT ABORT: CFAFLD DOCOL .WORD SPSTO ; SP! .WORD FORTH ; FORTH .WORD DEFIN ; DEFINITIONS .WORD QUIT ; QUIT QUIT: CFAFLD DOCOL .WORD BLK ; BLK .WORD CLEAR ; 0 ! .WORD LBRAC ; [ QUIT1: .WORD RPSTO ; RP! .WORD CR ; CR .WORD QUERY ; QUERY .WORD INTER ; INTERPRET .WORD QSTATE ; STATE @ .WORD NZBRAN ; 0= NOT .WORD QUIT1-$ ; IF .WORD PDOTQ ; (.() .BYTE 2,'OK' .WORD BRAN ; BRANCH .WORD QUIT1-$ ;**************************************************************** ************* ;BOOT UP PARAMETERS. ;**************************************************************** ************* CLDBOT: .WORD 6 ;UP INIT .WORD 0 ;DNLINK INIT .WORD 0 ;UPLINK INIT .WORD 0 ;PRIORITY INIT .WORD 0 ;RPSAVE INIT .WORD RPINIT ;R0 RETURN STACK INIT .WORD BOS ;S0 DATA STACK INIT .WORD DEFKEY ;DEFAULT INPUT CONTROL BLOCK .WORD DEFOUT ;DEFAULT OUTPUT CONTROL BLOCK .WORD KEYSUB+2 ;'VECTORED' INPUT ROUTINE .WORD EMITSUB+2 ;'VECTORED' OUTPUT ROUTINE .WORD QTSUB+2 ;'VECTORED' STATUS ROUTINE .WORD TIBX ;TIB INIT .WORD 16 ;UC/L INIT CHARACTERS PER LINE .WORD BOOTME ;CLD/WRM .WORD UPADINIT ;PAD INIT .WORD 10 ;BASE .WORD 20000 ;C/10MS .WORD $D ;DEFAULT TERMINATION CHARACTER .WORD 8 ;DEFAULT BACKSPACE INPUT CHARACTER .WORD TOP ;INITIAL VALUE OF 'DP' .WORD 0 ;INITIAL SEPERATED HEADS DP .WORD $B604 ;INITIAL EEPROM DP .WORD 0 ;INITIAL HEADERLESS .WORD UAREA+UASMOF+2 ;INITIAL 'VOC-LINK' .BYTE $81,$A0 ;CHAIN HEAD OF FORTH .WORD NTOP ;INITIAL VOCABULARY POINTER .WORD 0000 ;VOCABULARY LINK OF 'FORTH' IS NIL .BYTE $81,$A0 ;CHAIN HEAD FOR ASSEMBLER .WORD EDTOP ;INITIAL VOCABULARY PTR FOR ASSEM .WORD UAREA+U4TH+2 ;VOCAB LINK TO 'FORTH' VOC PTR .BYTE $81,$A0 ;CHAIN HEAD FOR ASSEMBLER .WORD ASMTOP ;INITIAL VOCABULARY PTR FOR ASSEM .WORD UAREA+UEDOFF+2 ;VOCAB LINK TO 'FORTH' VOC PTR .WORD 31 ;SET 'WIDTH' OF NAMES .WORD NTOP ;INITIAL VALUE OF 'FENCE' .WORD ABORT ;INIT USER ABORT VECTOR .WORD $D7FC ;FIRST .WORD $E000 ;LIMIT .WORD 0 ;OFFSET .WORD 0 ;WARNING ASSUMES NON DISK SYS .WORD RAMDSK ;UR/W FAIL CLDTOP: .EQU $ CLDSIZ: .EQU CLDTOP-CLDBOT ;**************************************************************** ************* ;DEFAULT I/O CONTROL BLOCKS. ;**************************************************************** ************* DEFKEY: .WORD INITCON+SCSR ;ADDRESS OF INPUT STATUS REGISTER .BYTE $20 ;AND MASK .BYTE 0 ;XOR MASK .WORD INITCON+SCDR ;ADDRESS OF INPUT REGISTER DEFOUT: .WORD INITCON+SCSR ;ADDRESS OF OUTPUT STATUS REG .BYTE $80 ;AND MASK .BYTE 0 ;XOR MASK .WORD INITCON+SCDR ;ADDRESS OF OUTPUT REGISTER .BYTE 'COPYRIGHT 1986 NMI' KEND: .EQU $ ;VARIABLE LOCATIONS .ORG $FFC0 .WORD 0 ;RESERVED $FFC0 .WORD 0 ;RESERVED $FFC2 .WORD 0 ;RESERVED $FFC4 .WORD 0 ;RESERVED $FFC6 .WORD 0 ;RESERVED $FFC8 .WORD 0 ;RESERVED $FFCA .WORD 0 ;RESERVED $FFCC .WORD 0 ;RESERVED $FFCE .WORD 0 ;RESERVED $FFD0 .WORD 0 ;RESERVED $FFD2 .WORD 0 ;RESERVED $FFD4 .WORD $B7BF ;RESERVED $FFD6 SCI .WORD $B7C2 ;RESERVED $FFD8 SPI .WORD $B7C5 ;RESERVED $FFDA PAIE .WORD $B7C8 ;RESERVED $FFDC PAOV .WORD $B7CB ;RESERVED $FFDE TO .WORD $B7CE ;RESERVED $FFE0 TOC5 .WORD $B7D1 ;RESERVED $FFE2 TOC4 .WORD $B7D4 ;RESERVED $FFE4 TOC3 .WORD $B7D7 ;RESERVED $FFE6 TOC2 .WORD $B7DA ;RESERVED $FFE8 TOC1 .WORD $B7DD ;RESERVED $FFEA TIC3 .WORD $B7E0 ;RESERVED $FFEC TIC2 .WORD $B7E3 ;RESERVED $FFEE TIC1 .WORD $B7E6 ;RESERVED $FFF0 RTI .WORD $B7E9 ;RESERVED $FFF2 IRQ .WORD $B7EC ;RESERVED $FFF4 XIRQ .WORD $B7EF ;RESERVED $FFF6 SWI .WORD $B7F2 ;RESERVED $FFF8 ILL OPCODE .WORD $B7F5 ;RESERVED $FFFA COP FAIL .WORD $B7F8 ;RESERVED $FFFC CLK MON ; $B7FB IS BOOT00 VECTOR ; $B7FE IS BOOT00 PATTERN .WORD RESET ERROR MESSAGES Standard Error Message ? (question mark) is the standard error message in Max-FORTH. An error exists when Max-FORTH responds with a ? prefixed with one of the following: - the most recently entered word which is not part of the Max-FORTH dictionary or - the most recently entered number which is not valid under the current BASE. Example: Enter WRONG . WRONG is not a part of the Max-FORTH dictionary, therefore, Max-FORTH will respond with WRONG ? . Enter HEX . Max-FORTH will respond with OK . TYPE 10H . Max-FORTH will respond with 10H ? since 10His not a valid hexadecimal number. STANDARD ERROR MESSAGE ROUTINE Max-FORTH has a standard routine for handling errors depending on the value of the user variable WARNING which is not named in the dictionary: WARNING value Max-FORTH action less than 0 executes the word ABORT (as vectored through user variable UABORT) 0 (default) prints an error message number n greater than 0 assumes that a disk (RAMdsk) is in use, takes screen 1 and indexes into it for line to show with error. ERROR MESSAGE DEFINITIONS When Max-FORTH detects an error condition, it may respond with an error message which corresponds to an error message number shown in the Table below. Max-FORTH clears the stacks and executes QUIT as its last actions when an error is processed, except for the following messages: NOT UNIQUE Has no effect on stacks, Max-FORTH execution continues normally. HAS INCORRECT ADDRESS MODE Shows the name of the code word being defined, the name of assembler op-code word be interpreted, and the message number. Max-FORTH ERROR MESSAGES Number Message Definition Recovery Action 0 ? Echoed word was the most recently interpreted. The word is not in the dictionary or is not a valid number. Check the word's name for spelling error or define the named word. Check if the number is valid under current BASE or change BASE. 1 STACK EMPTY Parameter stack is empty. Use proper stack management. Correct use of numbers on the stack. Match available to number needed by current operation. 2 DICTIONARY FULL Dictionary space is used up. FIRST HERE is less than $A0 Increase dictionary space by moving FIRST, or by FORGETing disposable word entries. 3 HAS INCORRECT ADDRESS MODE Address mode for assembler op-code is incorrect. Correct the address mode. 4 NOT UNIQUE The of the word just defined already exist in the dictionary. Latest definition of will be used. See further explanation following table. 5-6 --- Not assigned 7 FULL STACK The parameter stack is full. Use proper stack management. DROP or output some stack item. 8-16 --- Not assigned. 17 COMPILATION ONLY The word just interpreted must be used inside of a definition. Do not use the word outside a colon definition. Probably structure words such as DO, IF, BEGIN, etc. 18 EXECUTION ONLY The word just interpreted must be used outside of a definition. Do not use the word inside a colon definition. Probably words like .( etc. 19 CONDITIONALS NOT PAIRED Omitted words or incorrect nesting of conditionals Correct or add the conditional pair. Probably IF used without corresponing THEN. 20 DEFINITION NOT FINISHED Definition is not finished or delimiter is missing. Finish the definiton or add delimiter. Probably, DO used without corresponding LOOP. 21 IN PROTECTED DICTIONARY The word in question is below the FENCE . Quit trying to FORGET a protected word or move FENCE . 22 USE ONLY WHEN LOADING Incorrect use of the word --> . Do not use --> when not loading. 23 NO NAME Name expected in input, not found. Use appropriate string. Probably a defining word expected a string to convert into a name. A further explanation may be useful in understanding the special "NOT UNIQUE" waring. This is a warning and not an error, per sa. If the two definitions are an exact match, the latest definition will be used and the former definition will remain in the dictionary, but can not be found, since all searches of the dictionary stop at the latest occurrence found. This message may also occur when full sized name matches reduced-number-of-characters name in ROM. To save space in the ROM some words had a reduced number of characters stored in their name field. For instance, in the WORDS list, the word LOOP can be seen as "EE82 LOO_". This shows LOOP has only three significant characters in its name in the internal ROM, but is listed as having 4 total characters (as can be verified by the _ indicating an truncated character). Consider what happens when a new word is defined with the name LOOK. The new words name matches LOO_. So the warning is issued. No problem occurs in this case, however. Both names can can still be found. When LOOK is referenced the new definition is found in the dictionary search. When LOOP is used, the new definition LOOK is not considered a match because of the explicitly expressed characters. The P and K characters don't match. The earlier definition LOO_ does match. The three significant characters LOO match and the total length 4 matches as well. So both definitions can still be referenced, even though a warning message was issued. SELECTED REFERENCES LIMITED USE SOFTWARE LICENSE AGREEMENT 1. WHAT THIS IS. This is the New Micros Inc ("New Micros") Limited Use Software License Agreement (the "Agreement"), which will govern your use of the New Micros product contained with it. YOU AGREE TO THE TERMS OF THIS AGREEMENT BY THE ACT OF OPENING THE SEALED PACKAGE THAT CONTAINS THE MEDIA ON WHICH THE SOFTWARE IS RECORDED. DO NOT OPEN THE PACKAGE WITHOUT FIRST READING, UNDERSTANDING AND AGREEING TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU MAY RETURN THE SOFTWARE FOR A FULL REFUND BEFORE OPENING THE SEALED PACKAGE. 2. GRANT OF LICENSE. New Micros hereby grants you, and you accept, a limited license to use the enclosed ROM(s), Reference Manual(s), and any related materials (collectively called the "Software" in this Agreement). You may use the Software only on a single computer, on its temporary replacement, or on a subsequent computer. If you wish to use the Software on more than one computer system, you must either license an additional copy of the Software or request for a multi-use license from New Micros. You may not transfer or sublicense, either temporarily or permanently, your rights to use the Software under this Agreement without the prior written consent of New Micros. 3. TERM. This Agreement is effective from the day you open the sealed package containing the media on which the Software is recorded and continues until you return the original media to New Micros. You must also certify in writing that you have destroyed any archival copies you may have recorded on any memory system or magnetic medium. 4. NEW MICROS' RIGHTS. You acknowledge that the Software is the sole and exclusive property of New Micros. By accepting this Agreement, you do not become the owner of the Software, but you do have the right to use the software in accordance with this agreement. You agree to use your best efforts and all reasonable steps to protect the software from unauthorized use, illegal reproduction, or illicit distribution. 5. YOUR ORIGINAL MEDIA/ROM PART. The ROM enclosed each contain an original New Micros label. Either the ROM or the Reference Manual can NOT be copied into any medium. In case of media failure of an original part, New Micros will replace the ROM upon receipt of failed parts. New Micros will not replace failed parts that have been used improperly or abused, such as improper handling, excessive voltage application, etc. 6. CUSTOMER REGISTRATION. New Micros may from time to time revise or update the Software. Revisions can only be provided to you if you have returned the registration form to New Micros and if your Software are the originals. New Micros customer service are available only to registered New Micros users. 7. LIMITED WARRANTY. New Micros warrants for a period of ninety (90) days from the effective date of this Agreement that, under normal use, the material(s) of the media is/are not defective and that the program is properly recorded into the ROM. If during the ninety-day period, a defect in the Software should appear, you may return the Software free of charge. Your sole right with respect to a defect in the Software is replacement of the Software. EXCEPT FOR THE LIMITED WARRANTY DESCRIBED IN THIS PARAGRAPH, THERE ARE NO WARRANTIES EXPRESSED OR IMPLIED, BY THIS AGREEMENT. THESE INCLUDE, BUT ARE NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. 8. LIABILITY. You agree that regardless of the form of any claim you may have, New Micros' liability for any damages to you or to any other party shall not exceed the license fee paid for the Software. NEW MICROS WILL NOT BE RESPONSIBLE FOR ANY DIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, SUCH AS, BUT NOT LIMITED TO, LOSS OF PROFITS RESULTING FROM THE USE OF THE SOFTWARE OR ARISING OUT OF ANY BREACH OF THE WARRANTY, EVEN IF NEW MICROS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOME STATES DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION OR EXCLUSION MAY NOT APPLY TO YOU. YOU MAY ALSO HAVE OTHER RIGHTS THAT VARY FROM STATE TO STATE. 9. TERMINATION OF AGREEMENT. If any of the terms and conditions of this Agreement are broken, New Micros has the right to terminate the Agreeement and demand that you return the Software to New Micros. At that time, you must also certify that you have not retained any copies of the Software. 10. GOVERNING LAW. This agreement is to be governed by, and interpreted in accordance with, the laws of the State of Texas and the United States. Any terms or conditions of this Agreement found to be unenforceable, illegal, or contrary to public policy in any jurisdiction will be deleted, but will not affect the remaining terms and conditions of the Agreement. 11. ENTIRE AGREEMENT. This Agreement constitutes the entire agreement between you and New Micros. I, the undersigned have read and agree to the terms of this agreement. -------------------------------- -------------------- Customer's Signature Date Note: To order any Max-FORTH Version 2.0 or higher in external ROM, you must return this License Agreement signed and dated to: New Micros, Inc. * 1601 Chalk Hill Rd. * Dallas, TX 75050 * Tel: 214-339-2204 REGISTRATION FORM INPUT FORM