- This is still a work in progress. It may be changed in the future.
Screwtape is an esoteric programming language designed as a format for a tape reader. The tape reader, or virtual machine, is in one of several states as its head moves over the tape.
Virtual Machine Description
So the virtual machine has a tape, full of 2^16 bytes, which stores both the code and data. Registers are: acc - an accumulator, head - tape head, which is usually incremented. There's also an array tracks of pointers to various addresses in the tape. Currently incomplete, much subject to change
|Exec||Reads bytes from the tape as instructions|
|Outpn||Outputs bytes from the tape until reaching a null byte, upon which state switches to exec|
|Outpd||Outputs bytes from the tape while decrementing acc, until acc is equal to 0|
|Inp||Reads characters from inp to the tape while decrementing acc, until acc is equal to 0|
These are executed when the state is exec
||go to output mode*|
||go to input mode|
||Sets the location of the track with number of acc to pointed by the next two bytes in little endian|
||Plays the track with ID of acc|