dannguyen8189 / beef Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ahaggart/beef
MISC (minimal instruction set computer) design specs and notes
License: MIT License
This project forked from ahaggart/beef
MISC (minimal instruction set computer) design specs and notes
License: MIT License
================================================================================ BeeF Processor Design Notes ================================================================================ ISA: width: 3 bits (8 instructions) --> see: https://en.wikipedia.org/wiki/Brainfuck 000[ ^ ]: PSH - push current cell to stack 001[ + ]: INC - increment data 010[ - ]: DEC - decrement data 011[ > ]: MVR - move data head right 100[ < ]: MVL - move data head left 101[ [ ]: CBF - if data is 0, skip to matching "]" 110[ ] ]: CBB - if data is not 0, skip to matchin "[" 111[ _ ]: POP - pop item from stack, overwriting current cell ================================================================================ Assembling: - BeeF is a minimal ISA, so the assembler must do extra work to provide some basic functionality *** Basic Building Blocks *** ADD: current cell and next cell [->+<] SUB: current cell and next cell [->-<] ZER: zero the current cell [-] *** Complex Assembler Constructs *** - for operations which use the swap register, their functional block must restore the register value on completion INV: invert the current cell >^[-]<[->-<]>-^<_>_< SHR: right-shift cell value by doubling it >^[-]<[->++<]>^<_>_< NOT: logical not of the current cell - use the right adjacent cell as scratch space loop condition >^[-]^<[ [-]->_+^- ] + >__ IFT BLOCK 1 ELS BLOCK 2 END: if-then-else construct - if the current cell is nonzero, then execute BLOCK 1 - else execute BLOCK 2 - uses one cell of scratch space, to the left 1) Store a one on the stack <^[-]+^> 2) try loop 1 [> i) execute BLOCK 1 BLOCK 1 ii) pop stored one, store a zero <<_-^ ] 3) pop stored value _ 4) try loop 2 [> i) execute BLOCK 2 BLOCK 2 <<[-] 5) restore scratch space ]_> <^[-]+^>[> BLOCK 1 <<_-^]_[> BLOCK 2 <<[-]]_> SHL: left-shift cell value by halving it 1) use c-1 as scratch space <^> 2) use c+1 as construction site >^[-]< 3) loop: [ i) decrement operand - ii) copy operand to scratch ^<_ iii) check zero in scratch [> iv) decrement operand - v) increment result >+< vi) break out of conditional <[-] ] vii) check operand > ] 4) clean up >^<_>_<<_> <^>>^[-]<[-^<_[>->+<<[-]]>]>^<_>_<<_>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.