FIXME:
Tabulka 11.2. F21 Instruction Set
opcode | name | description | forth |
---|---|---|---|
00 | else | unconditional jump | ELSE |
01 | T=0 | jump if T0-19 zero | DUP IF |
02 | call | push P+1 to R, jump | : |
03 | C=0 | jump if T20 zero | CARRY? IF |
04 | |||
05 | |||
06 | ret | pop P from R | ; |
07 | |||
08 | @R+ | fetch, address in R, increment R | R@ @ R> 1+ >R |
09 | @A+. | fetch, address in A, increment A | A @ @ 1 A +! |
0A | # | fetch 20-bit in-line literal | LIT |
0B | @A | fetch, address in A | A @ @ |
0C | !R+ | store, address in R, increment R | R@ ! R> 1+ >R |
0D | !A+ | store, address in A, increment A | A @ ! 1 A +! |
0E | |||
0F | !A | store, address in A | A @ ! |
10 | com | complement T | -1 XOR |
11 | 2* | shift T, 0 to T0 | 2* |
12 | 2/ | shift T, T20 to T19 | 2/ |
13 | +* | add S to T if T0 one | DUP 1 AND IF OVER + THEN |
14 | -or | exclusive-or S to T | XOR |
15 | and | and S to T | AND |
16 | |||
17 | + | add S to T | + |
18 | pop | pop R, push into T | R> |
19 | A@ | push A into T | A @ |
1A | dup | push T into T | DUP |
1B | over | push S into T | OVER |
1C | push | pop T, push into R | >R |
1D | A! | pop T into A | A ! |
1E | nop | NOP | |
1F | drop | pop T | DROP |
Implementace slov FORTHu jako maker:
: @ A! @A ; : ! A! !A ; : -1 dup dup -or com ; : 0 dup dup -or ; : OR over com and -or ; : SWAP A! push A@ pop ; : long_jump # (com) push ;