|
| 1 | +libable_misc |
| 2 | + |
| 3 | +libable_misc implements a MISC-inspired virtual machine component as a library |
| 4 | + |
| 5 | +REQUIREMENTS |
| 6 | + |
| 7 | +BSD Make |
| 8 | +Clang |
| 9 | +libable |
| 10 | + |
| 11 | +GETTING STARTED |
| 12 | + |
| 13 | +Building and installing on OpenBSD |
| 14 | + |
| 15 | +$ cp config.mk.def config.mk |
| 16 | +$ make install |
| 17 | +... |
| 18 | +$ |
| 19 | + |
| 20 | +Building and installing on Ubuntu |
| 21 | + |
| 22 | +# apt install bmake clang |
| 23 | +... |
| 24 | +# exit |
| 25 | +$ cp config.mk.def config.mk |
| 26 | +$ bmake -DCOMPAT_LINUX install |
| 27 | +... |
| 28 | +$ |
| 29 | + |
| 30 | +Building and installing on macOS |
| 31 | + |
| 32 | +# brew install bmake |
| 33 | +... |
| 34 | +# exit |
| 35 | +$ cp config.mk.def config.mk |
| 36 | +$ bmake -DCOMPAT_MACOS install |
| 37 | +... |
| 38 | +$ |
| 39 | + |
| 40 | +GETTING INVOLVED |
| 41 | + |
| 42 | +Contact Details |
| 43 | + |
| 44 | +Find us online at ablevm.org or email us at [email protected] |
| 45 | + |
| 46 | +Code of Conduct |
| 47 | + |
| 48 | +Respect each other and please don't spam |
| 49 | + |
| 50 | +LICENSE |
| 51 | + |
| 52 | +ISC-style license |
| 53 | + |
| 54 | +DETAILS |
| 55 | + |
| 56 | +Virtual Machine |
| 57 | + |
| 58 | + i |
| 59 | + p |
| 60 | + c... |
| 61 | + ...d |
| 62 | + r... |
| 63 | + |
| 64 | + i 8 bits instruction |
| 65 | + p 64 bits program counter |
| 66 | + d 64 bits ... linear data-stack |
| 67 | + c 64 bits ... linear call-stack |
| 68 | + r 64 bits ... registers |
| 69 | + |
| 70 | +8 bit unencoded instructions |
| 71 | + |
| 72 | +Byte addressed memory with auto-alignment and auto-framing |
| 73 | + |
| 74 | +General-purpose registers OR base+offset address registers |
| 75 | + |
| 76 | +Standard Instruction Set |
| 77 | + |
| 78 | + 00 ; 08* r! 10 push 18 + |
| 79 | + 01 ex 09* r@ 11 pop 19 - |
| 80 | + 02+ name ; 0A* @r 12 lshift 1A * |
| 81 | + 03+ name 0B* !r 13 ashift 1B /mod |
| 82 | + |
| 83 | + 04+ if 0C* @r+ 14 not 1C drop |
| 84 | + 05+ -if 0D* !r+ 15 and 1D dup |
| 85 | + 06+ next 0E* -@r 16 or 1E over |
| 86 | + 07+ lit 0F* -!r 17 xor 1F swap |
| 87 | + |
| 88 | +c20 ; c28* r! h30 ; h38* r! |
| 89 | +c21 ex c29* r@ h31 ex h39* r@ |
| 90 | +c22+ name ; c2A* @r h32+ name ; h3A* @r |
| 91 | +c23+ name c2B* !r h33+ name h3B* !r |
| 92 | + |
| 93 | +c24+ if c2C* @r+ h34+ if h3C* @r+ |
| 94 | +c25+ -if c2D* !r+ h35+ -if h3D* !r+ |
| 95 | +c26+ next c2E* -@r h36+ next h3E* -@r |
| 96 | +c27+ lit c2F* -!r h37+ lit h3F* -!r |
| 97 | + |
| 98 | +d40 ; d48* r! 50 i@ 58 rshift |
| 99 | +d41 ex d49* r@ 51 i! 59 u< |
| 100 | +d42+ name ; d4A* @r 52 = 5A u* |
| 101 | +d43+ name d4B* !r 53 < 5B u/mod |
| 102 | + |
| 103 | +d44+ if d4C* @r+ 54 negate 5C nip |
| 104 | +d45+ -if d4D* !r+ 55 abs 5D tuck |
| 105 | +d46+ next d4E* -@r 56 min 5E rot |
| 106 | +d47+ lit d4F* -!r 57 max 5F -rot |
| 107 | + |
| 108 | + 60 68 70 78 |
| 109 | + 61 69 71 79 |
| 110 | + 62 6A 72 7A |
| 111 | + 63 6B 73 7B |
| 112 | + |
| 113 | + 64 6C 74 7C |
| 114 | + 65 6D 75 7D |
| 115 | + 66 6E 76 7E |
| 116 | + 67 6F 77 7F |
| 117 | + |
| 118 | +Extended Instruction Set |
| 119 | + |
| 120 | + 80 wait 88 90 98 |
| 121 | + 81 clip 89 91 99 |
| 122 | + 82 recv 8A 92 9A |
| 123 | + 83 send 8B 93 9B |
| 124 | + |
| 125 | + 84 8C 94 9C |
| 126 | + 85 8D 95 9D |
| 127 | + 86 8E 96 9E |
| 128 | + 87 8F 97 9F |
| 129 | + |
| 130 | + w = 32 bit default |
| 131 | + c = 8 bit variant |
| 132 | + h = 16 bit variant |
| 133 | + d = 64 bit variant |
| 134 | + |
| 135 | ++ followed by n bit immediate where n is w, c, h or d |
| 136 | +* followed by 8 bit register |
0 commit comments