README.txt 1.5 KB

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