| Homework 1 |
Due
date: September 18, 2003 |
| 1) Write (on paper) in Forth style
( i.e. " INTERPRET ... ;") a Forth program that implements Figure 6 in the
paper. There will be 3 functions defined: "INTERPRET" ":" and ";" 2) Separately define whatever functions you used in the above three definitions. These functions need only be defined in terms of a description of before and after on the stack (e.g. +: # # => #) and in English as to what they do. KEEP IT SIMPLE. 3) By hand, show that your function INTERPRET works for some simple functions such as : FOO DUP DUP * ; 4)Include to a similar level of detail (in ": ... ;" form again) one interesting set of compiler functions (eg. IF THEN ENDIF, FOR LOOP, DO UNTIL, ...) You DO NOT NEED TO PROGRAM ANY OF THESE. If you want to, consider that for one of your projects. Grading: "A" - it looks like it will work, "B" - looks like it needs a little work, "C" - something significant is missing, "D" - lots of dificiencies, "F" - "My dog ate it." |
|