05a3e72669334d15032112c436b94e5e908c0620
Wipforth
Building and Running
To run, first compile the WebAssembly module:
wat2wasm --enable-threads wipforth.wat
Then run the server:
python3 server.py
You should then be able to open http://localhost:8080 in a browser and use the system from there.
NOTE: The server is just a very simple instantiation of Python's
built-in http.server.HTTPServer, configured to set the cross-origin
headers required for SharedMemoryBuffer use. You could use any HTTP
server that sets these headers.
Peripherals
Terminal
| Name | Offset | Size / B | Access |
|---|---|---|---|
| TXBUF | 0 | 32 | write |
| RXBUF | 32 | 32 | read |
| TXHEAD | 64 | 1 | atomic read |
| TXTAIL | 65 | 1 | atomic write |
| RXHEAD | 66 | 1 | atomic write |
| RXTAIL | 67 | 1 | atomic read |
For both sending (TX) and receiving (RX), there are three
registers: xBUF, xHEAD and xTAIL:
xBUFregisters are 32-byte FIFO ring buffers used for data- The
xHEADandxTAILregisters specify the start and end of data in the ring buffer,xHEADbeing the offset of the first byte of data, andxTAILbeing the offset of the first byte after the data.
In order to be distinguishable from the empty state, the ring buffers must never be completely full -- there must always be at least one unoccupied byte between the tail and the head.
Description
Languages
JavaScript
52.3%
Witcher Script
33.5%
Scheme
9.4%
Forth
3.9%
CSS
0.5%
Other
0.4%