chaabaj / bricksvm Goto Github PK
View Code? Open in Web Editor NEWA modular Virtual Machine which virtual device can be attached
A modular Virtual Machine which virtual device can be attached
Write simple cpu
CPU must have 16 register for each program and 16 floating point register for each program
Instruction:
scpu_reg_read(index) // Return 64 bit integer value
scpu_fpreg_read(index) // Return a double value
scpu_reg_write(index, value)
scpu_fpreg_write(index, value)
scpu_add(value1, value2)
scpu_sub(value1, value2)
scpu_mul(value1, value2)
scpu_mod(value1, value2)
scpu_or(value1, value2)
scpu_xor(value1, value2)
scpu_and(value1, value2)
scpu_leftshift(value1, value2)
scpu_rightshift(value1, value2)
Create a simple video device
Each program have its own video space or screen(as you want)
Instruction:
put_pixel(x, y, value)
read_pixel(x, y)
write_char(x, y, value)
Create a parser for the language of the virtual machine.
Syntax is :
For instruction :
instruction(param1, param2, ..., paramN)
For parameter:
Two type of parameter: Value and instruction
like : instruction(instruction1(param), Int8:42, 42)
For value:
Type_specifier:value
if no type specifier is available deduce them like (42.1 -> Double, 42 -> Int32)
We can have label that you need to translate into index(index are absolute not relative)
Example:
toto:
instruction_1(param1)
bla:
jump("toto") // Transformed to jump(0)
Write a simple memory device.
Instruction required:
mem_read(adress, sizeToRead)
mem_write(adress, value)
mem_get_size()
The memory should be divided into multiple part to avoid collision between programs
Each program have its own memory zone.
Write a simple audio device that play audio from memory address
load_sound(channel, memAddr, size)
load_music(channel, memAddr, size)
play_music(channel)
play_sound(channel)
pause_sound(channel)
pause_music(channel)
stop_music(channel)
stop_sound(channel)
unload_sound(channel)
unload_music(channel)
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.