4 COLD WARM WIPE RST_HERE PWR_HERE RST_STATE PWR_STATE
5 MOVE LEAVE +LOOP LOOP DO REPEAT WHILE
6 AGAIN UNTIL BEGIN THEN ELSE IF >BODY
7 DEFER DOES> CREATE CONSTANT VARIABLE : ;
8 POSTPONE RECURSE IMMEDIATE IS ['] ] [
9 \ ' ABORT" ABORT QUIT EVALUATE COUNT
10 LITERAL , EXECUTE >NUMBER FIND WORD ."
11 S" CR TYPE SPACES SPACE NOECHO ECHO
12 EMIT ACCEPT KEY C, ALLOT HERE .
13 D. U. SIGN HOLD #> #S #
14 UM/MOD <# STATE BASE BL J I
18 >R ROT OVER SWAP NIP DROP ?DUP
23 WARM DEFERed word, by default executes ABORT" <WARM_message>"
25 WIPE resets the program memory to its original state (Deep_RST adds same effect to COLD).
27 RST_HERE defines the bound of the program memory protected against COLD or hardware reset.
29 PWR_HERE defines the bound of the program memory protected against ON/OFF and also against any error occurring.
31 RST_STATE removes all words defined after RST_HERE (COLD or <reset> have same effet)
33 PWR_STATE removes all words defined after PWR_HERE (an occurring error has same effect)
35 MOVE https://forth-standard.org/standard/core/MOVE
36 LEAVE https://forth-standard.org/standard/core/LEAVE
37 +LOOP https://forth-standard.org/standard/core/PlusLOOP
38 LOOP https://forth-standard.org/standard/core/LOOP
39 DO https://forth-standard.org/standard/core/DO
40 REPEAT https://forth-standard.org/standard/core/REPEAT
41 WHILE https://forth-standard.org/standard/core/WHILE
42 AGAIN https://forth-standard.org/standard/core/AGAIN
43 UNTIL https://forth-standard.org/standard/core/UNTIL
44 BEGIN https://forth-standard.org/standard/core/BEGIN
45 THEN https://forth-standard.org/standard/core/THEN
46 ELSE https://forth-standard.org/standard/core/ELSE
47 IF https://forth-standard.org/standard/core/IF
48 ; https://forth-standard.org/standard/core/Semi
49 : https://forth-standard.org/standard/core/Colon
50 DEFER https://forth-standard.org/standard/core/DEFER
51 DOES> https://forth-standard.org/standard/core/DOES
52 CREATE https://forth-standard.org/standard/core/CREATE
53 CONSTANT https://forth-standard.org/standard/core/CONSTANT
54 VARIABLE https://forth-standard.org/standard/core/VARIABLE
55 POSTPONE https://forth-standard.org/standard/core/POSTPONE
56 RECURSE https://forth-standard.org/standard/core/RECURSE
57 IMMEDIATE https://forth-standard.org/standard/core/IMMEDIATE
58 IS https://forth-standard.org/standard/core/IS
59 ['] https://forth-standard.org/standard/core/BracketTick
60 ] https://forth-standard.org/standard/core/right-bracket
61 [ https://forth-standard.org/standard/core/Bracket
62 \ https://forth-standard.org/standard/block/bs
63 ' https://forth-standard.org/standard/core/Tick
64 ABORT" https://forth-standard.org/standard/core/ABORTq
65 ABORT https://forth-standard.org/standard/core/ABORT
66 QUIT https://forth-standard.org/standard/core/QUIT
67 EVALUATE https://forth-standard.org/standard/core/EVALUATE
68 COUNT https://forth-standard.org/standard/core/COUNT
69 LITERAL https://forth-standard.org/standard/core/LITERAL
70 , https://forth-standard.org/standard/core/Comma
71 EXECUTE https://forth-standard.org/standard/core/EXECUTE
72 >NUMBER https://forth-standard.org/standard/core/toNUMBER
73 FIND https://forth-standard.org/standard/core/FIND
74 WORD https://forth-standard.org/standard/core/WORD
75 ." https://forth-standard.org/standard/core/Dotq
76 S" https://forth-standard.org/standard/core/Sq
77 TYPE https://forth-standard.org/standard/core/TYPE
78 SPACES https://forth-standard.org/standard/core/SPACES
79 SPACE https://forth-standard.org/standard/core/SPACE
80 CR DEFERed word, https://forth-standard.org/standard/core/CR
81 NOECHO stop display on output
82 ECHO start display on output
83 EMIT DEFERed word, https://forth-standard.org/standard/core/EMIT
84 ACCEPT DEFERed word, https://forth-standard.org/standard/core/ACCEPT
85 KEY DEFERed word, https://forth-standard.org/standard/core/KEY
86 C, https://forth-standard.org/standard/core/CComma
87 ALLOT https://forth-standard.org/standard/core/ALLOT
88 HERE https://forth-standard.org/standard/core/HERE
89 . https://forth-standard.org/standard/core/d
90 D. https://forth-standard.org/standard/double/Dd
91 U. https://forth-standard.org/standard/core/Ud
92 SIGN https://forth-standard.org/standard/core/SIGN
93 HOLD https://forth-standard.org/standard/core/HOLD
94 #> https://forth-standard.org/standard/core/num-end
95 #S https://forth-standard.org/standard/core/numS
96 # https://forth-standard.org/standard/core/num
97 UM/MOD https://forth-standard.org/standard/core/UMDivMOD
98 <# https://forth-standard.org/standard/core/num-start
99 BL https://forth-standard.org/standard/core/BL
100 STATE https://forth-standard.org/standard/core/STATE
101 BASE https://forth-standard.org/standard/core/BASE
102 J https://forth-standard.org/standard/core/J
103 I https://forth-standard.org/standard/core/I
104 UNLOOP https://forth-standard.org/standard/core/UNLOOP
105 U< https://forth-standard.org/standard/core/Uless
106 > https://forth-standard.org/standard/core/more
107 < https://forth-standard.org/standard/core/less
108 = https://forth-standard.org/standard/core/Equal
109 0< https://forth-standard.org/standard/core/Zeroless
110 0= https://forth-standard.org/standard/core/ZeroEqual
111 DABS https://forth-standard.org/standard/double/DABS
112 ABS https://forth-standard.org/standard/core/ABS
113 NEGATE https://forth-standard.org/standard/core/NEGATE
114 1- https://forth-standard.org/standard/core/OneMinus
115 1+ https://forth-standard.org/standard/core/OnePlus
116 - https://forth-standard.org/standard/core/Minus
117 + https://forth-standard.org/standard/core/Plus
118 C! https://forth-standard.org/standard/core/CStore
119 C@ https://forth-standard.org/standard/core/CFetch
120 ! https://forth-standard.org/standard/core/Store
121 @ https://forth-standard.org/standard/core/Fetch
122 DEPTH https://forth-standard.org/standard/core/DEPTH
123 R@ https://forth-standard.org/standard/core/RFetch
124 R> https://forth-standard.org/standard/core/Rfrom
125 >R https://forth-standard.org/standard/core/toR
126 ROT https://forth-standard.org/standard/core/ROT
127 OVER https://forth-standard.org/standard/core/OVER
128 SWAP https://forth-standard.org/standard/core/SWAP
129 NIP https://forth-standard.org/standard/core/NIP
130 DROP https://forth-standard.org/standard/core/DROP
131 ?DUP https://forth-standard.org/standard/core/qDUP
132 DUP https://forth-standard.org/standard/core/DUP
133 LIT execution part of LITERAL
134 EXIT https://forth-standard.org/standard/core/EXIT
140 ?GOTO GOTO FW3 FW2 FW1 BW3 BW2
141 BW1 ?JMP JMP REPEAT WHILE AGAIN UNTIL
142 ELSE THEN IF 0= 0<> U>= U<
143 0< 0>= S< S>= RRUM RLAM RRAM
144 RRCM POPM PUSHM CALL PUSH.B PUSH SXT
145 RRA.B RRA SWPB RRC.B RRC AND.B AND
146 XOR.B XOR BIS.B BIS BIC.B BIC BIT.B
147 BIT DADD.B DADD CMP.B CMP SUB.B SUB
148 SUBC.B SUBC ADDC.B ADDC ADD.B ADD MOV.B
149 MOV RETI LO2HI COLON ENDASM ENDCODE SLEEP
151 ASM CODE HI2LO (added in forth vocabulary)
153 see: http://www.ece.utep.edu/courses/web3376/Notes_files/ee3376-isa.pdf
154 readme.md for symbolic alias of registers, symbolic jumps (IF ELSE THEN...),..
156 ?GOTO used after a conditionnal (0=,0<>,U>=,U<,0<,S<,S>=) to branch to a label FWx or BWx
157 GOTO used as unconditionnal branch to a label FWx or BWx
159 BW3 BACKWARD branch destination n°3
163 FW3 FORWARD branch destination n°3
167 ?JMP used after a conditionnal (0=,0<>,U>=,U<,0<,S<,S>=) to jump to a predefined word
168 JMP unconditionnal jump to a predefined word
170 REPEAT assembler version of the FORTH word REPEAT
182 0< conditionnal, to use only with ?JMP ?GOTO
183 0>= conditionnal, to use only with IF UNTIL WHILE
187 LO2HI switches compilation between low level and high level modes without saving IP register.
188 COLON pushes IP then performs LO2HI, used as: CODE <word> ... assembler instr ... COLON ... FORTH words ... ;
189 ENDASM to end an ASM definition.
190 ENDCODE to end a CODE definition.
191 SLEEP DEFERed word which enables to create a background task, default SLEEP definition: MOV #GIE+LPM0,SR
193 next assembler words are set in FORTH vocabulary:
195 CODE <word> creates a word written in assembler.
196 this defined <word> must be ended with ENDCODE unless COLON or LO2HI use.
198 ASM <word> creates a word written in assembler but not interpretable by FORTH (because ended by RET instr.).
199 this defined <word> must be ended with ENDASM.
200 This word will be recognized only in assembler mode.
202 HI2LO used to switch compilation from high level (FORTH) to low level (assembler).
207 ADD http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=135
208 ADDC http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=136
209 AND http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=137
210 BIC http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=138
211 BIS http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=139
212 BIT http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=140
213 CALL http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=142
214 CMP http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=147
215 DADD http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=149
216 MOV http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=165
217 PUSH http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=168
218 RETI http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=170
219 RRA http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=173
220 RRC http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=174
221 SUB http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=179
222 SUBC http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=180
223 SWPB http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=181
224 SXT http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=182
225 XOR http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=184
227 RRUM http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=218
228 RLAM http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=208
229 RRAM http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=211
230 RRCM http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=214
231 POPM http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=204
232 PUSHM http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=205
234 ADDX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=187
235 ADDCX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=188
236 ANDX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=189
237 BICX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=190
238 BISX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=191
239 BITX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=192
240 CMPX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=194
241 DADDX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=196
242 MOVX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=202
243 PUSHX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=207
244 RRAX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=212
245 RRCX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=216
246 RRUX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=219
247 SUBX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=221
248 SUBCX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=222
249 SWPBX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=223
250 SXTX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=225
251 XORX http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=227
253 ADDA http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=229
254 CALLA http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=232
255 CMPA http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=235
256 MOVA http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=238
257 SUBA http://www.ti.com/lit/ug/slau272d/slau272d.pdf#page=241
262 MARKER [DEFINED] [UNDEFINED] [IF] [ELSE] [THEN] COMPARE
264 [DEFINED] https://forth-standard.org/standard/tools/BracketDEFINED
265 [UNDEFINED] https://forth-standard.org/standard/tools/BracketUNDEFINED
266 [IF] https://forth-standard.org/standard/tools/BracketIF
267 [ELSE] https://forth-standard.org/standard/tools/BracketELSE
268 [THEN] https://forth-standard.org/standard/tools/BracketTHEN
269 COMPARE https://forth-standard.org/standard/string/COMPARE
270 MARKER https://forth-standard.org/standard/core/MARKER
275 DEFINITIONS ONLY PREVIOUS ALSO ASSEMBLER FORTH VOCABULARY
277 DEFINITIONS https://forth-standard.org/standard/search/DEFINITIONS
278 ONLY https://forth-standard.org/standard/search/ONLY
279 PREVIOUS https://forth-standard.org/standard/search/PREVIOUS
280 ALSO https://forth-standard.org/standard/search/ALSO
281 ASSEMBLER assembler VOCABULARY
282 FORTH FORTH VOCABULARY
283 VOCABULARY <word> creates a new VOCABULARY named word
287 ---------------------
290 :NONAME https://forth-standard.org/standard/core/ColonNONAME
291 CODENNM assembly counterpart of :NONAME
294 SD_CARD_LOADER ADD-ON
295 ---------------------
298 LOAD" LOAD" SD_TEST.4TH" loads source file SD_TEST.4TH from SD_Card and compile it.
299 CIB Currrent Input Buffer, TIB by default.
301 ACCEPT becomes a DEFERed word
304 SD_CARD_READ_WRITE ADD-ON
305 -------------------------
306 TERM2SD" SD_EMIT WRITE READ CLOSE DEL" WRITE"
309 TERM2SD" TERM2SD" SD_TEST.4TH" copy input file to SD_CARD (use CopySourceFileToTarget_SD_Card.bat to do)
310 SD_EMIT sends output stream at the end of last opened as write file.
311 WRITE write sequentially BUFFER content to a sector
312 READ read sequentially a sector to BUFFER
313 CLOSE close last opened file.
314 DEL" DEL" SD_TEST.4TH" remove this file from SD_CARD.
315 WRITE" WRITE" TRUC" open or create TRUC file ready to write to the end of this file
316 READ" READ" TRUC" open TRUC and load its first sector in BUFFER
324 QUIT becomes a DEFERed word
327 ; when ADD-ONs are compiled into the kernel, their respective MARKER word identified with braces {} does nothing.
328 ; when ADD-ONs are downloaded, their respective MARKER word identified with braces {} removes all ADD-ONs words.
331 ANS_COMPLEMENT ADD-ON
332 ---------------------
333 PAD SOURCE .( ( DECIMAL HEX
334 FILL [CHAR] CHAR +! MIN MAX 2/
335 2* RSHIFT LSHIFT XOR OR AND INVERT
336 2OVER 2SWAP 2DROP 2DUP 2! 2@ S>D
337 CELL+ CELLS CHAR+ CHARS ALIGN ALIGNED */
338 */MOD MOD / /MOD * FM/MOD SM/REM
341 PAD https://forth-standard.org/standard/core/PAD
342 >IN https://forth-standard.org/standard/core/toIN
343 >BODY https://forth-standard.org/standard/core/toBODY
344 SOURCE https://forth-standard.org/standard/core/SOURCE
345 .( https://forth-standard.org/standard/core/Dotp
346 ( https://forth-standard.org/standard/core/p
347 DECIMAL https://forth-standard.org/standard/core/DECIMAL
348 HEX https://forth-standard.org/standard/core/HEX
349 FILL https://forth-standard.org/standard/core/FILL
350 [CHAR] https://forth-standard.org/standard/core/BracketCHAR
351 CHAR https://forth-standard.org/standard/core/CHAR
352 +! https://forth-standard.org/standard/core/PlusStore
353 2/ https://forth-standard.org/standard/core/TwoDiv
354 2* https://forth-standard.org/standard/core/TwoTimes
355 MIN https://forth-standard.org/standard/core/MIN
356 MAX https://forth-standard.org/standard/core/MAX
357 RSHIFT https://forth-standard.org/standard/core/RSHIFT
358 LSHIFT https://forth-standard.org/standard/core/LSHIFT
359 INVERT https://forth-standard.org/standard/core/INVERT
360 XOR https://forth-standard.org/standard/core/XOR
361 OR https://forth-standard.org/standard/core/OR
362 AND https://forth-standard.org/standard/core/AND
363 2OVER https://forth-standard.org/standard/core/TwoOVER
364 2SWAP https://forth-standard.org/standard/core/TwoSWAP
365 2DROP https://forth-standard.org/standard/core/TwoDROP
366 2DUP https://forth-standard.org/standard/core/TwoDUP
367 2! https://forth-standard.org/standard/core/TwoStore
368 2@ https://forth-standard.org/standard/core/TwoFetch
369 S>D https://forth-standard.org/standard/core/StoD
370 CELL+ https://forth-standard.org/standard/core/CELLPlus
371 CELLS https://forth-standard.org/standard/core/CELLS
372 CHAR+ https://forth-standard.org/standard/core/CHARPlus
373 CHARS https://forth-standard.org/standard/core/CHARS
374 ALIGN https://forth-standard.org/standard/core/ALIGN
375 ALIGNED https://forth-standard.org/standard/core/ALIGNED
376 */ https://forth-standard.org/standard/core/TimesDiv
377 */MOD https://forth-standard.org/standard/core/TimesDivMOD
378 MOD https://forth-standard.org/standard/core/MOD
379 / https://forth-standard.org/standard/core/Div
380 /MOD https://forth-standard.org/standard/core/DivMOD
381 * https://forth-standard.org/standard/core/Times
382 FM/MOD https://forth-standard.org/standard/core/FMDivMOD
383 SM/REM https://forth-standard.org/standard/core/SMDivREM
384 M* https://forth-standard.org/standard/core/MTimes
385 UM* https://forth-standard.org/standard/core/UMTimes
392 2CONSTANT S>F F. F* F#S
393 F/ F- F+ HOLDS {FIXPOINT}
395 2CONSTANT https://forth-standard.org/standard/double/TwoCONSTANT
396 S>F u/n -- Qlo Qhi convert u/n in a s15.16 value
397 F. display a s15.16 value
398 F* s15.16 multiplication
399 F#S Qlo Qhi u -- Qhi 0
400 convert fractionnal part of a s15.16 value displaying u digits
402 F- s15.16 soustraction
404 HOLDS https://forth-standard.org/standard/core/HOLDS
405 {FIXPOINT} do nothing if compiled in core, else remove all FIXPOINT add-on.
410 DUMP U.R WORDS ? .RS .S {TOOLS}
412 DUMP https://forth-standard.org/standard/tools/DUMP
413 U.R u z -- display unsigned number u with size z
414 WORDS https://forth-standard.org/standard/tools/WORDS
415 ? https://forth-standard.org/standard/tools/q
416 .RS displays return stack content
417 .S https://forth-standard.org/standard/tools/DotS
418 {TOOLS} do nothing if compiled in core.
424 DIR FAT CLUSTER SECTOR {SD_TOOLS}
426 DIR dump first sector of current directory
427 FAT dump first sector of FAT1
428 CLUSTER .123 CLUSTER displays first sector of cluster 123
429 SECTOR .123456789 SECTOR displays sector 123456789
430 {SD_TOOLS} if you type {SD_TOOLS} all subsequent loaded words are removed