Giter VIP home page Giter VIP logo

Comments (6)

cdluv avatar cdluv commented on August 24, 2024

from jasm.

alexgarzao avatar alexgarzao commented on August 24, 2024

from jasm.

roscopeco avatar roscopeco commented on August 24, 2024

Hello! Glad to hear you're finding it useful, and thank you for the kind comments :)

The issue you're having is caused by the iconst lines - the correct syntax for iconst is:

iconst <num>

i.e. there are not separate instructions for the individual constants. If you remove the underscore, e.g.

iconst_1     => iconst 1
iconst_0     => iconst 0

Then it should work 🙂

So that's a workaround, however I do consider this to be a bug - it should be giving useful error messaging rather than a NullPointerException so will look at getting that fixed - thanks for the report!

from jasm.

alexgarzao avatar alexgarzao commented on August 24, 2024

Using "iconst 0" and "iconst 1" works fine. Thanks :-)

Just a small question about the project. Is JASM intended to implement all JVM opcodes? In that case, I suggest taking a look at [Oracle documentation](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#:~:text=an% 20ArrayIndexOutOfBoundsException.- ,iconst_%3Ci%3E,-Operation). In this document, if I'm not mistaken, there are opcodes iconst_0 and iconst_1.

from jasm.

roscopeco avatar roscopeco commented on August 24, 2024

great, glad to hear the workaround fixed it for you 🥳

Indeed, those are the opcodes, and under the hood jasm assembles the code to the appropriate one based on the number - as an assembler, the syntax is designed to be consistent and convenient rather than necessarily exactly matching the underlying bytecode 🙂.

from jasm.

alexgarzao avatar alexgarzao commented on August 24, 2024

Nice. I got it. Thanks for your help!

from jasm.

Related Issues (13)

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.