annotate runtime/macros/urm/README.txt @ 7039:338aa8cac96d

Added tag v7.4.832 for changeset 76042a56ab85f1e53cd49e5341756b1cd7403e08
author Christian Brabandt <cb@256bit.org>
date Tue, 25 Aug 2015 17:20:27 +0200
parents 3fc0f57ecb91
children d6dde6229b36
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 This is another proof that Vim is perfectly compatible with Vi.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 The URM macro package was written by Rudolf Koenig ("Rudi")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 (rudolf@koeniglich.de) for hpux-vi in August 1991.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 Getting started:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 in your shell: vim urm<RETURN>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 in vim: :so urm.vim<RETURN>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 in vim: * (to load the registers and boot the URM-machine :-)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 in vim: g (for 'go') and watch the fun. Per default, 3 and 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 are multiplied. Watch the Program counter, it is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 visible as a komma moving around.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 This is a "standard URM" (Universal register machine) interpreter. The URM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 concept is used in theoretical computer science to aid in theorem proving.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 Here it proves that vim is a general problem solver (if you bring enough
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 patience).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 The interpreter begins with register 1 (not 0), without macros and more-lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 capability. A dot marks the end of a program. (Bug: there must be a space
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 after the dot.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 The registers are the first few lines, beginning with a '>' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 The program is the first line after the registers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 You should always initialize the registers required by the program.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 Output register: line 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 Input registers: line 2 to ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 Commands:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 a<n> increment register <n>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 s<n> decrement register <n>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 <x>;<y> execute command <x> and then <y>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 (<x>)<n> execute command <x> while register <n> is nonzero
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 . ("dot blank") halt the machine.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 Examples:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 Add register 2 to register 3:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 (a2;s3)3.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 Multiply register 2 with register 3:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 (a4;a5;s2)2; ((a2;s4)4; s3; (a1;a4;s5)5; (a5;s1)1)3.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 There are more (complicated) examples in the file examples.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 Note, undo may take a while after a division.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47