Giter Club home page Giter Club logo

Comments (9)

gmisail avatar gmisail commented on July 23, 2024

This could be achieved by using 4xa2b, setting the value of the a register to the b register.

from pocovm.

graypegg avatar graypegg commented on July 23, 2024

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.

gmisail avatar gmisail commented on July 23, 2024

You can replace the a and b values to the buffers you want to use.

4xa2d

from pocovm.

graypegg avatar graypegg commented on July 23, 2024

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.

graypegg avatar graypegg commented on July 23, 2024

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.

gmisail avatar gmisail commented on July 23, 2024

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.

graypegg avatar graypegg commented on July 23, 2024

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.

gmisail avatar gmisail commented on July 23, 2024

Okay, I wrote some basic API docs in the wiki if you want to add it.

from pocovm.

gmisail avatar gmisail commented on July 23, 2024

For the docs, could you give a quick description of the function?

from pocovm.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.