Giter Site home page Giter Site logo

Comments (7)

francisrstokes avatar francisrstokes commented on May 24, 2024

Hey thanks for the feedback! The encoding strategy you've proposed is really nice compared with my brute force LDV16 pseudo approach 😄. The only problem I could possibly see is that all numbers are unsigned, so it wouldn't be possible to use ADI d, -1.

That said, a lot of what you've said could definitely improve the language. Would you be interested in opening a pull request with you're proposed changes?

from 16bitjs.

hlide avatar hlide commented on May 24, 2024

What do you mean by "all numbers are unsigned"? for a 16-bit addition, the result with signed or unsigned addends is the same. For instance, 0xFFFE + 0xFFFF = 0xFFFD. 0xFFFD can be seen as 65533 or -3, it's just a subjective viewpoint. When using ADD mode through bit 0 in OO, you just need to sign-extend the immediate value before adding it to register.

from 16bitjs.

hlide avatar hlide commented on May 24, 2024

"opening a pull request with you're proposed changes": do you suggest for me to clone your project, do the changes and then open pull request here?

from 16bitjs.

francisrstokes avatar francisrstokes commented on May 24, 2024

for a 16-bit addition, the result with signed or unsigned addends is the same. For instance, 0xFFFE + 0xFFFF = 0xFFFD. 0xFFFD can be seen as 65533 or -3, it's just a subjective viewpoint

Ah good point. As for pull request, yes that's normally the easiest way.

from 16bitjs.

hlide avatar hlide commented on May 24, 2024

hum, there are that assembler and that bf compiler... if I don't want to touch that bf compiler, I'd better to keep LDV16 but as a pseudo using the new instruction and define LDV as a pseudo as well. I could also keep INC and DEC the same way. But I would need to rename the real instruction LDV with another name - unless there is a way to have an optional third argument, that is LDV D, imm <=> LDV D, imm, 0. Is that possible?

from 16bitjs.

francisrstokes avatar francisrstokes commented on May 24, 2024

3rd argument can definitely work. While I agree the names are not the best, I'd rather take the path of least resistance when it comes to changes.

from 16bitjs.

francisrstokes avatar francisrstokes commented on May 24, 2024

Merged proposal to master

from 16bitjs.

Related Issues (20)

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.