-
Notifications
You must be signed in to change notification settings - Fork 3
/
hf-pico.h4
29 lines (28 loc) · 879 Bytes
/
hf-pico.h4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| Requires:
| ====================================================================
| HelFORTH - bootstrap code
| File: pico.h4
| Version: 1.0 pre 11
| Author: Helmar Wodtke
| Year: 2004, 2005
| --------------------------------------------------------------------
macro
: x: ' compile ;;
: ['] ' ?literal ;;
: [?] ? ?literal ;;
: e: x: [?] ['] exec ?execute ;;
: ; e: ;; x: [ ;;
[ forth
: (word) vector ;
: (wordname) 5+ dup 1- c@ 63 and ;
: (/word) vector
: space 32 emit ;
: (.word) vector (word) (wordname) type (/word) ;
: last state cell+ ;
: words vector last [ here ] @ 0; dup (.word) [ compile ;
: !r [ $d029ad92 , $8904e883 , $ad02 2, ;
: ,r here 4 allot !r ;
: branch! dup $E9 swap c! 1+ !r ;
: used here state 32 + @ - ;
: variable create 0 , ;
variable short