Comments (9)
This could be achieved by using 4xa2b
, setting the value of the a register to the b register.
from pocovm.
That only sets the value of ~a
to the value of ~b
Would need to be able to set ~a
to 'd', then using 4x, set ~d
to a value from another cell, BUT if ~a
where set to 'c' initally, 4x would set ~c
instead. Imagine ~a
as a variable that stores the location of the register to change.
Thus you kinda have pointers, which are basically a necessity for doing anything of substance
from pocovm.
You can replace the a
and b
values to the buffers you want to use.
4xa2d
from pocovm.
What if the buffer identifier has to be dynamic? Like it may be 1,2,3,4... etc as the result of a loop
from pocovm.
Asking btw because I'm building a Brainf*ck-to-PocoBytecode compiler to test out a generic Brainf*ck compiler I'm making, will need to access a pointer for the current cell in Brainf*ck
from pocovm.
Im not familiar with brainf*ck really, its not really a language you use for what I typically do. The buffer identifier (a, b, c, 1, 4, ...) can be any single character, if thats what you are asking.
from pocovm.
No one uses brainf*ck for anything :P Just a stupid side-project to get comfortable working on compilers.
I'll make a pull request in a bit, but all I'll be adding is: if the second argument in a 4x command is 1 instead of 2, it does this:
storage[storage[line[1].substring(0, 1)]] = storage[line[1].substring(2, 3)];
(Which uses the value of the first buffer as the buffer identifier for the ACTUAL buffer your setting too. This is similar to a pointer, which is a common part of most close-to-metal languages like C)
instead of this:
storage[line[1].substring(0, 1)] = storage[line[1].substring(2, 3)];
from pocovm.
Okay, I wrote some basic API docs in the wiki if you want to add it.
from pocovm.
For the docs, could you give a quick description of the function?
from pocovm.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pocovm.