-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwords.sh
executable file
·31 lines (30 loc) · 1.05 KB
/
words.sh
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
#!/bin/sh
#
# ./words.sh
awk '/^; [^ ]+\t/,/^$/ { print }' forth850.asm \
| sed -E 's/^; / /' \
| sed -E 's/^;( | )//' \
| sed -E 's/^([^ ]+)[ ]+(.*)/### \1\n_\2_/' \
| sed -E 's/^;//'
echo
echo '## Additional words included with the full version'
echo
awk '/^;\+ [^ ]+\t/,/^$/ { print }' forth850.asm \
| sed -E 's/^; / /' \
| sed -E 's/^;(\+ | )//' \
| sed -E 's/^([^ ]+)[ ]+(.*)/### \1\n_\2_/' \
| sed -E 's/^;//'
echo
echo '## Floating point math words included with the full version'
echo
echo 'Floating point values are doubles on the stack. Double words, such as 2DUP,'
echo 'can be used to manipulate floats. Floats can be stored in 2CONSTANT, 2VARIABLE'
echo 'and 2VALUE assignments with TO (but not with +TO.)'
echo
echo 'Beware that HEX prevents inputting floats and garbles the output of floats.'
echo
awk '/^;= [^ ]+\t/,/^$/ { print }' forth850.asm \
| sed -E 's/^; / /' \
| sed -E 's/^;(= | )//' \
| sed -E 's/^([^ ]+)[ ]+(.*)/### \1\n_\2_/' \
| sed -E 's/^;//'