-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlossary.txt
748 lines (727 loc) · 50 KB
/
Glossary.txt
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
4e-asmscripting.s43
;U Basics for an external cross assembler
;U CODE <name> -- build header for assembler word,
;U CODEADR <name> -- build constant
;U CALL adr -- run a code subroutine starting at address.
;U NEXT, -- Macro; compiles jump to high level forth
;U END-CODE -- mark end of code section
4e-boot-eZ430.s43
;U STARTUP WORDS ===============================================================
;U .BOOTVERSION -- print boot version
;Z ITHERE -- adr find first free flash cell
;U APPCRC -- crc CRC of APP-dictionary
;U VALID? -- f check if user app crc matches infoB
;U SAVE -- save user area to infoB
;Z BOOT -- boot system
;Z WARM -- use user area from RAM (hopefully intact)
;U .COLD -- display COLD message
;Z COLD -- set user area to latest application
;Z FACTORY -- set user area to plain kernel
;U PROFUSE -- adr address of production fuse.
;U WIPE -- erase flash but not kernel, reset user area.
;U (WIPE) -- erase flash but not kernel, reset user area.
4e-core430.s43
;C EXECUTE i*x xt -- j*x execute Forth word at 'xt'
;Z LIT -- x fetch inline literal to stack
;C EXIT -- exit a colon definition
;C VARIABLE -- define a Forth VARIABLE
;C CONSTANT -- define a Forth constant
;Z USER n -- define user variable 'n'
;C DUP x -- x x duplicate top of stack
;C ?DUP x -- 0 | x x DUP if nonzero
;C DROP x -- drop top of stack
;C SWAP x1 x2 -- x2 x1 swap top two items
;C OVER x1 x2 -- x1 x2 x1 per stack diagram
;C ROT x1 x2 x3 -- x2 x3 x1 per stack diagram
;X NIP x1 x2 -- x2 per stack diagram
;C >R x -- R: -- x push to return stack
;C R> -- x R: x -- pop from return stack
;C R@ -- x R: x -- x fetch from rtn stk
;Z SP@ -- a-addr get data stack pointer
;Z SP! a-addr -- set data stack pointer
;Z RP@ -- a-addr get return stack pointer
;Z RP! a-addr -- set return stack pointer
;X TUCK x1 x2 -- x2 x1 x2 per stack diagram
;C @ a-addr -- x fetch cell from memory
;C ! x a-addr -- store cell in memory
;C C@ c-addr -- char fetch char from memory
;C C! char c-addr -- store char in memory
;Z FLERASE a-addr n -- erase n bytes of flash, full segment sizes.
;Z I! x a-addr -- store cell in Instruction memory
;Z IC! x a-addr -- store char in Instruction memory
;Z D->I c-addr1 c-addr2 u -- move Data->Code
;C + n1/u1 n2/u2 -- n3/u3 add n1+n2
;C +! n/u a-addr -- add cell to memory
;X M+ d n -- d add single to double
;C - n1/u1 n2/u2 -- n3/u3 subtract n1-n2
;C AND x1 x2 -- x3 logical AND
;C OR x1 x2 -- x3 logical OR
;C XOR x1 x2 -- x3 logical XOR
;C INVERT x1 -- x2 bitwise inversion
;C NEGATE x1 -- x2 two's complement
;C 1+ n1/u1 -- n2/u2 add 1 to TOS
;C 1- n1/u1 -- n2/u2 subtract 1 from TOS
;Z >< x1 -- x2 swap bytes (not ANSI)
;C 2* x1 -- x2 arithmetic left shift
;C 2/ x1 -- x2 arithmetic right shift
;C LSHIFT x1 u -- x2 logical L shift u places
;C RSHIFT x1 u -- x2 logical R shift u places
;C 0= n/u -- flag return true if TOS=0
;C 0< n -- flag true if TOS negative
;C = x1 x2 -- flag test x1=x2
;X <> x1 x2 -- flag test not eq (not ANSI)
;C < n1 n2 -- flag test n1<n2, signed
;C > n1 n2 -- flag test n1>n2, signed
;C U< u1 u2 -- flag test u1<u2, unsigned
;X U> u1 u2 -- flag u1>u2 unsgd (not ANSI)
;C RLA n1 -- n2 f rotate left through carry, true if carry set
;Z BRANCH -- branch always
;Z ?BRANCH x -- branch if TOS zero
;Z (do) n1|u1 n2|u2 -- R: -- sys1 sys2run-time code for DO
;Z (loop) R: sys1 sys2 -- | sys1 sys2 run-time code for LOOP
;Z (+loop) n -- R: sys1 sys2 -- | sys1 sys2run-time code for +LOOP
;C I -- n R: sys1 sys2 -- sys1 sys2get the innermost loop index
;C J -- n R: 4*sys -- 4*sys get the second loop index
;C UNLOOP -- R: sys1 sys2 -- drop loop parms
;C UM* u1 u2 -- ud unsigned 16x16->32 mult.
;C UM/MOD ud u1 -- u2 u3 unsigned 32/16->16
;C FILL c-addr u char -- fill memory with char
;X CMOVE c-addr1 c-addr2 u -- move from bottom
;X CMOVE> c-addr1 c-addr2 u -- move from top
;Z I->D c-addr1 c-addr2 u -- move Code->Data
;Z SKIP c-addr u c -- c-addr' u' skip matching chars
;Z SCAN c-addr u c -- c-addr' u' find matching char
;Z S= c-addr1 c-addr2 u -- n string compare, n<0: s1<s2, n=0: s1=s2, n>0: s1>s2
;Z N= c-addr1 c-addr2 u -- n name compare, n<0: s1<s2, n=0: s1=s2, n>0: s1>s2
;C KEY -- c get character from keyboard; vectored
;C EMIT c -- output character to console; vectored
;X KEY? -- f return true if char waiting
;X ZERO -- 0 put zero on stack. Often usesd word.
4e-deps430F2274.s43
;C (EMIT) c -- output character to console; core routine
;C (KEY) -- c get character from keyboard; core routine
;C ALIGN -- align HERE
;C ALIGNED addr -- a-addr align given addr
;Z CELL -- n size of one cell
;C CELL+ a-addr1 -- a-addr2 add cell size
;C CELLS n1 -- n2 cells->adrs units
;C CHAR+ c-addr1 -- c-addr2 add char size
;C CHARS n1 -- n2 chars->adrs units
;C >BODY xt -- a-addr adrs of CREATE data
;X COMPILE, xt -- append execution token
;Z !CF adrs cfa -- set code action of a word
;Z ,CF adrs -- append a code field
;Z ,CALL adrs -- append a subroutine CALL
;Z ,JMP adrs -- append an absolute 16-bit JMP
;Z !COLON -- change code field to DOCOLON
;Z ,EXIT -- append hi-level EXIT action
;Z ,BRANCH xt -- append a branch instruction
;Z ,DEST dest -- append a branch address
;Z !DEST dest adrs -- change a branch dest'n
;Z ,NONE -- append a null destination (Flashable)
4e-eZ430-RF2500.s43
4e-eZ430.s43
4e-hilvl430.s43
;X NAME stack -- stack
; SYSTEM VARIABLES & CONSTANTS =================================================
;Z U0 -- a-addr current user area adrs
;C >IN -- a-addr holds offset into TIB
;C BASE -- a-addr holds conversion radix
;C STATE -- a-addr holds compiler state
;Z DP -- a-addr holds dictionary ptr
;Z 'SOURCE -- a-addr two cells: len, adrs
;Z LATEST -- a-addr last word in dict.
;Z HP -- a-addr HOLD pointer
;Z LP -- a-addr Leave-stack pointer
;Z IDP -- a-addr ROM dictionary pointer
;Z NEWEST -- a-addr temporary LATEST storage
;Z APP -- a-addr app pointer ( was TURNKEY), use as APP ! To start App.
;Z CAPS -- a-addr capitalize words pointer
;Z USERKEY -- a-addr KEY pointer
;Z USEREMIT -- a-addr EMIT pointer
;Z NEWLINE -- a-addr CR pointer
;X PAD -- a-addr user PAD buffer = end of hold area!
;Z L0 -- a-addr bottom of Leave stack
;Z R0 -- a-addr end of return stack
;Z S0 -- a-addr end of parameter stack
;X TIB -- a-addr Terminal Input Buffer
;Z TIBSIZE -- n size of TIB
;C BL -- char an ASCII space
;Z UINIT -- addr initial values for user area
;Z #INIT -- n #bytes of user area init data
;Z COR -- adr cause of reset
;Z INFOB -- adr start of info B segment
;Z INFOC -- adr start of info C segment
;Z INFOD -- adr start of info C segment
;Z APPU0 -- adr start of Application user area
; ARITHMETIC OPERATORS =========================================================
;C S>D n -- d single -> double prec.
;Z ?NEGATE n1 n2 -- n3 negate n1 if n2 negative
;C ABS n1 -- +n2 absolute value
;X DNEGATE d1 -- d2 negate double precision
;Z ?DNEGATE d1 n -- d2 negate d1 if n negative
;X DABS d1 -- +d2 absolute value dbl.prec.
;C M* n1 n2 -- d signed 16*16->32 multiply
;C SM/REM d1 n1 -- n2 n3 symmetric signed div
;C FM/MOD d1 n1 -- n2 n3 floored signed div'n
;C * n1 n2 -- n3 signed multiply
;C /MOD n1 n2 -- n3 n4 signed divide/rem'dr
;C / n1 n2 -- n3 signed divide
;C MOD n1 n2 -- n3 signed remainder
;C */MOD n1 n2 n3 -- n4 n5 n1*n2/n3, rem"
;C */ n1 n2 n3 -- n4 n1*n2/n3
;C MAX n1 n2 -- n3 signed maximum
;C MIN n1 n2 -- n3 signed minimum
; DOUBLE OPERATORS =============================================================
;C 2@ a-addr -- x1 x2 fetch 2 cells
;C 2! x1 x2 a-addr -- store 2 cells
;C 2DROP x1 x2 -- drop 2 cells
;C 2DUP x1 x2 -- x1 x2 x1 x2 dup top 2 cells
;C 2SWAP x1 x2 x3 x4 -- x3 x4 x1 x2 per diagram
;C 2OVER x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2per diagram
; INPUT/OUTPUT =================================================================
;C COUNT c-addr1 -- c-addr2 u counted->adr/len
;C DOCR -- output newline
;C CR -- output newline
;C SPACE -- output a space
;C SPACES n -- output n spaces
;Z UMIN u1 u2 -- u unsigned minimum
;Z UMAX u1 u2 -- u unsigned maximum
;C ACCEPT c-addr +n -- +n' get line from term'l
;C TYPE c-addr +n -- type line to term'l
;Z (IS") -- c-addr u run-time code for S"
;Z (S") -- c-addr u run-time code for S"
;Z IS" -- compile in-line string
;Z IS" -- compile in-line string
;C S" -- compile in-line string
;C S" -- compile in-line string
;C ." -- compile string to print
;Z IWORD c -- c-addr WORD to Code space
;Z IWORDC c -- c-addr maybe capitalize WORD to Code space
; NUMERIC OUTPUT ===============================================================
;Z UD/MOD ud1 u2 -- u3 ud4 32/16->32 divide
;Z UD* ud1 d2 -- ud3 32*16->32 multiply
;C HOLD char -- add char to output string
;C <# -- begin numeric conversion
;Z >digit n -- c convert to 0..9A..Z
;C # ud1 -- ud2 convert 1 digit of output
;C #S ud1 -- ud2 convert remaining digits
;C #> ud1 -- c-addr u end conv., get string
;C SIGN n -- add minus sign if n<0
;C U. u -- display u unsigned
;C . n -- display n signed
;C DECIMAL -- set number base to decimal
;X HEX -- set number base to hex
; DICTIONARY MANAGEMENT ========================================================
;C HERE -- addr returns dictionary ptr
;C ALLOT n -- allocate n bytes in dict
;C , x -- append cell to dict
;C C, char -- append char to dict
;C IHERE -- addr returns Code dictionary ptr
;C IALLOT n -- allocate n bytes in Code dict
;C I, x -- append cell to Code dict
;C IC, char -- append char to Code dict
; INTERPRETER ==================================================================
;C SOURCE -- adr n current input buffer
;X /STRING a u n -- a+n u-n trim string
;Z >counted src n dst -- copy to counted str
;Z ADR>IN c-addr' -- set >IN to offset to given adr
;X PARSE char -- c-addr n word delim'd by char
;C WORD char -- c-addr word delim'd by char
;C WORD char -- c-addr word delim'd by char
;Z NFA>LFA nfa -- lfa name adr -> link field
;Z NFA>CFA nfa -- cfa name adr -> code field
;Z IMMED? nfa -- f fetch immediate flag
;C FIND c-addr -- c-addr 0 if not found
;C FIND c-addr -- xt 1c if immediate
;C FIND c-addr -- xt -1 if "normal"
;C UPC char -- char capitalize character
;C CAPITALIZE c-addr -- c-addr capitalize string
;C LITERAL x -- append numeric literal
;Z DIGIT? c -- n -1 | x 0 if c is a valid digit | otherwise
;Z ?SIGN adr n -- adr' n' f get optional sign; advance adr/n if sign; return NZ if negative
;C >NUMBER ud adr u -- ud' adr' u' convert string to number
;Z ?NUMBER c-addr -- n -1 string->number
;Z ?NUMBER c-addr -- c-addr 0 if convert error
;Z INTERPRET i*x c-addr u -- j*x interpret given buffer
;C EVALUATE i*x c-addr u -- j*x interprt string
;C QUIT -- R: i*x -- interpret from kbd
;C ABORT i*x -- R: j*x -- clear stk & QUIT
;Z ?ABORT f c-addr u -- abort & print msg
;C ABORT" i*x 0 -- i*x R: j*x -- j*x x1=0
;C ABORT" i*x x1 -- R: j*x -- x1<>0
;C ' -- xt find word in dictionary
;C CHAR -- char parse ASCII character
;C [CHAR] -- compile character literal
;C ( -- skip input until )
; COMPILER =====================================================================
;Z HEADER -- create a Forth word header
;Z <BUILDS -- define a word with t.b.d. action & no data
;C CREATE -- create an empty definition pointing to RAM
;Z (DOES>) -- run-time action of DOES>
;C DOES> -- change action of latest def'n
;C RECURSE -- recurse current definition
;C [ -- enter interpretive state
;C ] -- enter compiling state
;Z HIDE -- "hide" latest definition
;Z REVEAL -- "reveal" latest definition
;C IMMEDIATE -- make last def'n immediate
;C : -- begin a colon definition
;C ; -- end a colon definition
;C ['] -- find word & compile as literal
;C POSTPONE -- postpone compile action of word
;Z COMPILE -- append inline execution token
; CONTROL STRUCTURES ===========================================================
;C IF -- adrs conditional forward branch
;C THEN adrs -- resolve forward branch
;C ELSE adrs1 -- adrs2 branch for IF..ELSE
;C BEGIN -- adrs target for bwd. branch
;C UNTIL adrs -- conditional backward branch
;X AGAIN adrs -- uncond'l backward branch
;C WHILE adrs1 -- adrs2 adrs1 branch for WHILE loop
;C REPEAT adrs2 adrs1 -- resolve WHILE loop
;Z >L x -- L: -- x move to leave stack
;Z L> -- x L: x -- move from leave stack
;C DO -- adrs L: -- 0 start a loop
;Z ENDLOOP adrs xt -- L: 0 a1 a2 .. aN --common factor of LOOP and +LOOP
;C LOOP adrs -- L: 0 a1 a2 .. aN -- finish a loop
;C +LOOP adrs -- L: 0 a1 a2 .. aN -- finish a loop
;C LEAVE -- L: -- adrs leave a loop
; OTHER OPERATIONS =============================================================
;X WITHIN n1|u1 n2|u2 n3|u3 -- f n2<=n1<n3?
;C MOVE addr1 addr2 u -- smart move
;C DEPTH -- +n number of items on stack
;C ENVIRONMENT? c-addr u -- false | i*x true system query
; UTILITY WORDS ================================================================
;Z NOOP -- do nothing
;Z FLALIGNED a -- a' align IDP to flash boundary
;X MARKER -- create word to restore dictionary
;X WORDS -- list all words in dict. Stop and go key version.
;X (U.R) u n -- xxx display u unsigned in n width; primitiv
;X U.R u n -- display u unsigned in n width
;X 0U.R u n -- display u unsigned in n width with leading zeros
;X ZEROS n -- output n zeros
;X DUMP adr n -- dump memory
;X .S -- print stack contents
;Z CRC n addr len -- n' crc process string
; MISC =========================================================================
;C 2CONSTANT <name> w1 w2 -- define a Forth double constant
;U \ -- backslash
;Z .VER -- type message
;U BELL -- send $07 to Terminal
;Z ESC[ -- start esc-sequence
;Z PN -- send parameter of esc-sequence
;Z ;PN -- send delimiter ; followed by parameter
;U AT-XY x y -- set cursor position in terminal
;U PAGE -- send "page" command to terminal to clear screen.
;U BIN -- set number base to binary
;U RAM -- compile into RAM. SAVE your system befor using RAM.
;U TRUE -- f true flag
;U FALSE -- f false flag
;C TABLE -- create an empty definition pointing to FLASH
; MCU specific words ===========================================================
;U 1MS -- wait about 1 millisecond
;U MS n -- wait about n milliseconds
;U SET mask addr -- set bit from mask in addr (cell); use even adr!
;U CSET mask addr -- set bit from mask in addr (byte)
;U CLR mask addr -- reset bit from mask in addr (cell); use even adr!
;U CCLR mask addr -- reset bit from mask in addr (byte)
;U CTOGGLE mask addr -- flip bit from mask in addr (byte)
;U CGET mask addr -- flag test bit from mask in addr (byte)
;Z RESETADR -- adr reset vector address
;Z MEMBOT -- adr begining of USERflash
;Z MEMTOP -- adr end of USERflash
;U MEM -- u bytes left in flash
;U UNUSED -- u bytes left in RAM
;Z VARBOT -- a-addr bottom of Variable Area
;Z TOPSEG -- a-addr bottom of top most segment
;Z VECBOT -- a-addr begining of vector segment
;U ? adr -- u display content of variable
;Z P1 -- adr address of port1 output register
;Z P2 -- adr address of port2 output register
;Z P3 -- adr address of port2 output register
4e-infoB.s43
4e-infoC.s43
4e-infoD.s43
4e-init430F2274.s43
;UAREA_SIZE = 16 ; UAREA
4e-lpm.s43
;C IRXON -- turn UCA0 interrupt on
;C IRXOFF -- turn UCA0 interrupt off
;C LPM_WAKE -- adr LPM wake up interrupt service routine address
;Z LPM4 -- ; Enter low power mode 4, wake on interrupt.
;Z LPM0 -- ; Enter low power mode 0, wake on interrupt.
;Z SETIRX -- set IRX vector to wakr up MCU
;Z IE2 -- adr
;Z UCA0RXIE -- adr Interrupt mask UCA0
4e-onewire.s43
4e-startup.s43
;U STARTUP WORDS ===============================================================
;U .BOOTVERSION -- print boot version
;Z ITHERE -- adr find first free flash cell
;U APPCRC -- crc CRC of APP-dictionary
;U VALID? -- f check if user app crc matches infoB
;U SAVE -- save user area to infoB
;Z BOOT -- boot system
;Z WARM -- use user area from RAM (hopefully intact)
;U .COLD -- display COLD message
;Z COLD -- set user area to latest application
;Z FACTORY -- set user area to plain kernel
;U PROFUSE -- adr address of production fuse.
;U 4E4THPRO -- save app and blow production fuse.
;U WIPE -- erase flash but not kernel, reset user area.
;U (WIPE) -- erase flash but not kernel, reset user area.
4e-vecarea.s43
; write vector area ============================================================
;Z VEC! x adr --
;U (VECWIPE) -- erase top segment in flash
;U VECWIPE -- erase ISR flash, set reset vector = reset to boot 4e4th.
;U VECSAVE -- save all vectors to infoD
;U VECRESTORE -- unconditional restore all saved vectors.
;U VECBACK -- write back of vectors: dont overwrite newer ones.
;U VECBACK -- write back of vectors: dont overwrite newer ones.
;U INTERRUPT isr iv -- store ISR address to interrupt vector address
;U PROFUSE -- adr address of production fuse.
;U 4E4THPRO -- save app and blow production fuse.
4e-vecs430F2274.s43
4e-WAS430G2553.s43
;U XTRA -- increment ext
;U SAS -- init assembler variables
------------------------words sorted------------------------
;X NAME stack -- stack
;C ! x a-addr -- store cell in memory
;Z !CF adrs cfa -- set code action of a word
;Z !COLON -- change code field to DOCOLON
;Z !DEST dest adrs -- change a branch dest'n
;C # ud1 -- ud2 convert 1 digit of output
;C #> ud1 -- c-addr u end conv., get string
;Z #INIT -- n #bytes of user area init data
;C #S ud1 -- ud2 convert remaining digits
;C ' -- xt find word in dictionary
;Z 'SOURCE -- a-addr two cells: len, adrs
;C ( -- skip input until )
;Z (+loop) n -- R: sys1 sys2 -- | sys1 sys2run-time code for +LOOP
;Z (DOES>) -- run-time action of DOES>
;C (EMIT) c -- output character to console; core routine
;Z (IS") -- c-addr u run-time code for S"
;C (KEY) -- c get character from keyboard; core routine
;Z (S") -- c-addr u run-time code for S"
;X (U.R) u n -- xxx display u unsigned in n width; primitiv
;U (VECWIPE) -- erase top segment in flash
;U (WIPE) -- erase flash but not kernel, reset user area.
;Z (do) n1|u1 n2|u2 -- R: -- sys1 sys2run-time code for DO
;Z (loop) R: sys1 sys2 -- | sys1 sys2 run-time code for LOOP
;C * n1 n2 -- n3 signed multiply
;C */ n1 n2 n3 -- n4 n1*n2/n3
;C */MOD n1 n2 n3 -- n4 n5 n1*n2/n3, rem"
;C + n1/u1 n2/u2 -- n3/u3 add n1+n2
;C +! n/u a-addr -- add cell to memory
;C +LOOP adrs -- L: 0 a1 a2 .. aN -- finish a loop
;C , x -- append cell to dict
;Z ,BRANCH xt -- append a branch instruction
;Z ,CALL adrs -- append a subroutine CALL
;Z ,CF adrs -- append a code field
;Z ,DEST dest -- append a branch address
;Z ,EXIT -- append hi-level EXIT action
;Z ,JMP adrs -- append an absolute 16-bit JMP
;Z ,NONE -- append a null destination (Flashable)
;C - n1/u1 n2/u2 -- n3/u3 subtract n1-n2
;C . n -- display n signed
;C ." -- compile string to print
;U .BOOTVERSION -- print boot version
;U .COLD -- display COLD message
;X .S -- print stack contents
;Z .VER -- type message
;C / n1 n2 -- n3 signed divide
;C /MOD n1 n2 -- n3 n4 signed divide/rem'dr
;X /STRING a u n -- a+n u-n trim string
;C 0< n -- flag true if TOS negative
;C 0= n/u -- flag return true if TOS=0
;X 0U.R u n -- display u unsigned in n width with leading zeros
;C 1+ n1/u1 -- n2/u2 add 1 to TOS
;C 1- n1/u1 -- n2/u2 subtract 1 from TOS
;U 1MS -- wait about 1 millisecond
;C 2! x1 x2 a-addr -- store 2 cells
;C 2* x1 -- x2 arithmetic left shift
;C 2/ x1 -- x2 arithmetic right shift
;C 2@ a-addr -- x1 x2 fetch 2 cells
;C 2CONSTANT <name> w1 w2 -- define a Forth double constant
;C 2DROP x1 x2 -- drop 2 cells
;C 2DUP x1 x2 -- x1 x2 x1 x2 dup top 2 cells
;C 2OVER x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2per diagram
;C 2SWAP x1 x2 x3 x4 -- x3 x4 x1 x2 per diagram
;U 4E4THPRO -- save app and blow production fuse.
;C : -- begin a colon definition
;C ; -- end a colon definition
;Z ;PN -- send delimiter ; followed by parameter
;C < n1 n2 -- flag test n1<n2, signed
;C <# -- begin numeric conversion
;X <> x1 x2 -- flag test not eq (not ANSI)
;Z <BUILDS -- define a word with t.b.d. action & no data
;C = x1 x2 -- flag test x1=x2
;C > n1 n2 -- flag test n1>n2, signed
;Z >< x1 -- x2 swap bytes (not ANSI)
;C >BODY xt -- a-addr adrs of CREATE data
;C >IN -- a-addr holds offset into TIB
;Z >L x -- L: -- x move to leave stack
;C >NUMBER ud adr u -- ud' adr' u' convert string to number
;C >R x -- R: -- x push to return stack
;Z >counted src n dst -- copy to counted str
;Z >digit n -- c convert to 0..9A..Z
;U ? adr -- u display content of variable
;Z ?ABORT f c-addr u -- abort & print msg
;Z ?BRANCH x -- branch if TOS zero
;Z ?DNEGATE d1 n -- d2 negate d1 if n negative
;C ?DUP x -- 0 | x x DUP if nonzero
;Z ?NEGATE n1 n2 -- n3 negate n1 if n2 negative
;Z ?NUMBER c-addr -- c-addr 0 if convert error
;Z ?NUMBER c-addr -- n -1 string->number
;Z ?SIGN adr n -- adr' n' f get optional sign; advance adr/n if sign; return NZ if negative
;C @ a-addr -- x fetch cell from memory
;C ABORT i*x -- R: j*x -- clear stk & QUIT
;C ABORT" i*x 0 -- i*x R: j*x -- j*x x1=0
;C ABORT" i*x x1 -- R: j*x -- x1<>0
;C ABS n1 -- +n2 absolute value
;C ACCEPT c-addr +n -- +n' get line from term'l
;Z ADR>IN c-addr' -- set >IN to offset to given adr
;X AGAIN adrs -- uncond'l backward branch
;C ALIGN -- align HERE
;C ALIGNED addr -- a-addr align given addr
;C ALLOT n -- allocate n bytes in dict
;C AND x1 x2 -- x3 logical AND
;Z APP -- a-addr app pointer ( was TURNKEY), use as APP ! To start App.
;U APPCRC -- crc CRC of APP-dictionary
;Z APPU0 -- adr start of Application user area
;U AT-XY x y -- set cursor position in terminal
;C BASE -- a-addr holds conversion radix
;C BEGIN -- adrs target for bwd. branch
;U BELL -- send $07 to Terminal
;U BIN -- set number base to binary
;C BL -- char an ASCII space
;Z BOOT -- boot system
;Z BRANCH -- branch always
;U Basics for an external cross assembler
;C C! char c-addr -- store char in memory
;C C, char -- append char to dict
;C C@ c-addr -- char fetch char from memory
;U CALL adr -- run a code subroutine starting at address.
;C CAPITALIZE c-addr -- c-addr capitalize string
;Z CAPS -- a-addr capitalize words pointer
;U CCLR mask addr -- reset bit from mask in addr (byte)
;Z CELL -- n size of one cell
;C CELL+ a-addr1 -- a-addr2 add cell size
;C CELLS n1 -- n2 cells->adrs units
;U CGET mask addr -- flag test bit from mask in addr (byte)
;C CHAR -- char parse ASCII character
;C CHAR+ c-addr1 -- c-addr2 add char size
;C CHARS n1 -- n2 chars->adrs units
;U CLR mask addr -- reset bit from mask in addr (cell); use even adr!
;X CMOVE c-addr1 c-addr2 u -- move from bottom
;X CMOVE> c-addr1 c-addr2 u -- move from top
;U CODE <name> -- build header for assembler word,
;U CODEADR <name> -- build constant
;Z COLD -- set user area to latest application
;Z COMPILE -- append inline execution token
;X COMPILE, xt -- append execution token
;C CONSTANT -- define a Forth constant
;Z COR -- adr cause of reset
;C COUNT c-addr1 -- c-addr2 u counted->adr/len
;C CR -- output newline
;Z CRC n addr len -- n' crc process string
;C CREATE -- create an empty definition pointing to RAM
;U CSET mask addr -- set bit from mask in addr (byte)
;U CTOGGLE mask addr -- flip bit from mask in addr (byte)
;Z D->I c-addr1 c-addr2 u -- move Data->Code
;X DABS d1 -- +d2 absolute value dbl.prec.
;C DECIMAL -- set number base to decimal
;C DEPTH -- +n number of items on stack
;Z DIGIT? c -- n -1 | x 0 if c is a valid digit | otherwise
;X DNEGATE d1 -- d2 negate double precision
;C DO -- adrs L: -- 0 start a loop
;C DOCR -- output newline
;C DOES> -- change action of latest def'n
;Z DP -- a-addr holds dictionary ptr
;C DROP x -- drop top of stack
;X DUMP adr n -- dump memory
;C DUP x -- x x duplicate top of stack
;C ELSE adrs1 -- adrs2 branch for IF..ELSE
;C EMIT c -- output character to console; vectored
;U END-CODE -- mark end of code section
;Z ENDLOOP adrs xt -- L: 0 a1 a2 .. aN --common factor of LOOP and +LOOP
;C ENVIRONMENT? c-addr u -- false | i*x true system query
;Z ESC[ -- start esc-sequence
;C EVALUATE i*x c-addr u -- j*x interprt string
;C EXECUTE i*x xt -- j*x execute Forth word at 'xt'
;C EXIT -- exit a colon definition
;Z FACTORY -- set user area to plain kernel
;U FALSE -- f false flag
;C FILL c-addr u char -- fill memory with char
;C FIND c-addr -- c-addr 0 if not found
;C FIND c-addr -- xt -1 if "normal"
;C FIND c-addr -- xt 1c if immediate
;Z FLALIGNED a -- a' align IDP to flash boundary
;Z FLERASE a-addr n -- erase n bytes of flash, full segment sizes.
;C FM/MOD d1 n1 -- n2 n3 floored signed div'n
;Z HEADER -- create a Forth word header
;C HERE -- addr returns dictionary ptr
;X HEX -- set number base to hex
;Z HIDE -- "hide" latest definition
;C HOLD char -- add char to output string
;Z HP -- a-addr HOLD pointer
;C I -- n R: sys1 sys2 -- sys1 sys2get the innermost loop index
;Z I! x a-addr -- store cell in Instruction memory
;C I, x -- append cell to Code dict
;Z I->D c-addr1 c-addr2 u -- move Code->Data
;C IALLOT n -- allocate n bytes in Code dict
;Z IC! x a-addr -- store char in Instruction memory
;C IC, char -- append char to Code dict
;Z IDP -- a-addr ROM dictionary pointer
;Z IE2 -- adr
;C IF -- adrs conditional forward branch
;C IHERE -- addr returns Code dictionary ptr
;Z IMMED? nfa -- f fetch immediate flag
;C IMMEDIATE -- make last def'n immediate
;Z INFOB -- adr start of info B segment
;Z INFOC -- adr start of info C segment
;Z INFOD -- adr start of info C segment
;Z INTERPRET i*x c-addr u -- j*x interpret given buffer
;U INTERRUPT isr iv -- store ISR address to interrupt vector address
;C INVERT x1 -- x2 bitwise inversion
;C IRXOFF -- turn UCA0 interrupt off
;C IRXON -- turn UCA0 interrupt on
;Z IS" -- compile in-line string
;Z ITHERE -- adr find first free flash cell
;Z IWORD c -- c-addr WORD to Code space
;Z IWORDC c -- c-addr maybe capitalize WORD to Code space
;C J -- n R: 4*sys -- 4*sys get the second loop index
;C KEY -- c get character from keyboard; vectored
;X KEY? -- f return true if char waiting
;Z L0 -- a-addr bottom of Leave stack
;Z L> -- x L: x -- move from leave stack
;Z LATEST -- a-addr last word in dict.
;C LEAVE -- L: -- adrs leave a loop
;Z LIT -- x fetch inline literal to stack
;C LITERAL x -- append numeric literal
;C LOOP adrs -- L: 0 a1 a2 .. aN -- finish a loop
;Z LP -- a-addr Leave-stack pointer
;Z LPM0 -- ; Enter low power mode 0, wake on interrupt.
;Z LPM4 -- ; Enter low power mode 4, wake on interrupt.
;C LPM_WAKE -- adr LPM wake up interrupt service routine address
;C LSHIFT x1 u -- x2 logical L shift u places
;C M* n1 n2 -- d signed 16*16->32 multiply
;X M+ d n -- d add single to double
;X MARKER -- create word to restore dictionary
;C MAX n1 n2 -- n3 signed maximum
;U MEM -- u bytes left in flash
;Z MEMBOT -- adr begining of USERflash
;Z MEMTOP -- adr end of USERflash
;C MIN n1 n2 -- n3 signed minimum
;C MOD n1 n2 -- n3 signed remainder
;C MOVE addr1 addr2 u -- smart move
;U MS n -- wait about n milliseconds
;Z N= c-addr1 c-addr2 u -- n name compare, n<0: s1<s2, n=0: s1=s2, n>0: s1>s2
;C NEGATE x1 -- x2 two's complement
;Z NEWEST -- a-addr temporary LATEST storage
;Z NEWLINE -- a-addr CR pointer
;U NEXT, -- Macro; compiles jump to high level forth
;Z NFA>CFA nfa -- cfa name adr -> code field
;Z NFA>LFA nfa -- lfa name adr -> link field
;X NIP x1 x2 -- x2 per stack diagram
;Z NOOP -- do nothing
;C OR x1 x2 -- x3 logical OR
;C OVER x1 x2 -- x1 x2 x1 per stack diagram
;Z P1 -- adr address of port1 output register
;Z P2 -- adr address of port2 output register
;Z P3 -- adr address of port2 output register
;X PAD -- a-addr user PAD buffer = end of hold area!
;U PAGE -- send "page" command to terminal to clear screen.
;X PARSE char -- c-addr n word delim'd by char
;Z PN -- send parameter of esc-sequence
;C POSTPONE -- postpone compile action of word
;U PROFUSE -- adr address of production fuse.
;C QUIT -- R: i*x -- interpret from kbd
;Z R0 -- a-addr end of return stack
;C R> -- x R: x -- pop from return stack
;C R@ -- x R: x -- x fetch from rtn stk
;U RAM -- compile into RAM. SAVE your system befor using RAM.
;C RECURSE -- recurse current definition
;C REPEAT adrs2 adrs1 -- resolve WHILE loop
;Z RESETADR -- adr reset vector address
;Z REVEAL -- "reveal" latest definition
;C RLA n1 -- n2 f rotate left through carry, true if carry set
;C ROT x1 x2 x3 -- x2 x3 x1 per stack diagram
;Z RP! a-addr -- set return stack pointer
;Z RP@ -- a-addr get return stack pointer
;C RSHIFT x1 u -- x2 logical R shift u places
;C S" -- compile in-line string
;Z S0 -- a-addr end of parameter stack
;Z S= c-addr1 c-addr2 u -- n string compare, n<0: s1<s2, n=0: s1=s2, n>0: s1>s2
;C S>D n -- d single -> double prec.
;U SAS -- init assembler variables
;U SAVE -- save user area to infoB
;Z SCAN c-addr u c -- c-addr' u' find matching char
;U SET mask addr -- set bit from mask in addr (cell); use even adr!
;Z SETIRX -- set IRX vector to wakr up MCU
;C SIGN n -- add minus sign if n<0
;Z SKIP c-addr u c -- c-addr' u' skip matching chars
;C SM/REM d1 n1 -- n2 n3 symmetric signed div
;C SOURCE -- adr n current input buffer
;Z SP! a-addr -- set data stack pointer
;Z SP@ -- a-addr get data stack pointer
;C SPACE -- output a space
;C SPACES n -- output n spaces
;C STATE -- a-addr holds compiler state
;C SWAP x1 x2 -- x2 x1 swap top two items
;C TABLE -- create an empty definition pointing to FLASH
;C THEN adrs -- resolve forward branch
;X TIB -- a-addr Terminal Input Buffer
;Z TIBSIZE -- n size of TIB
;Z TOPSEG -- a-addr bottom of top most segment
;U TRUE -- f true flag
;X TUCK x1 x2 -- x2 x1 x2 per stack diagram
;C TYPE c-addr +n -- type line to term'l
;C U. u -- display u unsigned
;X U.R u n -- display u unsigned in n width
;Z U0 -- a-addr current user area adrs
;C U< u1 u2 -- flag test u1<u2, unsigned
;X U> u1 u2 -- flag u1>u2 unsgd (not ANSI)
;Z UCA0RXIE -- adr Interrupt mask UCA0
;Z UD* ud1 d2 -- ud3 32*16->32 multiply
;Z UD/MOD ud1 u2 -- u3 ud4 32/16->32 divide
;Z UINIT -- addr initial values for user area
;C UM* u1 u2 -- ud unsigned 16x16->32 mult.
;C UM/MOD ud u1 -- u2 u3 unsigned 32/16->16
;Z UMAX u1 u2 -- u unsigned maximum
;Z UMIN u1 u2 -- u unsigned minimum
;C UNLOOP -- R: sys1 sys2 -- drop loop parms
;C UNTIL adrs -- conditional backward branch
;U UNUSED -- u bytes left in RAM
;C UPC char -- char capitalize character
;Z USER n -- define user variable 'n'
;Z USEREMIT -- a-addr EMIT pointer
;Z USERKEY -- a-addr KEY pointer
;U VALID? -- f check if user app crc matches infoB
;Z VARBOT -- a-addr bottom of Variable Area
;C VARIABLE -- define a Forth VARIABLE
;Z VEC! x adr --
;U VECBACK -- write back of vectors: dont overwrite newer ones.
;Z VECBOT -- a-addr begining of vector segment
;U VECRESTORE -- unconditional restore all saved vectors.
;U VECSAVE -- save all vectors to infoD
;U VECWIPE -- erase ISR flash, set reset vector = reset to boot 4e4th.
;Z WARM -- use user area from RAM (hopefully intact)
;C WHILE adrs1 -- adrs2 adrs1 branch for WHILE loop
;U WIPE -- erase flash but not kernel, reset user area.
;X WITHIN n1|u1 n2|u2 n3|u3 -- f n2<=n1<n3?
;C WORD char -- c-addr word delim'd by char
;X WORDS -- list all words in dict. Stop and go key version.
;C XOR x1 x2 -- x3 logical XOR
;U XTRA -- increment ext
;X ZERO -- 0 put zero on stack. Often usesd word.
;X ZEROS n -- output n zeros
;C [ -- enter interpretive state
;C ['] -- find word & compile as literal
;C [CHAR] -- compile character literal
;U \ -- backslash
;C ] -- enter compiling state
;U AREA_SIZE = 16 ; UAREA