易符標準詞彙eForthStandardWords
易符 eForth 2.02 標準詞彙 Standard vocabulary (分三級: 1入門 2進階 3系統) 依號頁次1/4
; system I/O 系統輸入輸出詞
001 入門01 BYE ( -- ) Exit eForth 再見
002 入門02 ?KEY ( -- c T | F ) a char with true, otherwise false ?鍵入
003 入門03 EMIT ( c -- ) Send character out 印出
004 系統01 open ( acc -- hnd ) 3D00 read-only, 3D01 write-only 開檔
005 系統02 create ( acc -- hnd ) 0 read-write, 1 read-only 建檔
006 系統03 close ( hnd -- ) 關檔
007 系統04 read ( buf n hnd -- n-read ) Read into buffer 讀檔
008 系統05 write ( buf n hnd -- n-written ) Write from buffer 寫檔
; The kernel 基本核心詞
009 系統06 C doLit ( -- w ) Push inline literal 內取值
010 系統07 C doList ( a -- ) Process colon list 內執行
011 系統08 C next ( -- ) Run time index loop 內逐次返迴
012 系統09 C ?branch ( f -- ) Branch if zero 內?分岔
013 系統10 C branch ( -- ) Branch to inline address 內分岔
014 入門04 EXECUTE ( ca -- ) Execute the word at ca 執行
015 入門05 EXIT ( -- ) Terminate colon definition 結束
016 入門06 ! ( w a -- ) Pop data to memory 存
017 入門07 @ ( a -- w ) Push data from memory 取
018 入門08 C! ( c b -- ) Pop byte to memory 存字
019 入門09 C@ ( b -- c ) Push byte from memory 取字
020 系統11 rp@ ( -- a ) Push current RP as data 取迴堆標
021 系統12 rp! ( a -- ) Set return stack pointer 存迴堆標
022 進階01 R> ( -- w ) Pop from return stack 迴堆>
023 進階02 R@ ( -- w ) Copy top of return stack 取迴堆
024 進階03 >R ( w -- ) Push to return stack >迴堆
025 系統13 sp@ ( -- a ) Push current SP as data 取數堆標
026 系統14 sp! ( a -- ) Set data stack pointer 存數堆標
027 入門10 DROP ( w -- ) Discard top of stack 丟棄
028 入門11 DUP ( w -- w w ) Duplicate top of stack 複製
029 入門12 SWAP ( w1 w2 -- w2 w1 ) Exchange top two of stack 互換
030 入門13 OVER ( w1 w2 -- w1 w2 w1 ) Duplicate second of stack 跳取
103 進階04 0< ( n -- t ) Return true if n is negative 0<
032 入門14 AND ( w w -- w ) Return bitwise AND 且
033 入門15 OR ( w w -- w ) Return bitwise inclusive OR 或
034 進階05 XOR ( w w -- w ) Return bitwise exclusive OR 不等
035 進階06 UM+ ( u u -- udsum ) Add two unsigned return a double 無號混+
; System/user var 系統詞/特區變數
036 系統15 C doVar ( -- a ) Run time for VARIABLE and CREATE 內變數
037 系統16 up ( -- a ) Pointer to user area 特區標
038 系統17 C doUser ( -- a ) Run time for user variable 內特區變數
039 入門16 BASE ( -- a ) Storage of radix base for numeric I/O 數位基底
040 系統18 C tmp ( -- a ) Temporary storage used in parse and find 暫存位址
041 進階07 >IN ( -- a ) Hold input pointer while parsing 輸入處理標
042 進階08 #TIB ( -- a ) Hold size of terminal input buffer 輸入長度標
043 系統19 'eval ( -- a ) Execution vector of EVAL 解譯向量
044 系統20 hld ( -- a ) Hold pointer building numeric output 轉碼輸出標
045 進階09 CONTEXT ( -- a ) Hold nfa from where searching begins 搜尋起始標
046 系統21 cp ( -- a ) Point to limit of dictionary 詞典界標
047 系統22 last ( -- a ) Point to last name in dictionary 新詞標
; Common functions 基本常用詞
048 入門17 ?DUP ( w -- w w | 0 ) Duplicate top of stack if not zero ?複製
049 入門18 ROT ( w1 w2 w3 -- w2 w3 w1 ) Rotate 3rd to top 輪轉
050 進階10 2DROP ( w w -- ) Discard two items on stack 雙丟棄
符易 eForth 2.02 標準詞彙 Standard vocabulary (分三級: 1入門 2進階 3系統) 依號頁次2/4
051 進階11 2DUP ( w1 w2 -- w1 w2 w1 w2 ) Duplicate top two items 雙複製
052 入門19 + ( w w -- sum ) Add top two items +
053 入門20 NOT ( w -- w ) One's complement of top of stack 反
054 入門21 NEGATE ( n -- -n ) Two's complement of top of stack 負
055 進階12 DNEGATE ( d -- -d ) Two's complement of top double 雙負
056 入門22 - ( n1 n2 -- n1-n2 ) Subtraction -
057 入門23 ABS ( n -- n ) Return absolute value 絕對
058 入門24 = ( w w -- t ) Return true if top two equal =
059 進階13 U< ( u u -- t ) compare of top two Unsigned numbers 無號<
060 入門25 < ( n1 n2 -- t ) compare of top two numbers <
061 進階14 MAX ( n n -- n ) Return the greater of top two 選大值
062 進階15 MIN ( n n -- n ) Return the smaller of top two 選小值
063 進階16 WITHIN ( u ul uh -- t ) Return true if ul <= u < uh 區間內
; Divide 除法相關詞
064 進階17 UM/MOD ( udl udh un -- ur uq ) Div unsignd double by sing 無號混/餘
065 進階18 M/MOD ( d n -- r q ) Divide double by single 混/餘
066 進階19 /MOD ( n n -- r q ) Signed divide. Return mod and quotient /餘
067 入門26 MOD ( n n -- r ) Signed divide. Return mod 餘
068 入門27 / ( n n -- q ) Signed divide. Return quotient /
; Multiply 乘法相關詞
069 進階20 UM* ( u u -- ud ) Unsigned multiply. Return double 無號混*
070 入門28 * ( n n -- n ) Signed multiply. Return single *
071 進階21 M* ( n n -- d ) Signed multiply. Return double 混*
072 進階22 */MOD ( n1 n2 n3 -- r q ) n1 multiply n2, then divide by n3 */餘
073 進階23 */ ( n1 n2 n3 -- q ) n1 multiply n2, then divide by n3 */
; Miscellaneous 其他相關詞
074 進階24 CELL+ ( a -- a ) Add cell size to address 數寬+
075 進階25 CELL- ( a -- a ) Subtract cell size from address 數寬-
076 進階26 CELLS ( n -- n ) Multiply cell size 數寬*
077 進階27 1+ ( n -- n ) Increment by one 1+
078 進階28 1- ( n -- n ) decrement by one 1-
079 進階29 2/ ( n -- n ) Divide by two 2/
080 進階30 BL ( -- 32 ) Return 32, ASCII code of blank 空格碼
081 系統23 >CHAR ( c -- c ) Filter non-printing character >符號
082 入門29 DEPTH ( -- n ) Return depth of data stack 數堆深
083 入門30 PICK ( ... +n -- ... w ) Duplicate nth item on stack 挑取
; Memory access 記憶區存取詞
084 進階31 +! ( n a -- ) Add n to the contents in address a +存
085 進階32 2! ( d a -- ) Store double integer to address a 雙存
086 進階33 2@ ( a -- d ) Fetch double integer from address a 雙取
087 入門31 COUNT ( a -- a+1 +n ) Count string and add 1 address 算字串
088 進階34 HERE ( -- a ) Limit of dictionary 詞典界
089 進階35 PAD ( -- a ) Address of text buffer 工作區
090 進階36 TIB ( -- a ) terminal input buffer 輸入特區
091 進階37 @EXECUTE ( a -- ) Execute vector stored in address a 取向量執行
092 入門32 CMOVE ( b1 b2 u -- ) Copy u bytes from b1 to b2 記憶區搬移
093 入門33 FILL ( b u c -- ) Fill u bytes of character c to area b 填入
094 入門34 ERASE ( b u -- ) Erase u bytes beginning at b 清除
095 進階38 PACK$ ( b u a -- a ) Build counted string at a 包裝$
; Numeric output 數值輸出詞
096 進階39 DIGIT ( u -- c ) Convert digit u to a character 數碼符
097 進階40 EXTRACT ( n base -- n c ) Extract least significant digi 轉出數碼符
098 進階41 <# ( -- ) Initiate numeric output process <#
099 進階42 HOLD ( c -- ) Insert character into numeric output 加字符
易符 eForth 2.02 標準詞彙 Standard vocabulary (分三級: 1入門 2進階 3系統) 依號頁次3/4
100 進階43 # ( u -- u ) Append extracted digit into numeric output #
101 進階44 #S ( u -- 0 )Append extracted digits into numeric output #數
102 進階45 SIGN ( n -- ) Add minus sign to the numeric output 加負號
103 進階46 #> ( w -- b u ) Prepare numeric output to be TYPE'ed #>
104 進階47 str ( w -- b u ) Convert signed integer to numeric string 數>字串
105 入門35 HEX ( -- ) Use radix 16 as base for numeric conversions 十六進
106 入門36 DECIMAL ( -- ) Use radix 10 as base for numeric conversions 十進制
; Numeric input 數值輸入詞
107 進階48 DIGIT? ( c base -- u t ) Convert character to digit value 數碼符?
108 進階49 NUMBER? ( a -- n T | a F ) Convert numeric string to number 數值字串?
; Basic I/O 輸入輸出詞
109 入門37 KEY ( -- c ) Wait an input character 鍵入
110 進階50 NUF? ( -- t ) false if no input, true if enter CR 等一下?
111 入門38 SPACE ( -- ) Output blank character 空一格
112 入門39 SPACES ( +n -- ) Output blank characters 空格
113 入門40 TYPE ( a u -- ) Output u characters at a 字串印出
114 入門41 CR ( -- ) Output carriage return and line feed 新列
115 系統24 C do$ ( -- a ) Return address of compiled string 內碼$
116 系統25 C $"| ( -- a ) Run time routine compiled by $" 內碼$"
117 系統26 C ."| ( -- ) Run time routine compiled by ." 內碼."
118 入門42 .R ( n +n -- ) Display integer, right justified .右齊
119 進階51 U.R ( u +n -- ) Display unsigned int, right justified 無號.右齊
120 進階52 U. ( u -- ) Display unsigned integer 無號.
121 入門43 . ( w -- ) Display integer and space .
122 進階53 ? ( a -- ) Display the integer in a ?
; Parsing 語法分析詞
123 進階54 parse ( b u c <str> -- b u offset ) parse string by c 分字串
124 進階55 PARSE ( c <str> -- b u ) parse string by c from input 分鍵入字串
125 入門44 .( ( -- ) Output string till next ) .(
126 入門45 I ( ( -- ) Ignore string till next ) (
127 入門46 I \ ( -- ) Ignore string till end of line \
128 進階56 WORD ( c <str> -- a ) Parse word by c 鍵入字串
129 進階57 TOKEN ( <str> -- a ) Parse word 鍵入詞名
; Dictionary search 詞典搜尋詞
130 進階58 NAME> ( na -- ca ) Return code address by name address 詞名>
131 系統27 SAME? ( a a u -- a a f \ -0+ ) Compare blocks, 0 if same 比字串
132 系統28 find ( a v -- ca na | a F ) Search name at a since v 找詞名
133 進階59 NAME? ( a -- ca na | a F ) Search given name at a詞名?
; Terminal response 系統反應詞
134 系統29 ^h ( bot eot cur -- bot eot cur ) Backspace the cursor 退格
135 系統30 TAP ( bot eot cur c -- bot eot cur ) Accept key and echo 鍵入回應
136 系統31 kTAP ( bot eot cur c -- bot eot cur ) TAP and process 鍵入處理
137 入門47 ACCEPT ( b u -- b u ) Input to buffer, Return count 記憶區輸入
138 進階60 QUERY ( -- ) Accept to terminal input buffer 輸入
139 入門48 ABORT ( -- ) Reset data stack then QUIT 錯誤
140 系統32 C abort" ( f -- ) Run time routine of ABORT" 內碼錯誤”
; text interpreter 直譯詞
141 系統33 $INTERPRET ( a -- ) Interpret word. If failed, treat as integer $直譯
142 入門49 IC [ ( -- ) Start text interpreter [
143 進階61 .OK ( -- ) Display 'ok' while interpreting .OK
144 進階62 ?STACK ( -- ) Abort if data stack underflows ?數堆
145 進階63 EVAL ( -- ) Interpret input stream 解譯
146 入門50 PRESET ( -- ) Reset stack pointer and terminal input buffer 初始設定
147 進階64 QUIT ( -- ) PRESET and start text interpreter 初始直譯
易符 eForth 2.02 標準詞彙 Standard vocabulary (分三級: 1入門 2進階 3系統) 依號頁次4/4
; The compiler 編譯詞
148 入門51 ' ( <word> -- ca ) Search ca of a word '
149 入門52 ALLOT ( n -- ) Allocate n bytes 預留
150 入門53 , ( w -- ) Compile integer into dictionary ,
151 進階65 IC [COMPILE] ( < word > -- | ca ) Compile immediate word [編譯]
152 進階66 COMPILE ( -- ) Compile ca of inline word 編譯
153 進階67 IC LITERAL ( w -- ) Compile integer literal 數值編入
154 進階68 $," ( -- ) Compile a literal string up to the char " $,”
; Structures 結構詞
155 入門54 IC FOR ( -- a ) Start FOR-NEXT loop structure 逐次起始
156 入門55 IC BEGIN ( -- a ) Start general loop structure 起始
157 入門56 IC NEXT ( a -- ) Terminate FOR-NEXT loop structure 逐次返迴
158 入門57 IC UNTIL ( a -- ) Terminate BEGIN-UNTIL structure 否則返迴
159 入門58 IC AGAIN ( a -- ) Terminate BEGIN-AGAIN structure 永遠返迴
160 入門59 IC IF ( -- A ) Begin conditional branch structure 若
161 系統34 C AHEAD ( -- A ) Compile a forward branch instruction 前往
162 入門60 IC REPEAT ( A a -- ) Terminate BEGIN-WHILE-REPEAT structure 返迴
163 入門61 IC THEN ( A -- ) Terminate conditional branch structure 然後
164 入門62 IC AFT ( a -- a A ) Jump to THEN in FOR-AFT-THEN-NEXT loop 首次前往
165 入門63 IC ELSE ( A -- A ) Start the false clause in IF-ELSE-THEN 否則
166 入門64 IC WHILE ( a -- A a ) Query exit from BEGIN-WHILE-REPEAT 若發生
167 入門65 IC ABORT" ( <str> -- ) Conditional abort with message 錯誤”
168 入門66 IC $" ( <str> -- ) Compile an inline string $”
169 入門67 IC ." ( <str> -- ) Compile inline string to be typed .”
; Name compiler 詞名編譯詞
170 進階69 ?UNIQUE ( a -- a ) Display warning if already exists ?唯獨
171 系統35 $,n ( na -- ) Build new name at na into dictionary 建詞名
; FORTH compiler 符式解譯詞
172 系統36 $COMPILE ( a -- ) Compile word to dictionary as token or lit $編譯
173 系統37 OVERT ( -- ) Link new word into vocabulary 加入詞典
174 入門68 IC ; ( -- ) Terminate colon definition ;
175 入門69 ] ( -- ) Start compiling words in input stream ]
176 系統38 C call, ( ca -- ) Assemble instruction to call ca 呼叫,
; Defining words 定義詞
177 入門70 : ( <str> -- ) Start colon definition of given name :
178 進階70 IMMEDIATE ( -- ) Make last compiled as immediate word 即時
179 入門71 CREATE ( <str> -- ) Compile array entry without space 記憶區
180 入門72 VARIABLE ( <str> -- ) Compile variable initialized to 0 變數
; Tools 工具詞
181 進階71 _TYPE ( b u -- ) Display string, Filter non-printing 記憶區濾印
182 系統39 dm+ ( a u -- a+u ) Dump u bytes from a 傾印+
183 入門73 DUMP ( a u -- ) Dump u bytes from a 傾印
184 入門74 .S ( ... -- ... ) Display contents of data stack 印數堆
185 進階72 >NAME ( ca -- na | F ) Convert code address to name address >詞名
186 進階73 .ID ( na -- ) Display name at address na 印詞名
187 入門75 SEE ( <word> -- ) Simple decompiler 查定義
188 入門76 WORDS ( -- ) Display names in context vocabulary 查詞彙
189 進階74 READ ( buf n <file> -- n-read ) Read file into buffer 讀進記憶區
190 進階75 LOAD ( buf n -- ) Load file read into buffer 記憶區載入
191 入門77 DOWNLOAD ( <file> -- ) Load file read into the buffer 下載
192 系統40 checksum ( adr n -- sum ) Sum up words, must even len 記憶區累加
193 進階76 UPLOAD ( <file> -- ) Save sytem image as EXE file 上傳
194 系統41 hi ( -- ) Display the sign-on message of eForth 易符標記
195 進階77 'BOOT ( -- a ) The application startup vector 起動向量
196 進階78 COLD ( -- ) The high level cold start 冷機起動