GithubHelp home page GithubHelp logo

inc 256 about fastbasic HOT 3 OPEN

dmsc avatar dmsc commented on May 22, 2024
inc 256

from fastbasic.

Comments (3)

dmsc avatar dmsc commented on May 22, 2024

Hi!

I was wondering if you could add a way of incrementing an integer by 256.

I suspect this would be just like inc only you'd increment the hi byte instead of the lo byte of the integer.

Yes, would be easy to implement, but it would take some extra bytes in the IDE and not be substantially faster.

What is your use case? Do you need something faster than A = A + 256, or do you need smaller code?

Have Fun!

from fastbasic.

ukcroupier avatar ukcroupier commented on May 22, 2024

Yeah, it's just for working with memory, moving things up and down screen when each line is a page.

inc a is 3x faster than a=a+1 so I figured inc256 would be similar speed and not too much work or memory wastage for you.

It's no big requirement, just thought it might be useful if it's simple to code and doesn't use too much space.

from fastbasic.

dmsc avatar dmsc commented on May 22, 2024

Hi!

Yeah, it's just for working with memory, moving things up and down screen when each line is a page.

inc a is 3x faster than a=a+1 so I figured inc256 would be similar speed and not too much work or memory wastage for you.

I could add this as an optimization to the cross compiler, converting A=A+256 to a faster variant, so that the native compiler does not get bigger.

If (when) I finish the cross compiler to native code, it will certainly optimize this.

Have Fun!

from fastbasic.

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.