| 1 | # Overview # |
| 2 | |
| 3 | This folder contains a library of useful functions written in VVhitespace. |
| 4 | Standard include guards are used with `cpp` to include the stdlib in user |
| 5 | programs. For an example, see `examples/hello-stdlib`. |
| 6 | |
| 7 | # Reservations # |
| 8 | |
| 9 | Since all labels share a global namespace, the standard library makes the |
| 10 | following reservations: |
| 11 | |
| 12 | ## Label ## |
| 13 | |
| 14 | 00000000 0xxxxxxx - reserved for stdlib function entry points |
| 15 | 00000000 1xxxxxxx - unassigned |
| 16 | 0xxxxxxx xxxxxxxx - reserved for private use by stdlib |
| 17 | 1xxxxxxx xxxxxxxx - available for use in user programs |
| 18 | |
| 19 | ## Heap ## |
| 20 | |
| 21 | The first 256 heap addresses are reserved when using the stdlib. |
| 22 | |
| 23 | # Entry Points # |
| 24 | |
| 25 | The following labels are entry points to stdlib functions. Read the |
| 26 | header comment for each function to learn the call and return stack. |
| 27 | |
| 28 | stdio.pvvs: |
| 29 | 1000 - print string from stack |
| 30 | 1001 - print string from heap |
| 31 | |
| 32 | # Misc # |
| 33 | |
| 34 | By convention, each public stdlib label will have 8 bits of |
| 35 | private label space associated with it, formed as follows: |
| 36 | |
| 37 | 00001000 xxxxxxxx - for use by 1000 |
| 38 | 00001001 xxxxxxxx - for use by 1001 |
| 39 | ...etc |