home *** CD-ROM | disk | FTP | other *** search
- \ Balraj Sidhu Set: 14D4
- \ Comp 462 - Forth
- \ Date: April 12, 1990
- \ Problem 4.10
-
- \ Part a
- \ ------
-
- \ set cell at adr to value true or -1.
- : on ( adr -- )
- 255 swap ! ;
-
- \ set cell at adr to value false or 0.
- : off ( adr -- )
- 0 swap ! ;
-
- \ Part b
- \ ------
-
- \ add n to the value found at address adr
- : +! ( n adr -- )
- dup @ 2 roll + swap ! ;
-
- \ display contents of cell at adr
- : ? ( adr -- )
- @ . ;
-
- \ Part c
- \ ------
-
- variable temperature
-
- : warmer ( -- )
- 5 temperature +! ;
-
- : cooler ( -- )
- -5 temperature +! ;
-
-
-
-
-
-
-
-