OSDN Git Service

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