4 ASM CODE HI2LO COLD WARM (WARM) WIPE RST_HERE
5 PWR_HERE RST_STATE PWR_STATE MOVE LEAVE +LOOP LOOP DO
6 REPEAT WHILE AGAIN UNTIL BEGIN THEN ELSE IF
7 ; : DEFER DOES> CREATE CONSTANT VARIABLE POSTPONE
8 RECURSE IMMEDIATE IS ['] ] [ \ '
9 ABORT" ABORT QUIT EVALUATE COUNT LITERAL , EXECUTE
10 >NUMBER FIND WORD ." S" TYPE SPACES SPACE
11 CR (CR) NOECHO ECHO EMIT (EMIT) (ACCEPT) ACCEPT
12 KEY (KEY) C, ALLOT HERE . D. U.
13 SIGN HOLD #> #S # <# BL STATE
14 BASE >IN CPL TIB PAD J I UNLOOP
15 U< > < = 0> 0< 0= DABS
16 ABS NEGATE XOR OR AND - + C!
17 C@ ! @ DEPTH R@ R> >R ROT
18 OVER SWAP NIP DROP ?DUP DUP LIT EXIT
23 ?GOTO GOTO FW3 FW2 FW1 BW3 BW2 BW1
24 ?JMP JMP REPEAT WHILE AGAIN UNTIL ELSE THEN
25 IF 0= 0<> U>= U< 0< 0>= S<
26 S>= RRUM RLAM RRAM RRCM POPM PUSHM CALL
27 PUSH.B PUSH SXT RRA.B RRA SWPB RRC.B RRC
28 AND.B AND XOR.B XOR BIS.B BIS BIC.B BIC
29 BIT.B BIT DADD.B DADD CMP.B CMP SUB.B SUB
30 SUBC.B SUBC ADDC.B ADDC ADD.B ADD MOV.B MOV
31 RETI LO2HI COLON ENDASM ENDCODE (SLEEP) SLEEP
36 [DEFINED] [UNDEFINED] [IF] [ELSE] [THEN] COMPARE MARKER
41 DEFINITIONS ONLY PREVIOUS ALSO ASSEMBLER FORTH VOCABULARY
46 >BODY SOURCE .( ( DECIMAL HEX FILL [CHAR]
47 CHAR +! MIN MAX 2/ 2* 1- 1+
48 RSHIFT LSHIFT INVERT 2OVER 2SWAP 2DROP 2DUP 2!
49 2@ S>D CELL+ CELLS CHAR+ CHARS ALIGN ALIGNED
50 */ */MOD MOD / /MOD * FM/MOD SM/REM
51 UM/MOD M* UM* {ANS_COMP}
59 SD_CARD_READ_WRITE ADD-ON
60 -------------------------
61 TERM2SD" SD_EMIT WRITE READ CLOSE DEL" WRITE" READ"
66 DUMP U.R WORDS ? .RS .S {UTILITY}
71 DIR FAT CLUSTER SECTOR {SD_TOOLS}
74 ; a word within brackets [] is an immediate word. (other words may also be immediate)
75 ; a word doubled with another word between parentheses () is a DEFERred word, the first being initialised with the second.
76 ; when ADD-ONs are compiled into the kernel, their respective MARKER word identified with braces {} does nothing.
78 ; the words that are not commented are ANS94 compliant; search for their definition here: https://forth-standard.org/search
83 ASM <word> -- used to begin an assembler word which is not interpretable by FORTH (because use of CALL ... RET).
84 this defined <word> must be ended with ENDASM.
86 CODE <word> -- begins an assembler word interpretable by FORTH (MOV @IP+,PC instead of CALL ... RET)
87 this defined <word> must be ended with ENDCODE.
89 HI2LO -- used to switch from a high level (FORTH) to low level (assembler) modes.
91 COLD -- Software reset
93 WARM -- DEFERred word initialized by default with (WARM)
95 (WARM) -- performs a hot start
97 WIPE -- resets the program memory to its original state before any add.
99 RST_HERE -- defines the bound of the program memory protected against COLD or hardware reset.
101 PWR_HERE -- defines the bound of the program memory protected against ON/OFF.
103 RST_STATE -- remove all words defined after RST_HERE
105 PWR_STATE -- remove all words defined after PWR_HERE
178 CPL -- size of terminal input buffer TIB
179 TIB -- addr of terminal input buffer TIB
214 LIT -- execution part of LITERAL
219 ASSEMBLER WORDS see: http://www.ece.utep.edu/courses/web3376/Notes_files/ee3376-isa.pdf
220 http://www.ti.com/lit/ug/slau367n/slau367n.pdf#page=158
221 howto.md for symbolic alias of registers, symbolic jumps (IF ELSE THEN...),..
225 ?GOTO used after a conditionnal to branch to a label FWx or BWx
226 GOTO used as unconditionnal branch to a label FWx or BWx
228 FW3 FORWARD branch destination n°3
232 BW3 BACKWARD branch destination n°3
236 ?JMP used after a conditionnal to jump to a defined word
237 JMP unconditionnal jump to a defined word
239 REPEAT assembler version of the FORTH word REPEAT
251 0< conditionnal, to use only with ?JMP ?GOTO
252 0>= conditionnal, to use only with IF UNTIL WHILE
256 RRUM used as : RRUM n,REG with 0 < n < 5
260 POPM POP multiple registers, used as : POPM X,S to pop X,W,T,S
261 PUSHM PUSH multiple registers, used as : PUSHM S,X to push S,T,W,X
263 CALL see TI assembler
298 LO2HI switch between low level and high level interpretation mode (counterpart of HI2LO), without saving IP.
299 COLON PUSH IP then performs LO2HI, used as CODE <word> ... assembler cmd ... COLON ... FORTH words ... ;
300 ENDASM to end an ASM definition
301 ENDCODE to end a CODE definition
302 (SLEEP) the default SLEEP definition
303 SLEEP DEFERred word initialised with (SLEEP), which enables to create a background task.