OSDN Git Service

V3.7
[fast-forth/master.git] / MSP430-FORTH / FF_SPECS.f
1 \ -*- coding: utf-8 -*-
2 \
3 \ displays all FastForth specifications
4 \ 3 kb free mandatory.
5 \
6 \ TARGET ( = the name of \INC\target.pat file without the extension):
7 \ MSP_EXP430FR5739  MSP_EXP430FR5969    MSP_EXP430FR5994    MSP_EXP430FR6989
8 \ MSP_EXP430FR4133  CHIPSTICK_FR2433    MSP_EXP430FR2433    MSP_EXP430FR2355
9 \ LP_MSP430FR2476
10 \ MY_MSP430FR5738_2
11 \ COMPLEMENT: I2C
12 \
13 \ from scite editor : copy your TARGET selection in (shift+F8) parameter 1:
14 \                     copy COMPLEMENT if used in (shift+F8) parameter 2:
15 \
16 \ OR
17 \
18 \ from file explorer :  drag and drop this file onto SendSourceFileToTarget.bat
19 \                       then select your TARGET + COMPLEMENT when asked.
20 \
21 \ if you choice a bad target, you will obtain an error during downloading: "Device's ID mismatch!"
22 \
23 \ COLD            \ uncomment for this TEST which must not disrupt the downloading process
24
25 ; ---------------------------------
26 ; FF_SPECS.f
27 ; ---------------------------------
28
29 \ first, we test for downloading driver only if UART TERMINAL target
30 CODE ABORT_FF_SPECS
31 SUB #2,PSP
32 MOV TOS,0(PSP)
33 MOV &VERSION,TOS
34 SUB #307,TOS        \ FastForth V3.7
35 COLON
36 'CR' EMIT            \ return to column 1 without 'LF'
37 ABORT" FastForth version = 3.7 please!"
38 PWR_STATE           \ remove ABORT_FF_SPECS definition before resuming
39 ;
40
41 ABORT_FF_SPECS
42
43 [UNDEFINED] AND [IF]
44 \ https://forth-standard.org/standard/core/AND
45 \ C AND    x1 x2 -- x3           logical AND
46 CODE AND
47 AND @PSP+,TOS
48 MOV @IP+,PC
49 ENDCODE
50 [THEN]
51
52 [UNDEFINED] DUP [IF]    \ define DUP and DUP?
53 \ https://forth-standard.org/standard/core/DUP
54 \ DUP      x -- x x      duplicate top of stack
55 CODE DUP
56 BW1 SUB #2,PSP      \ 2  push old TOS..
57     MOV TOS,0(PSP)  \ 3  ..onto stack
58     MOV @IP+,PC     \ 4
59 ENDCODE
60
61 \ https://forth-standard.org/standard/core/qDUP
62 \ ?DUP     x -- 0 | x x    DUP if nonzero
63 CODE ?DUP
64 CMP #0,TOS      \ 2  test for TOS nonzero
65 0<> ?GOTO BW1   \ 2
66 MOV @IP+,PC     \ 4
67 ENDCODE
68 [THEN]
69
70 [UNDEFINED] OVER [IF]
71 \ https://forth-standard.org/standard/core/OVER
72 \ OVER    x1 x2 -- x1 x2 x1
73 CODE OVER
74 MOV TOS,-2(PSP)     \ 3 -- x1 (x2) x2
75 MOV @PSP,TOS        \ 2 -- x1 (x2) x1
76 SUB #2,PSP          \ 1 -- x1 x2 x1
77 MOV @IP+,PC
78 ENDCODE
79 [THEN]
80
81 [UNDEFINED] DROP [IF]
82 \ https://forth-standard.org/standard/core/DROP
83 \ DROP     x --          drop top of stack
84 CODE DROP
85 MOV @PSP+,TOS   \ 2
86 MOV @IP+,PC     \ 4
87 ENDCODE
88 [THEN]
89
90 [UNDEFINED] SWAP [IF]
91 \ https://forth-standard.org/standard/core/SWAP
92 \ SWAP     x1 x2 -- x2 x1    swap top two items
93 CODE SWAP
94 MOV @PSP,W      \ 2
95 MOV TOS,0(PSP)  \ 3
96 MOV W,TOS       \ 1
97 MOV @IP+,PC     \ 4
98 ENDCODE
99 [THEN]
100
101 [UNDEFINED] ROT [IF]
102 \ https://forth-standard.org/standard/core/ROT
103 \ ROT    x1 x2 x3 -- x2 x3 x1
104 CODE ROT
105 MOV @PSP,W          \ 2 fetch x2
106 MOV TOS,0(PSP)      \ 3 store x3
107 MOV 2(PSP),TOS      \ 3 fetch x1
108 MOV W,2(PSP)        \ 3 store x2
109 MOV @IP+,PC
110 ENDCODE
111 [THEN]
112
113 [UNDEFINED] >R [IF]
114 \ https://forth-standard.org/standard/core/toR
115 \ >R    x --   R: -- x   push to return stack
116 CODE >R
117 PUSH TOS
118 MOV @PSP+,TOS
119 MOV @IP+,PC
120 ENDCODE
121 [THEN]
122
123 [UNDEFINED] R> [IF]
124 \ https://forth-standard.org/standard/core/Rfrom
125 \ R>    -- x    R: x --   pop from return stack ; CALL #RFROM performs DOVAR
126 CODE R>
127 SUB #2,PSP      \ 1
128 MOV TOS,0(PSP)  \ 3
129 MOV @RSP+,TOS   \ 2
130 MOV @IP+,PC     \ 4
131 ENDCODE
132 [THEN]
133
134 [UNDEFINED] 0= [IF]
135 \ https://forth-standard.org/standard/core/ZeroEqual
136 \ 0=     n/u -- flag    return true if TOS=0
137 CODE 0=
138 SUB #1,TOS      \ borrow (clear cy) if TOS was 0
139 SUBC TOS,TOS    \ TOS=-1 if borrow was set
140 MOV @IP+,PC
141 ENDCODE
142 [THEN]
143
144 [UNDEFINED] 0< [IF]
145 \ https://forth-standard.org/standard/core/Zeroless
146 \ 0<     n -- flag      true if TOS negative
147 CODE 0<
148 ADD TOS,TOS     \ 1 set carry if TOS negative
149 SUBC TOS,TOS    \ 1 TOS=-1 if carry was clear
150 XOR #-1,TOS     \ 1 TOS=-1 if carry was set
151 MOV @IP+,PC     \ 
152 ENDCODE
153 [THEN]
154
155 [UNDEFINED] = [IF]
156 \ https://forth-standard.org/standard/core/Equal
157 \ =      x1 x2 -- flag         test x1=x2
158 CODE =
159 SUB @PSP+,TOS   \ 2
160 0<> IF          \ 2
161     AND #0,TOS  \ 1 flag Z = 1
162     MOV @IP+,PC \ 4
163 THEN
164 XOR #-1,TOS     \ 1
165 MOV @IP+,PC     \ 4
166 ENDCODE
167 [THEN]
168
169 \ https://forth-standard.org/standard/core/Uless
170 \ U<    u1 u2 -- flag       test u1<u2, unsigned
171 [UNDEFINED] U< [IF]
172 CODE U<
173 SUB @PSP+,TOS   \ 2 u2-u1
174 0<> IF
175     MOV #-1,TOS     \ 1
176     U< IF           \ 2 flag 
177         AND #0,TOS  \ 1 flag Z = 1
178     THEN
179 THEN
180 MOV @IP+,PC     \ 4
181 ENDCODE
182 [THEN]
183
184 [UNDEFINED] IF [IF]     \ define IF and THEN
185 \ https://forth-standard.org/standard/core/IF
186 \ IF       -- IFadr    initialize conditional forward branch
187 CODE IF
188 SUB #2,PSP              \
189 MOV TOS,0(PSP)          \
190 MOV &DP,TOS             \ -- HERE
191 ADD #4,&DP              \           compile one word, reserve one word
192 MOV #QFBRAN,0(TOS)      \ -- HERE   compile QFBRAN
193 ADD #2,TOS              \ -- HERE+2=IFadr
194 MOV @IP+,PC
195 ENDCODE IMMEDIATE
196
197 \ https://forth-standard.org/standard/core/THEN
198 \ THEN     IFadr --                resolve forward branch
199 CODE THEN
200 MOV &DP,0(TOS)          \ -- IFadr
201 MOV @PSP+,TOS           \ --
202 MOV @IP+,PC
203 ENDCODE IMMEDIATE
204 [THEN]
205
206 [UNDEFINED] ELSE [IF]
207 \ https://forth-standard.org/standard/core/ELSE
208 \ ELSE     IFadr -- ELSEadr        resolve forward IF branch, leave ELSEadr on stack
209 CODE ELSE
210 ADD #4,&DP              \ make room to compile two words
211 MOV &DP,W               \ W=HERE+4
212 MOV #BRAN,-4(W)
213 MOV W,0(TOS)            \ HERE+4 ==> [IFadr]
214 SUB #2,W                \ HERE+2
215 MOV W,TOS               \ -- ELSEadr
216 MOV @IP+,PC
217 ENDCODE IMMEDIATE
218 [THEN]
219
220 [UNDEFINED] BEGIN [IF]  \ define BEGIN UNTIL AGAIN WHILE REPEAT
221 \ https://forth-standard.org/standard/core/BEGIN
222 \ BEGIN    -- BEGINadr             initialize backward branch
223 CODE BEGIN
224     MOV #HEREXEC,PC
225 ENDCODE IMMEDIATE
226 [THEN]
227
228 [UNDEFINED] UNTIL [IF]  \ define BEGIN UNTIL AGAIN WHILE REPEAT
229 \ https://forth-standard.org/standard/core/UNTIL
230 \ UNTIL    BEGINadr --             resolve conditional backward branch
231 CODE UNTIL
232     MOV #QFBRAN,X
233 BW1 ADD #4,&DP          \ compile two words
234     MOV &DP,W           \ W = HERE
235     MOV X,-4(W)         \ compile Bran or QFBRAN at HERE
236     MOV TOS,-2(W)       \ compile bakcward adr at HERE+2
237     MOV @PSP+,TOS
238     MOV @IP+,PC
239 ENDCODE IMMEDIATE
240
241 \ https://forth-standard.org/standard/core/AGAIN
242 \ AGAIN    BEGINadr --             resolve uncondionnal backward branch
243 CODE AGAIN
244 MOV #BRAN,X
245 GOTO BW1
246 ENDCODE IMMEDIATE
247 [THEN]
248
249 [UNDEFINED] WHILE [IF]     \ define DO LOOP +LOOP
250 \ https://forth-standard.org/standard/core/WHILE
251 \ WHILE    BEGINadr -- WHILEadr BEGINadr
252 : WHILE
253 POSTPONE IF SWAP
254 ; IMMEDIATE
255 [THEN]
256
257 [UNDEFINED] REPEAT [IF]     \ define DO LOOP +LOOP
258 \ https://forth-standard.org/standard/core/REPEAT
259 \ REPEAT   WHILEadr BEGINadr --     resolve WHILE loop
260 : REPEAT
261 POSTPONE AGAIN POSTPONE THEN
262 ; IMMEDIATE
263 [THEN]
264
265 [UNDEFINED] DO [IF]     \ define DO LOOP +LOOP
266 \ https://forth-standard.org/standard/core/DO
267 \ DO       -- DOadr   L: -- 0
268 CODE DO
269 SUB #2,PSP              \
270 MOV TOS,0(PSP)          \
271 ADD #2,&DP              \   make room to compile xdo
272 MOV &DP,TOS             \ -- HERE+2
273 MOV #XDO,-2(TOS)        \   compile xdo
274 ADD #2,&LEAVEPTR        \ -- HERE+2     LEAVEPTR+2
275 MOV &LEAVEPTR,W         \
276 MOV #0,0(W)             \ -- HERE+2     L-- 0
277 MOV @IP+,PC
278 ENDCODE IMMEDIATE
279
280 \ https://forth-standard.org/standard/core/LOOP
281 \ LOOP    DOadr --         L-- an an-1 .. a1 0
282 CODE LOOP
283     MOV #XLOOP,X
284 BW1 ADD #4,&DP          \ make room to compile two words
285     MOV &DP,W
286     MOV X,-4(W)         \ xloop --> HERE
287     MOV TOS,-2(W)       \ DOadr --> HERE+2
288 BEGIN                   \ resolve all "leave" adr
289     MOV &LEAVEPTR,TOS   \ -- Adr of top LeaveStack cell
290     SUB #2,&LEAVEPTR    \ --
291     MOV @TOS,TOS        \ -- first LeaveStack value
292     CMP #0,TOS          \ -- = value left by DO ?
293 0<> WHILE
294     MOV W,0(TOS)        \ move adr after loop as UNLOOP adr
295 REPEAT
296     MOV @PSP+,TOS
297     MOV @IP+,PC
298 ENDCODE IMMEDIATE
299
300 \ https://forth-standard.org/standard/core/PlusLOOP
301 \ +LOOP   adrs --   L-- an an-1 .. a1 0
302 CODE +LOOP
303 MOV #XPLOOP,X
304 GOTO BW1        \ goto BW1 LOOP
305 ENDCODE IMMEDIATE
306 [THEN]
307
308 [UNDEFINED] I [IF]
309 \ https://forth-standard.org/standard/core/I
310 \ I        -- n   R: sys1 sys2 -- sys1 sys2
311 \                  get the innermost loop index
312 CODE I
313 SUB #2,PSP              \ 1 make room in TOS
314 MOV TOS,0(PSP)          \ 3
315 MOV @RSP,TOS            \ 2 index = loopctr - fudge
316 SUB 2(RSP),TOS          \ 3
317 MOV @IP+,PC             \ 4 13~
318 ENDCODE
319 [THEN]
320
321 [UNDEFINED] HERE [IF]
322 CODE HERE
323 MOV #HEREXEC,PC
324 ENDCODE
325 [THEN]
326
327 [UNDEFINED] C@ [IF]
328 \ https://forth-standard.org/standard/core/CFetch
329 \ C@     c-addr -- char   fetch char from memory
330 CODE C@
331 MOV.B @TOS,TOS
332 MOV @IP+,PC
333 ENDCODE
334 [THEN]
335
336 [UNDEFINED] SPACES [IF]
337 \ https://forth-standard.org/standard/core/SPACES
338 \ SPACES   n --            output n spaces
339 CODE SPACES
340 CMP #0,TOS
341 0<> IF
342     PUSH IP
343     BEGIN
344         LO2HI
345         'SP' EMIT
346         HI2LO
347         SUB #2,IP 
348         SUB #1,TOS
349     0= UNTIL
350     MOV @RSP+,IP
351 THEN
352 MOV @PSP+,TOS           \ --         drop n
353 MOV @IP+,PC
354 ENDCODE
355 [THEN]
356
357 [UNDEFINED] 1+ [IF]
358 \ https://forth-standard.org/standard/core/OnePlus
359 \ 1+      n1/u1 -- n2/u2       add 1 to TOS
360 CODE 1+
361 ADD #1,TOS
362 MOV @IP+,PC
363 ENDCODE
364 [THEN]
365
366 [UNDEFINED] + [IF]
367 \ https://forth-standard.org/standard/core/Plus
368 \ +       n1/u1 n2/u2 -- n3/u3     add n1+n2
369 CODE +
370 ADD @PSP+,TOS
371 MOV @IP+,PC
372 ENDCODE
373 [THEN]
374
375 [UNDEFINED] - [IF]
376 \ https://forth-standard.org/standard/core/Minus
377 \ -      n1/u1 n2/u2 -- n3/u3     n3 = n1-n2
378 CODE -
379 SUB @PSP+,TOS   \ 2  -- n2-n1 ( = -n3)
380 XOR #-1,TOS     \ 1
381 ADD #1,TOS      \ 1  -- n3 = -(n2-n1) = n1-n2
382 MOV @IP+,PC
383 ENDCODE
384 [THEN]
385
386 [UNDEFINED] 2* [IF]
387 \ https://forth-standard.org/standard/core/TwoTimes
388 \ 2*      x1 -- x2         arithmetic left shift
389 CODE 2*
390 ADD TOS,TOS
391 MOV @IP+,PC
392 ENDCODE
393 [THEN]
394
395 [UNDEFINED] UM/MOD [IF]
396 \ https://forth-standard.org/standard/core/UMDivMOD
397 \ UM/MOD   udlo|udhi u1 -- r q   unsigned 32/16->r16 q16
398 CODE UM/MOD
399     PUSH #DROP      \
400     MOV #MUSMOD,PC  \ execute MUSMOD then return to DROP
401 ENDCODE
402 [THEN]
403
404 [UNDEFINED] MOVE [IF]
405 \ https://forth-standard.org/standard/core/MOVE
406 \ MOVE    addr1 addr2 u --     smart move
407 \             VERSION FOR 1 ADDRESS UNIT = 1 CHAR
408 CODE MOVE
409 MOV TOS,W           \ W = cnt
410 MOV @PSP+,Y         \ Y = addr2 = dst
411 MOV @PSP+,X         \ X = addr1 = src
412 MOV @PSP+,TOS       \ pop new TOS
413 CMP #0,W            \ count = 0 ?
414 0<> IF              \ if 0, already done !
415     CMP X,Y         \ Y-X \ dst - src
416     0<> IF          \ if dst = src, already done !
417         U< IF       \ U< if src > dst
418             BEGIN   \ copy W bytes
419                 MOV.B @X+,0(Y)
420                 ADD #1,Y
421                 SUB #1,W
422             0= UNTIL
423             MOV @IP+,PC
424         THEN        \ U>= if dst > src
425         ADD W,Y     \ copy W bytes beginning with the end
426         ADD W,X
427         BEGIN
428             SUB #1,X
429             SUB #1,Y
430             MOV.B @X,0(Y)
431             SUB #1,W
432         0= UNTIL
433     THEN
434 THEN
435 MOV @IP+,PC
436 ENDCODE
437 [THEN]
438
439 [UNDEFINED] WORDS [IF]
440 \ https://forth-standard.org/standard/tools/WORDS
441 \ list all words of vocabulary first in CONTEXT.
442 : WORDS                         \ --            
443 CR 
444 CONTEXT @ PAD_ORG               \ -- VOC_BODY PAD                  MOVE all threads of VOC_BODY in PAD_ORG
445 THREADS @ 2*                    \ -- VOC_BODY PAD THREADS*2
446 MOVE                            \ -- vocabulary entries are copied in PAD_ORG
447 BEGIN                           \ -- 
448     0 DUP                       \ -- ptr=0 MAX=0                
449     THREADS @ 2* 0              \ -- ptr=0 MAX=0 THREADS*2 0
450         DO                      \ -- ptr MAX            I =  PAD_ptr = thread*2
451         DUP I PAD_ORG + @       \ -- ptr MAX MAX NFAx
452             U< IF               \ -- ptr MAX            if MAX U< NFAx
453                 DROP DROP       \ --                    drop ptr and MAX
454                 I DUP PAD_ORG + @   \ -- new_ptr new_MAX
455             THEN                \ 
456         2 +LOOP                 \ -- ptr MAX
457     ?DUP                        \ -- ptr MAX MAX | -- ptr 0 (all threads in PAD = 0)
458 WHILE                           \ -- ptr MAX                    replace it by its LFA
459     DUP                         \ -- ptr MAX MAX
460     2 - @                       \ -- ptr MAX [LFA]
461     ROT                         \ -- MAX [LFA] ptr
462     PAD_ORG +                   \ -- MAX [LFA] thread
463     !                           \ -- MAX                [LFA]=new_NFA updates PAD+ptr
464     DUP                         \ -- MAX MAX
465     COUNT $7F AND               \ -- MAX addr count (with suppr. of immediate bit)
466     TYPE                        \ -- MAX
467     C@ $0F AND                  \ -- count_of_chars
468     $10 SWAP - SPACES           \ --                    complete with spaces modulo 16 chars
469 REPEAT                          \ --
470 DROP                            \ ptr --
471 ;                               \ all threads in PAD are filled with 0
472 [THEN]
473
474 [UNDEFINED] CASE [IF]
475 \ https://forth-standard.org/standard/core/CASE
476 : CASE 0 ; IMMEDIATE \ -- #of-1 
477
478 \ https://forth-standard.org/standard/core/OF
479 : OF \ #of-1 -- orgOF #of 
480 1+                          \ count OFs 
481 >R                          \ move off the stack in case the control-flow stack is the data stack. 
482 POSTPONE OVER POSTPONE = \ copy and test case value
483 POSTPONE IF                 \ add orig to control flow stack 
484 POSTPONE DROP           \ discards case value if = 
485 R>                          \ we can bring count back now 
486 ; IMMEDIATE 
487
488 \ https://forth-standard.org/standard/core/ENDOF
489 : ENDOF \ orgOF #of -- orgENDOF #of 
490 >R                          \ move off the stack in case the control-flow stack is the data stack. 
491 POSTPONE ELSE 
492 R>                          \ we can bring count back now 
493 ; IMMEDIATE 
494
495 \ https://forth-standard.org/standard/core/ENDCASE
496 : ENDCASE \ orgENDOF1..orgENDOFn #of -- 
497 POSTPONE DROP
498 0 DO 
499     POSTPONE THEN 
500 LOOP 
501 ; IMMEDIATE 
502 [THEN]
503
504 [UNDEFINED] S_ [IF]
505 CODE S_             \           Squote alias with blank instead quote separator
506 MOV #0,&CAPS        \           turn CAPS OFF
507 COLON
508 XSQUOTE ,           \           compile run-time code
509 'SP' WORD           \ -- c-addr (= HERE)
510 HI2LO
511 MOV.B @TOS,TOS      \ -- len    compile string
512 ADD #1,TOS          \ -- len+1
513 BIT #1,TOS          \           C = ~Z
514 ADDC TOS,&DP        \           store aligned DP
515 MOV @PSP+,TOS       \ --
516 MOV @RSP+,IP        \           pop paired with push COLON
517 MOV #$20,&CAPS      \           turn CAPS ON (default state)
518 MOV @IP+,PC         \ NEXT
519 ENDCODE IMMEDIATE
520 [THEN]
521
522 [UNDEFINED] ESC [IF]
523 CODE ESC
524 CMP #0,&STATEADR
525 0= IF MOV @IP+,PC   \ interpret time usage disallowed
526 THEN
527 COLON          
528 'ESC'               \ -- char escape
529 POSTPONE LITERAL    \ compile-time code : lit 'ESC'  
530 POSTPONE EMIT       \ compile-time code : EMIT
531 POSTPONE S_         \ compile-time code : S_ <escape_sequence>
532 POSTPONE TYPE       \ compile-time code : TYPE
533 ; IMMEDIATE
534 [THEN]
535
536 \ -------------------------------------------------------
537 : SPECS             \ to see all FastForth specifications
538 \ -------------------------------------------------------
539 PWR_STATE           \ before computing free bytes, remove all created words 
540 ECHO
541 ESC [8;40;80t       \ set 40L * 80C terminal display
542 39 0 DO CR LOOP     \ to avoid erasing any line of source, create 42-1 empty lines
543 ESC [H              \ then cursor home
544 ESC [7m             \ Turn reverse video on
545 $0D EMIT ." FastForth V"  \ title line in reverse video 
546 VERSION @         
547 0 <# # 'BS' HOLD # '.' HOLD #S #> TYPE
548 ."  for MSP430FR"
549 HERE                \ HERE - MAIN_ORG = bytes code
550 DEVICEID @          \ value kept in TLV area
551 CASE
552 \ device_ID OF  ." xxxx," $MAIN_ORG ENDOF \ <-- add here your device
553     $8102   OF  ." 5738,"   $C200   ENDOF 
554     $8103   OF  ." 5739,"   $C200   ENDOF
555     $8160   OF  ." 5948,"   $4400   ENDOF
556     $8169   OF  ." 5969,"   $4400   ENDOF
557     $825D   OF  ." 5972,"   $4400   ENDOF
558     $81A8   OF  ." 6989,"   $4400   ENDOF
559     $810D   OF  ." 5986,"   $4400   ENDOF
560     $81F0   OF  ." 4133,"   $C400   ENDOF
561     $8240   OF  ." 2433,"   $C400   ENDOF
562     $82A1   OF  ." 5994,"   $4000   ENDOF
563     $82A6   OF  ." 5962,"   $4000   ENDOF
564     $830C   OF  ." 2355,"   $8000   ENDOF
565     $830D   OF  ." 2353,"   $C000   ENDOF
566     $831E   OF  ." 2155,"   $8000   ENDOF
567     $831D   OF  ." 2153,"   $C000   ENDOF
568     $832A   OF  ." 2476,"   $8000   ENDOF
569     $832B   OF  ." 2475,"   $8000   ENDOF
570     $833C   OF  ." 2633,"   $C400   ENDOF
571     $833D   OF  ." 2533,"   $C400   ENDOF
572     ABORT" xxxx <-- unrecognized device!"
573 ENDCASE                     \ -- HERE MAIN_ORG
574 ['] ['] DUP @ $1284 =       \ DOCOL = CALL rDOCOL opcode
575 IF ."  DTC=1," DROP         \ [CFA] = CALL rDOCOL
576 ELSE 2 + @ $1284 =          \ 
577     IF ."  DTC=2,"          \ [CFA] = PUSH IP, [CFA+2] = CALL rDOCOL 
578     ELSE ."  DTC=3,"        \ [CFA] = PUSH IP, [CFA+2] = MOV PC,IP
579     THEN
580 THEN
581 $20 EMIT 
582 THREADS @ U. 'BS' EMIT ." -Entry word sets, "   \ number of Entry word sets,
583 FREQ_KHZ @ 0 1000 UM/MOD U.                     \ frequency,
584 ?DUP IF 'BS' EMIT ',' EMIT U.   \ if remainder
585 THEN ." MHz, "                  \ MCLK
586 - U. ." bytes"                  \ HERE - MAIN_ORG = number of bytes code,
587 ESC [0m                         \ Turn off character attributes
588 CR
589 ." /COUNTED-STRING   = 255" CR 
590 ." /HOLD             = 34" CR
591 ." /PAD              = 84" CR
592 ." ADDRESS-UNIT-BITS = 16" CR
593 ." FLOORED           = true" CR
594 ." MAX-CHAR          = 255" CR
595 ." MAX-N             = 32767" CR
596 ." MAX-U             = 65535" CR
597 ." MAX-D             = 2147483647" CR
598 ." MAX-UD            = 4294967295" CR
599 ." STACK-CELLS       = 48" CR
600 ." RETURN-STACK-CELLS= 48" CR
601 ." WoRdS aRe CaSe-InSeNsItIvE" CR
602 CR 
603 ESC [7m ." KERNEL SPECS" ESC [0m   \ subtitle in reverse video
604 CR
605 KERNEL_ADDON @
606     DUP 0< IF ." 32.768kHz XTAL" CR THEN
607 2*  DUP 0< IF ." (RTS/CTS) UART TERMINAL" CR 2*
608         ELSE  2* DUP
609             0< IF ." (RTS) UART TERMINAL" CR
610             THEN
611         THEN
612 2*  DUP 0< IF ." (XON/XOFF) UART TERMINAL" CR
613         ELSE  ." I2C_Master TERMINAL" CR
614         THEN
615 2*  DUP 0< IF ." Half-Duplex TERMINAL" CR THEN
616 2*  DUP 0< IF ." Q15.16 input" CR THEN
617 2*  DUP 0< IF ." DOUBLE input" CR THEN
618 2*  DUP 0< IF ." MSP430_X assembler" CR 2* 2* 
619         ELSE 2*  DUP
620             0< IF ." MSP430 Assembler"
621                 2*  DUP 0< IF ."  with 20bits address" THEN
622                 CR
623             ELSE 2*
624             THEN
625         THEN
626 2* 2* 2* 2* 2*  \ 5 free flags
627 2* 0< IF        \ true if COND. COMPILATION
628     [DEFINED] DEFER [IF] ." DEFER word set" CR [THEN]
629     [DEFINED] ALSO  [IF] ." VOCABULARY word set" CR [THEN]
630     [DEFINED] BOOT  [IF] ." bootloader" CR [THEN]
631     [DEFINED] READ" [IF] ." SD_CARD Read/Write" CR [THEN]
632     [DEFINED] LOAD" [IF] ." SD_CARD Loader" CR [THEN]
633     CR 
634     ESC [7m ." OPTIONS" ESC [0m \ subtitle in reverse video
635     CR
636     [DEFINED] {CORE_ANS}  [IF] ." ANS94 core" CR [THEN]
637     [DEFINED] {DOUBLE}    [IF] ." DOUBLE word set" CR [THEN]
638     [DEFINED] {TOOLS}     [IF] ." UTILITY" CR [THEN]
639     [DEFINED] {FIXPOINT}  [IF] ." Q15.16 ADD SUB MUL DIV" CR [THEN]
640     [DEFINED] {CORDIC}    [IF] ." CORDIC engine" CR [THEN]
641     [DEFINED] {SD_TOOLS}  [IF] ." SD_TOOLS" CR [THEN]
642     [DEFINED] {RTC}       [IF] ." RTC utility" CR [THEN]
643     [DEFINED] {UARTI2CS}  [IF] ." UART to I2C_FastForth bridge" CR [THEN]
644     [DEFINED] ALSO
645     [IF] 
646         CR 
647         ESC [7m ." ASSEMBLER word set" ESC [0m  \ subtitle in reverse video 
648         ALSO ASSEMBLER WORDS PREVIOUS           \ type ASSEMBLER word set
649         CR
650     [THEN]
651 THEN
652 CR
653 ESC [7m ." FORTH word set"  ESC [0m \ subtitle in reverse video 
654 WORDS                               \ type FORTH word set 
655 CR
656 HI2LO
657 MOV #WARM+4,PC  \ type count of bytes free without re-executing INI_APP
658 ENDCODE
659
660 SPECS \ here FastForth displays a (volatile) message with some informations