The virtual machine for trivial Brainfuck semantic programming language. This project contains virtual machine, compilers, basic libraries for brainfuck-like programming language construction.
Brainfuck virtual machine is a memory-base virtual machine. Compile (brainfuck,aSSfuck,reversefuck,Alphuck) to bytecode. Use brainfuck virtual machine to execute bytecodes. Or Decode bytecodes to (brainfuck,aSSfuck,reversefuck,Alphuck).
brainfuck\ /enecoded to Triplet aSSfuck ------------------------> (packed bytecode) ------------------------> (run on bfvm) Alphuck/ \encoded to Ook!| Instruction | Description |
|---|---|
| 0000 | Increment the memory cell under the pointer |
| 0001 | Decrement the memory cell under the pointer |
| 0010 | Move the pointer to the right |
| 0011 | Move the pointer to the left |
| 0100 | Output the character signified by the cell at the pointer |
| 0101 | Input a character and store it in the cell at the pointer |
| 0110 | Begin of loop structure, Jump out loop structured if the cell under the pointer is 0 |
| 0111 | End of loop structure, Jump to Begin of loop structure |
| 1000 | No Processing |
Bytecode contains 4 bits of binary. Then make two bytecodes to a byte (8 bits). 50% Packed.
| packed bytecode | Description |
|---|---|
| 0000 0000 | ++*ptr , ++*ptr |
| 0110 0010 | while(*ptr){ , ++ptr |
| 0011 0111 | --pre , } |
aSSfuck is a joke programming language that uses brainfuck's semantic.
AsS hello.ass Hello World! for aSSfuckASSassassassassassassassassassassAsSaSsassassassassassassassaSsassassassassassassassassassassaSsassassassaSsassasSasSasSasSAssASSaSsassassASsaSsassASsassassassassassassassASsASsassassassASsaSsassassASsasSasSassassassassassassassassassassassassassassassASsaSsASsassassassASsAssAssAssAssAssAssASsAssAssAssAssAssAssAssAssASsaSsassASsaSsASsDumpbin by hexdmp
$ ass hello.ass$ hexdmp -h hello.ass.pbc== hello.ass.pbc ==0000000000000000: 067500000000002600000020000000000000000000000010: 000200023333710240020400000044000000000000000020: 400240330000000000000040420040110000000000000030: 11111411111141022484$ bfvm hello.ass.pbcHello World!$ bc2brainfuck hello.ass.pbc[+,]++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.- Manual cell type such as char, short, int, long long int via CELL_T in Makefile.in
- Fixed tape size, manual tape size via TAPESIZE in Makefile.in
- At the begin of TAPE, can not move cell ptr to left
- At the end of TAPE, can not move cell ptr to right
- Output INST::PUT_VALUE as binary
- Default EOF is lib's EOF, manual EOF behavior by EOF_UNCHANGED, EOF_MINUS1, EOF_0 in Makefile.in
- Fixed program size but reuseable
- Program as iterator not stream
- Error management, Segmentation fault is imposible!!!!!!
- Email: booskillerz@gmail.com
- FB: facebook.com/watt.duean